Perl files wont open, give 404

rudtek

Active Member
Jul 19, 2017
26
2
53
Oregon
cPanel Access Level
Root Administrator
I have a vps running whm and cpanel.
  • CENTOS 6.9 kvm
  • whm v66.0.23
  • easy apache 4

No .pl files will run, but instead return an error 404. whether or not they are in the cgi-bin directory. Text files that are in the cgi-bin also give a error 404.

I have checked permissions. The cgi-bin directory is 0755, and the files inside are 0644.

In WHM in global appache setup changed "directory "/" options" to inlcude exeCGI, followSymLinks, Inlcudes, IncludesNOEXEC, Indexes, SymLinksIfOwnerMatch

then restarted apache.

In my httpd.conf
I found this line was already there:

# These extensions are used to redirect incoming requests to WHM
AddHandler cgi-script .cgi .pl .plx .ppl .perl

I tried adding this to my .htaccess as well:

AddHandler cgi-script .cgi .pl
Options +ExecCGI +IncludesNOEXEC
XBitHack on

I found a link that said I needed to change my virtualhost to include this line:

ScriptAlias /cgi-bin/ "/var/www/vhosts/mysite.com/httpdocs/cgi-bin/"

but my httpd.conf has this line already:

<IfModule alias_module>
ScriptAlias /cgi-bin/ /home/qsginc/public_html/cgi-bin/
</IfModule>

which is the right directory.

I found this link in the forums here:
Perl files return 404
but it's not really for easy appache 4

Can someone please let me know what I missed here?
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
I have checked permissions. The cgi-bin directory is 0755, and the files inside are 0644.
Hello,

Try updating the .pl files to 0755 permissions. Also, browse to "WHM >> Modify an Account" and ensure "CGI Privilege" is enabled for the account in-question.

Thank you.
 

rudtek

Active Member
Jul 19, 2017
26
2
53
Oregon
cPanel Access Level
Root Administrator
Thanks for your help! I changed the permissions to 0755 and confirmed CGI privilege. No change in behavior. I still get the error.

Also, it's a 500 error, not 404. I tried changing my question, but it said I couldn't because it had spam. I don't know why it would say that.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Also, it's a 500 error, not 404. I tried changing my question, but it said I couldn't because it had spam. I don't know why it would say that.
What output do you see in /usr/local/apache/logs/error_log when you notice the 500 error code?

Thank you.
 

rudtek

Active Member
Jul 19, 2017
26
2
53
Oregon
cPanel Access Level
Root Administrator
[Tue Nov 21 09:18:06.473958 2017] [cgid:error] [pid 14058:tid 140005927765984] (2)No such file or directory: AH01241: exec of '/home/user/public_html/cgi-bin/head.pl' failed
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Hello,

What permission and ownership values are configured for the /home/$username/public_html/cgi-bin/ directories and above (up to /home/$username)?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Hello,

Feel free to open a support ticket using the link in my signature so we can take a closer look.

Thank you.