Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 15 of 15
  1. #1
    Member
    Join Date
    Feb 2003
    Posts
    311

    Default CGI Scripts outside cgi-bin

    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?

  2. #2
    Member mickalo's Avatar
    Join Date
    Apr 2002
    Location
    N.W. Iowa
    Posts
    753

    Default Re: CGI Scripts outside cgi-bin

    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?
    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.

    Mickalo

    Thunder Rain Internet Publishing

    Providing Internet Solutions that work!
    Custom Perl and Database Programming

  3. #3
    Member
    Join Date
    Feb 2003
    Posts
    311

    Default

    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.

  4. #4
    Member mickalo's Avatar
    Join Date
    Apr 2002
    Location
    N.W. Iowa
    Posts
    753

    Default

    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.
    what is the /public_html folder set too ?? it should be set too 0750 and owned by the "username" and group by "nobody"

    Mickalo

    Thunder Rain Internet Publishing

    Providing Internet Solutions that work!
    Custom Perl and Database Programming

  5. #5
    Member
    Join Date
    Feb 2003
    Posts
    311

    Default

    It is, but if I chmod public_html to 755, I still get the error.

  6. #6
    Member mickalo's Avatar
    Join Date
    Apr 2002
    Location
    N.W. Iowa
    Posts
    753

    Default

    Originally posted by compunet2
    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 ??

    Mickalo

    Thunder Rain Internet Publishing

    Providing Internet Solutions that work!
    Custom Perl and Database Programming

  7. #7
    Member
    Join Date
    Feb 2003
    Posts
    311

    Default

    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.

  8. #8
    Member mickalo's Avatar
    Join Date
    Apr 2002
    Location
    N.W. Iowa
    Posts
    753

    Default

    Originally 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
    possibly something in the /public_html/.htaccess file that maybe causing a conflict ?? Or you may have something mis-configured in your httpd.conf file

    Mickalo

    Thunder Rain Internet Publishing

    Providing Internet Solutions that work!
    Custom Perl and Database Programming

  9. #9
    Member
    Join Date
    Feb 2003
    Posts
    311

    Default

    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?

  10. #10
    Member mickalo's Avatar
    Join Date
    Apr 2002
    Location
    N.W. Iowa
    Posts
    753

    Default

    Originally 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?
    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 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

  11. #11
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    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

  12. #12
    Member
    Join Date
    Feb 2003
    Posts
    311

    Default

    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.

  13. #13
    Member
    Join Date
    Feb 2003
    Posts
    311

    Default

    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.

  14. #14
    Member
    Join Date
    Jun 2003
    Posts
    16

    Default

    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

  15. #15
    Member
    Join Date
    Feb 2003
    Posts
    311

    Default

    Found the solution... rebuild apache with webroot protection enabled.

Similar Threads & Tags
Similar threads

  1. CGI Scripts outside of cgi-bin?
    By Jeff75 in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-12-2003, 12:24 PM
  2. cgi scripts outside of cgi-bin
    By imagic in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-30-2003, 02:35 PM
  3. CGI Scripts outside of CGI-BIN
    By dgs in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 12-23-2002, 06:28 PM
  4. Interchange - Undefined catalog: /~xxxxx/cgi-bin/cart.cgi
    By wscreate in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 10-08-2001, 09:36 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube