bislinks bislinks - 1 year ago 59
Perl Question

Perl/CGI not working for /home/user/cgi but working for /var/www/cgi-bin

My Server is


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

[Fri Jan 08 19:53:05.725795 2016] [cgi:error] [pid 7311] [client *:33769] End of script output before headers:
[Fri Jan 08 19:54:10.981964 2016] [cgi:error] [pid 7314] [client *:33770] End of script output before headers:

perl -w 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

Content of


print "Content-type: text/html; charset=utf-8\n\n";
print "Hello\n\n";


Options Indexes FollowSymLinks Includes ExecCGI
AddHandler cgi-script .cgi .pl
Require all granted
DirectoryIndex index.cgi

Link to httpd related sebool options:
Greatly appreciate help...

Answer Source

I got it.

The problem was caused by this line:

SuexecUserGroup "#1000" "#1000"

Problem resolved once I removed that directive.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download