Problem running python as cgi script
Hi, I have a virtual dedicated server. And I am trying to run Python as CGI script.
1. When I run "rpm -qa | grep python" I get following :
2. I have installed Python3.2 from source in /opt/python3/
3.Running "which python" gives me "/usr/bin/python"
4. In my Apcahe's httpd.conf file, i have made following changes :
i) AddHandler cgi-script .cgi .py .c
ii) ScriptAlias /cgi-bin/ "/home/asn2012/public_html/cgi-bin/"
iii) <Directory "/home/w34admin/public_html/cgi-bin/">
Allow from all
iv) <Directory /home/*/public_html/cgi-bin>
5. There is not issue of uploading file in ASCII mode, since I have created the script on the server itself using vim.
6. The file I want to run has got "chmod a+x filename"
Now when I place the file demo.py within /home/asn2012/public_html/cgi-bin/ and point my browser to the file, it gives "Internal Server Error".
When I tail the log file, it gives me
[Fri Apr 20 00:43:02 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Apr 20 00:43:02 2012] [notice] Digest: done
[Fri Apr 20 00:43:02 2012] [warn] No JkLogFile defined in httpd.conf. Using default /etc/httpd/logs/mod_jk.log
[Fri Apr 20 00:43:02 2012] [warn] No JkShmFile defined in httpd.conf. Using default /etc/httpd/logs/jk-runtime-status
[Fri Apr 20 00:43:02 2012] [notice] mod_python: Creating 4 session mutexes based on 50 max processes and 0 max threads.
[Fri Apr 20 00:43:02 2012] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
Please help me out to successfully run the script. Thanks in advance.