The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't run cgi scripts

Discussion in 'General Discussion' started by hmmblah, Dec 4, 2005.

  1. hmmblah

    hmmblah Member

    Joined:
    Dec 14, 2004
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    No cgi scripts will run from a web browser.

    They run perfect from a shell.

    I checked the suexec_log and it says this right after where it tries to run the script

    emerg: cannot get docroot information (/)

    The scripts are in the cgi-bin of the account I am running them on. They are owned by the account that they are in, same with group. Right now the permissions are set to 755 on the script. I've also tried running them out of the cgi-bin and the same thing happens.

    Internal server error......

    This is the test script I am running...I found it on these forums

    Any ideas?
     
    #1 hmmblah, Dec 4, 2005
    Last edited: Dec 4, 2005
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Couple of things:

    1. Is the directory the script is within also chmod 755?

    2. Is suexec definitely enabled in WHM > Enable/Disable SuExec

    3. You can also try running:

    /scripts/initsuexec
     
  3. hmmblah

    hmmblah Member

    Joined:
    Dec 14, 2004
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    1. Yes

    2. Yes it was

    3 Didn't try that...but

    I just disabled suexec and now everything works fine! CGI is working perl is working, and all my previous pages are all still working. Is there a reason to run SuExec?
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yes - security. With it enabled perl scripts are run under the username and group of the cPanel account. Without it they run under nobody and have access to other resources owned by nobody, such as other accounts web files. It also makes it difficult to track down hacked scripts, etc without suexec enabled.
     
  5. hmmblah

    hmmblah Member

    Joined:
    Dec 14, 2004
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Yeah I was afraid of that. I will try re-enabling SuExec and running that script. I will report back with what happens.

    Thanks for your help.
     
  6. hmmblah

    hmmblah Member

    Joined:
    Dec 14, 2004
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    All is well now! SuExec is enabled and cgi is still working. :)
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Great stuff. Did it start working after just re-enabling? If so, then enabling it probably does an explicit run of that script above. If it was something else, let us know :)
     
  8. hmmblah

    hmmblah Member

    Joined:
    Dec 14, 2004
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    I did a re-enable and ran that script. I also found that one user directory had their public_html directory owned by username:nobody. Chown username:username fixed that particular case.
     
  9. blweb

    blweb Active Member

    Joined:
    Oct 1, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    I am having the same problem. Is there a place other than Apache update to enable and disable suexec?
     
  10. Izzee

    Izzee Well-Known Member

    Joined:
    Feb 6, 2004
    Messages:
    469
    Likes Received:
    0
    Trophy Points:
    16
    As long as you have it compiled with Apache Update you can turn it on and off in WHM/Service Configuration/Enable/Disable SuExec
    :)
     
Loading...

Share This Page