David
David

Reputation: 1

Cgi not executing python

I'm having a problem getting CGI to work for Python.

I've added

Options ExecCGI
AddHandler cgi-script cgi py pl

inside /etc/apache2/sites-available/default within

and now Perl works, but Python gives out a 500 Internal Server Error..

EDIT:

This if the current 'default' file

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride AuthConfig
            Order allow,deny
            allow from all

            AddHandler mod_python .py
            PythonHandler mod_python.publisher
            PythonDebug On
    </Directory>

    ScriptAlias /cgi-bin/ /var/www/cgi-bin/
    <Directory "/var/www/cgi-bin/">
            Options +ExecCGI
            AddHandler cgi-script .cgi .py .pl
            Allow from all
    </Directory>

Any ideas?

Upvotes: 0

Views: 2131

Answers (2)

rjv
rjv

Reputation: 6766

Try using the python CGI server instead of apache,if that can meet your needs.

python -m CGIHTTPServer {port number:default 8000}

Upvotes: 0

sp.
sp.

Reputation: 1326

Try renaming the .py files to .cgi, it worked for me.

Upvotes: 1

Related Questions