You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jason Friedman <js...@gmail.com> on 2014/05/19 04:56:35 UTC
[users@httpd] CGI script returns content of file
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
AW: [users@httpd] CGI script returns content of file [wd-vc]
Posted by "Bremser, Kurt (AMOS Austria GmbH)" <Ku...@allianz.at>.
I do not think that AddHandler is correct inside a <Directory> block
Kurt Bremser
Newton was wrong. There is no gravity. The Earth sucks.
________________________________
Von: Jason Friedman [jsf80238@gmail.com]
Gesendet: Montag, 19. Mai 2014 04:56
An: users@httpd.apache.org
Betreff: [users@httpd] CGI script returns content of file [wd-vc]
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
AMOS Austria GmbH
1130 Wien, Hietzinger Kai 101-105
FN 365014k, Handelsgericht Wien
UID: ATU 66614737
http://www.allianz.at
********************************************************
Dieses E-Mail und allfaellig daran angeschlossene Anhaenge
enthalten Informationen, die vertraulich und
ausschliesslich fuer den (die) bezeichneten Adressaten
bestimmt sind.
Wenn Sie nicht der genannte Adressat sind, darf dieses
E-Mail samt allfaelliger Anhaenge von Ihnen weder anderen
Personen zugaenglich gemacht noch in anderer Weise
verwertet werden.
Wenn Sie nicht der beabsichtigte Empfaenger sind, bitten
wir Sie, dieses E-Mail und saemtliche angeschlossene
Anhaenge zu loeschen.
Please note: This email and any files transmitted with it is
intended only for the named recipients and may contain
confidential and/or privileged information. If you are not the
intended recipient, please do not read, copy, use or disclose
the contents of this communication to others and notify the
sender immediately. Then please delete the email and any
copies of it. Thank you.
********************************************************