Breezy - Getting apache to execute python scripts

Gregory Piñero gregpinero at gmail.com
Fri Sep 30 01:56:46 UTC 2005


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,
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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050929/a62ffd89/attachment.html>


More information about the ubuntu-users mailing list