My Server is
CentOS7
Apache 2.4
SELinux enabled.
Perl/CGI is working for /var/www/cgi-bin directory but not working for /home/user/cgi directory.
error-log shows the following errors for test.pl:
[Fri Jan 08 19:53:05.725795 2016] [cgi:error] [pid 7311] [client *:33769] End of script output before headers: test.pl [Fri Jan 08 19:54:10.981964 2016] [cgi:error] [pid 7314] [client *:33770] End of script output before headers: test.pl
perl -w test.pl shows no error on command line.
SELinux settings for /home/user/cgi directory is
drwxr-xr-x. 4 unconfined_u:object_r:httpd_sys_script_exec_t:s0 user user 83 Jan 8 20:05 . drwxr-xr-x. 11 unconfined_u:object_r:user_home_dir_t:s0 user user 4096 Jan 7 12:08 .. -rwxr-xr-x. 1 unconfined_u:object_r:httpd_sys_script_exec_t:s0 user user 90 Jan 8 20:05 test.pl
Content of test.pl
#!/usr/bin/perl print "Content-type: text/html; charset=utf-8\n\n"; print "Hello\n\n";
httpd.conf
Options Indexes FollowSymLinks Includes ExecCGI AddHandler cgi-script .cgi .pl Require all granted DirectoryIndex index.pl index.cgi
Link to httpd related sebool options: sebool Greatly appreciate help...
/var/log/apache2/error.log
). – Grant McLean$|=1;
did not solve the issue – bislinks<Directory>
block. Which directory? (You need to show the configuration for both /var/www/cgi-bin and /home/user/cgi for us to be able to help.) – ThisSuitIsBlackNot