I'm trying to get perl CGI programs to work from the cgi-bin (actually a sub-directory cgi-bin/various) and have set appropriate permissions using chmod 755. I'm currently testing using the simplest cgi program, you know the one: #!/usr/bin/perl # howdy--the easiest of CGI programs
use CGI;
print <<END_of_Multiline_Text; Content-type: text/html
<HTML> <HEAD> <TITLE>Hello World</TITLE> </HEAD> <BODY> <H1>Greetings, Terrans!</H1> </BODY> </HTML>
END_of_Multiline_Text
This has worked absolutely fine in the past, but now when I invoke it, either nothing appears in the browser (Mozilla Firefox) or I get "Internal Server Error" - any ideas please?
Thanks, Andy
On Mon, Sep 22, 2008 at 9:18 PM, Andrew Allen andy.allen@virgin.net wrote:
This has worked absolutely fine in the past, but now when I invoke it, either nothing appears in the browser (Mozilla Firefox) or I get "Internal Server Error" - any ideas please?
Check your web server logs to find out what went wrong.
- Raja
On Mon, 2008-09-22 at 21:41 +0530, Raja Subramanian wrote:
On Mon, Sep 22, 2008 at 9:18 PM, Andrew Allen andy.allen@virgin.net wrote:
This has worked absolutely fine in the past, but now when I invoke it, either nothing appears in the browser (Mozilla Firefox) or I get "Internal Server Error" - any ideas please?
Check your web server logs to find out what went wrong.
Thanks everybody, but I still can't find the server log(s)! I've looked at /etc/httpd/conf/httpd.conf and it says the following about location of the error log: # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog logs/error_log
But when I look for files with the name error_log I don't see anything which looks like a (plain text) server error log file - and there is no such file in the /etc/httpd/logs directory. Where am I going wrong please?
Andy
Check your web server logs to find out what went wrong.
Thanks everybody, but I still can't find the server log(s)! I've looked at /etc/httpd/conf/httpd.conf and it says the following about location of the error log: # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog logs/error_log
But when I look for files with the name error_log I don't see anything which looks like a (plain text) server error log file - and there is no such file in the /etc/httpd/logs directory. Where am I going wrong please?
Andy
maybe ... ls /var/log/httpd/*log
HTH, -Bob
On Mon, 22 Sep 2008, Andrew Allen wrote:
I'm trying to get perl CGI programs to work from the cgi-bin (actually a sub-directory cgi-bin/various) and have set appropriate permissions using chmod 755. I'm currently testing using the simplest cgi program, you know the one: [....]
This has worked absolutely fine in the past, but now when I invoke it, either nothing appears in the browser (Mozilla Firefox) or I get "Internal Server Error" - any ideas please?
Is SELinux enabled? If so, the problem will show up in the audit logs:
ausearch -c httpd -m avc
In general, you'll want to
1. make sure the security context on the CGI script and the directory tree that contains it is httpd_sys_script_exec_t, and
2. make sure that no SELinux booleans are in the way, httpd_enable_cgi in particular:
getsebool httpd_enable_cgi
If it's set to "off," then you'll want to enable it:
setsebool httpd_enable_cgi=1