apache - I can not interpret code with python cgi -


i error:

127.0.0.1 - - [18/aug/2014:10:40:49 -0700] "get /code.py http/1.1" 304 178 "-" "mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, gecko) chrome/36.0.1985.143 safari/537.36" 

i have enabled module "mod_wsgi" in apache interpreted "py" files. know not php python want try this. configuration follows:

/usr/lib/cgi-bin/code.py

#!/usr/bin/env python print "content-type: text/html" print print 'hello world' 

/etc/apache2/sites-available/example-python.conf

<virtualhost *:80>    servername example-python    documentroot "/usr/lib/cgi-bin"  scriptalias /cgi-bin/ /usr/lib/cgi-bin/     <directory "/usr/lib/cgi-bin">         allowoverride none         options +execcgi -multiviews +symlinksifownermatch         order allow,deny         allow         addhandler cgi-script .cgi .py     require granted      </directory>      logformat "%h %l %u %t \"%r\" %>s %b \"%{referer}i\" \"%{user-agent}i\"" combined    #customlog logs/localhost.log combined </virtualhost 


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -