开发者

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?


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


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

python -m CGIHTTPServer {port number:default 8000}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜