Hugo, you had added the anything but ability to the reverse proxy mask (!.pl) however, it has become apparent that other cgi programs desperately need the cgi-wrapper protection that Hiawatha includes.
How to exclude more than .pl files? Say .pl, .cgi, .py? (!.pl|!.cgi|.py) doesn't work.
If not possible, could you please make it possible? THANK YOU!
Hugo Leisink
7 July 2014, 08:50
Try !\.(pl|cgi|py) How the anything-but in Hiawatha works is that Hiawatha looks for a !-sign at the beginning and inverses the result of the rest of the expression.
(!.pl|!.cgi|.py) will not work, because it's logically incorrect. Everything is "not A or not B". What you need is a logical-AND, but I'm not aware of an AND operator for this. If it were the &-sign, it would be (!\.pl&!\.cgi&!\.py). Perhaps this page [ocpsoft.org] helps.
chrisf
7 July 2014, 09:30
It worked as you explained, thank you. Perl is executing without problem. However, python always throws a 500 internal server error? Is there any special requirements to run python scripts?
This is my cgi handlers and i have execute cgi directive set to yes in the virtual host.
Hugo Leisink
7 July 2014, 09:34
Not that I'm aware of. What does the error logfile say? If Hiawatha generated the 500, the error logfile should contain the reason. If not, it's very likely that the Python script generated the error. In that case, the execution of the script by Hiawatha was done correctly.
chrisf
7 July 2014, 09:51
107.178.35.20|Mon 07 Jul 2014 03:18:52 -0400|/home/test.py|CGI only printed a HTTP header, no content
My script is
#!/usr/bin/python
print "Hello, Python!";
Which works from the cli.
Hugo Leisink
7 July 2014, 09:53
Your script doesn't follow the CGI standard. For every CGI script, follow these rules: 1: Print at least a Content-Type header. 2: Every header line should end with CRLF. 3: Close the header by printing an empty line.