Since I upgraded cpanel & apache, I haven't been able to run cgi scripts outside of the cgi-bin directory. Is there some way to fix this?
Since I upgraded cpanel & apache, I haven't been able to run cgi scripts outside of the cgi-bin directory. Is there some way to fix this?
If you using Suexec enabled, any Perl scripts must be in a folder that is chmoded 0755. The cgi-bin, by default is set to 0755, the same applies to any other folder where you maybe using your scripts,... otherwise you'll get errors. Plus the script(s) must be chmoded the same.Originally posted by compunet2
Since I upgraded cpanel & apache, I haven't been able to run cgi scripts outside of the cgi-bin directory. Is there some way to fix this?
Mickalo
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
Custom Perl and Database Programming
Nope.. I tried that and no luck. I have the script in public_html, and I tried to chmod it to 755, as well as the script, but it still doesn't run. Suexec is enabled. I can run the script in cgi-bin, and I can also create another folder, chmod the folder to 755, and it runs there too, just not in public_html... I get 500 Internal Server Error. Thanks.
what is the /public_html folder set too ?? it should be set too 0750 and owned by the "username" and group by "nobody"Originally posted by compunet2
Nope.. I tried that and no luck. I have the script in public_html, and I tried to chmod it to 755, as well as the script, but it still doesn't run. Suexec is enabled. I can run the script in cgi-bin, and I can also create another folder, chmod the folder to 755, and it runs there too, just not in public_html... I get 500 Internal Server Error. Thanks.
Mickalo
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
Custom Perl and Database Programming
It is, but if I chmod public_html to 755, I still get the error.
what is in the apache error_log and suexec_log... what sort of error for that script ??Originally posted by compunet2
It is, but if I chmod public_html to 755, I still get the error.
Mickalo
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
Custom Perl and Database Programming
SUEXEC:
[2004-06-11 15:56:51]: info: (target/actual) uid: (test4/test4) gid: (test4/test4) cmd: serverinfo.cgi
[2004-06-11 15:56:51]: error: target uid/gid (32003/504) mismatch with directory (32003/99) or program (32003/504) or trusted user (0/10)
-----
APACHE_LOG:
[Fri Jun 11 14:35:59 2004] [error] [client 24.228.58.228] Premature end of script headers: /home2/test4/public_html/serverinfo.cgi
I can copy this script to any folder, and it works fine (no modification needed... its just a server info script). No other scripts will work in the public_html folder either.
I'm running cPanel 9.4.0-R21
Last edited by compunet2; 06-11-2004 at 03:04 PM.
possibly something in the /public_html/.htaccess file that maybe causing a conflict ?? Or you may have something mis-configured in your httpd.conf fileOriginally posted by compunet2
SUEXEC:
[2004-06-11 15:56:51]: info: (target/actual) uid: (test4/test4) gid: (test4/test4) cmd: serverinfo.cgi
[2004-06-11 15:56:51]: error: target uid/gid (32003/504) mismatch with directory (32003/99) or program (32003/504) or trusted user (0/10)
-----
APACHE_LOG:
[Fri Jun 11 14:35:59 2004] [error] [client 24.228.58.228] Premature end of script headers: /home2/test4/public_html/serverinfo.cgi
I can copy this script to any folder, and it works fine (no modification needed... its just a server info script). No other scripts will work in the public_html folder either.
I'm running cPanel 9.4.0-R21![]()
Mickalo
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
Custom Perl and Database Programming
This problem is server wide, effecting 2 servers I upgraded. Is anyone else running cPanel 9.4.0-R21, and running cgi scripts in the public_html folder?
One of the servers I manage, is a RH 9.0 w/cPanel 9.4.0-R21 and we have no problems executing Perl scripts within the /public_html folderOriginally posted by compunet2
This problem is server wide, effecting 2 servers I upgraded. Is anyone else running cPanel 9.4.0-R21, and running cgi scripts in the public_html folder?
so you may want to check your httpd.conf file to make sure there isn't some problem there.
Mickalo
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
Custom Perl and Database Programming
The problem is odd. I just tried on our test server and was able to upload and browse to a CGI script in the /public_html directory of a site - this is with suexec enabled.
This server is currently running 9.4.0-E19
I just did a further test and switched off suexec and the script now errors. Is it possible that you forgot or accidentally didn't compile suexec into the new Apache version when yo recompiled it? Maybe recompiling Apache would be a good idea.
Jonathan Michaelson
Need your cPanel servers secured and tuned?
cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
http://www.configserver.com
Suexec is showing enabled (its also generating an error in the log from this script (shown above)). I tried to rebuild easyapache (and double checked, suexec is installed), then reboot, but no luck. I looked at the httpd.conf file, but I dont see anything that looks different from before, or unusual.
I think it might have something to do with the group being 99 (nobody), and suexec not allowing the script to run in a folder that is owned by 99. However this is a normal group for public_html in cPanel, and has always worked fine before.
Same problem here![]()
This server is currently running 9.4.0-E19
Problem appeared after the security update.
Used same apacheupdate options as before. Can't find any difference in httpd.conf
Found the solution... rebuild apache with webroot protection enabled.