Andrew Allen
2008-Sep-22 15:48 UTC
[CentOS] Getting perl CGI programs to work on CentOS 5 server
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
Raja Subramanian
2008-Sep-22 16:11 UTC
[CentOS] Getting perl CGI programs to work on CentOS 5 server
On Mon, Sep 22, 2008 at 9:18 PM, Andrew Allen <andy.allen at 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
Paul Heinlein
2008-Sep-22 16:42 UTC
[CentOS] Getting perl CGI programs to work on CentOS 5 server
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 -- Paul Heinlein <> heinlein at madboa.com <> http://www.madboa.com/