httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Friedman <jsf80...@gmail.com>
Subject [users@httpd] CGI script returns content of file
Date Mon, 19 May 2014 02:56:35 GMT
I'm using Apache 2.4.6.

Apache:
$ tail /etc/apache2/apache2.conf
ScriptAlias /python/ /var/www/python/
<Directory "/var/www/python">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    AddHandler cgi-script .py
    AddHandler default-handler .html .htm
</Directory>

CGI script:
$ ls -ld /var/www/python
drwxr-xr-x 2 root root 4096 May 17 17:30 /var/www/python/
$ ls -ld /var/www/python/my_script.py
-rwxr-xr-x 1 root root 106 May 17 17:29 /var/www/python/my_script.py

Yet, when I do:
$ curl http://localhost/python/my_script.py

I get:
#!/opt/python/bin/python
print("Content-Type: text/html")
print()
print ("""<H1>Hello, world!</H1>""")

instead of my desired HTML output.

Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message