Breezy - Getting apache to execute python scripts

David david at kenpro.com.au
Fri Sep 30 07:17:22 UTC 2005


On Thu, Sep 29, 2005 at 09:56:46PM -0400, Gregory Pi?ero wrote:
> Hi guys,
> 
> I just installed Breezy and I just can't get apache to run python scripts.
> When I go to the address of the script, the browser just prompts me to
> download the script!
> 
> The file is /var/www/journal/journalread.py and it has 755 permissions. It
> has "#!usr/bin/env python" as the first line. I also installed mod_python,
        ^^^^

#!/usr

did you miss the / or was that a typo?



> but that didn't seem to help either.
> 
> Thanks in advance for you help.
> 
> --
> Gregory Pi?ero
> Chief Innovation Officer
> Blended Technologies
> (www.blendedtechnologies.com <http://www.blendedtechnologies.com>)
> 
> Below is the file /etc/apache2/sites-available/default (which I think is
> what I should be editing?)
> 
> NameVirtualHost *
> <VirtualHost *>
> ServerAdmin webmaster at localhost
> 
> DocumentRoot /var/www/apache2-default
> <Directory />
> AddHandler python-program .py
> Options FollowSymLinks ExecCGI
> AllowOverride None
> </Directory>
> <Directory /var/www/>
> AddHandler python-program .py
> Options Indexes FollowSymLinks MultiViews ExecCGI
> AllowOverride None
> Order allow,deny
> allow from all
> # This directive allows us to have apache2's default start page
> # in /apache2-default/, but still have / go to the right place
> # Commented out for Ubuntu
> #RedirectMatch ^/$ /apache2-default/
> </Directory>
> <Directory /var/www/apache2-default/>
> AddHandler python-program .py
> Options FollowSymLinks ExecCGI
> AllowOverride None
> </Directory>
> <Directory /var/www/apache2-default/journal>
> AddHandler python-program .py
> Options FollowSymLinks ExecCGI
> AllowOverride None
> </Directory>
> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
> <Directory "/usr/lib/cgi-bin">
> AddHandler python-program .py
> AllowOverride None
> Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
> Order allow,deny
> Allow from all
> </Directory>
> 
> ErrorLog /var/log/apache2/error.log
> 
> # Possible values include: debug, info, notice, warn, error, crit,
> # alert, emerg.
> LogLevel warn
> 
> CustomLog /var/log/apache2/access.log combined
> ServerSignature On
> 
> Alias /doc/ "/usr/share/doc/"
> <Directory "/usr/share/doc/">
> Options Indexes MultiViews FollowSymLinks
> AllowOverride None
> Order deny,allow
> Deny from all
> Allow from 127.0.0.0/255.0.0.0 <http://127.0.0.0/255.0.0.0> ::1/128
> </Directory>
> 
> </VirtualHost>

> -- 
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> http://lists.ubuntu.com/mailman/listinfo/ubuntu-users





More information about the ubuntu-users mailing list