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.

Error with cgi-bin 500 internal server error

Discussion in 'General Discussion' started by approx, Mar 5, 2009.

  1. approx

    approx Well-Known Member

    Joined:
    Mar 6, 2007
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    hi there,

    i'm trying to put a cgi script inside the cgi-bin

    when i saw on error_log
    Code:
    [Thu Mar 05 22:52:51 2009] [error] [client 1.2.3.4] failed to open log file
    [Thu Mar 05 22:52:51 2009] [error] [client 1.2.3.4] fopen: Permission denied
    [Thu Mar 05 22:52:51 2009] [error] [client 1.2.3.4] Premature end of script headers: test.pl
    [Thu Mar 05 22:52:51 2009] [error] [client 1.2.3.4] File does not exist: /home/user/public_html/500.shtml
    When I open the script trough browser, it shows me
    Code:
    Internal Server Error
    
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    
    Please contact the server administrator, webmaster@www.mysite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    
    More information about this error may be available in the server error log.
    
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    I already put
    Code:
    <Directory /home/*/public_html/cgi-bin>
    Options +ExecCGI
    </Directory>
    on my httpd.conf

    Is there somethink I'm missing?
     
  2. arunsv84

    arunsv84 Well-Known Member

    Joined:
    Oct 20, 2008
    Messages:
    373
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    127.0.0.1
    cPanel Access Level:
    Root Administrator
    Seems there is permission error on test.pl

    The permissions of the script files should be set to 755.

    :)
     
  3. approx

    approx Well-Known Member

    Joined:
    Mar 6, 2007
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    the permission of the script is already 755
     
  4. arunsv84

    arunsv84 Well-Known Member

    Joined:
    Oct 20, 2008
    Messages:
    373
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    127.0.0.1
    cPanel Access Level:
    Root Administrator
  5. approx

    approx Well-Known Member

    Joined:
    Mar 6, 2007
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    the file is uploaded using ASCII mode aswell already
     
  6. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    What does your exact first line [the path to PERL] look like?

    You say you already make
    Mike
     
  7. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    What does your exact first line [the path to PERL] look like?

    You say you already made sure that it was chmod 755. What is the ownership of the file?

    Mike
     
  8. approx

    approx Well-Known Member

    Joined:
    Mar 6, 2007
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    test.cgi
    Code:
    #!/usr/bin/perl
    
    
    print "Content-type: text/html\n\n";
    
    print "Hello World";
    -rwxr-xr-x 1 username username 83 Mar 2 02:41 test.cgi*
     
  9. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    <deleted - you already posted the code that I asked for> No answer for you based upon information provided thus far.

    Mike
     
  10. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    In your VirtualHost container for that site, put a line like this:

    ScriptAlias /cgi-bin/ /actual/path/to/cgi-bin/

    Also, make sure there is an appropriate AddHandler line in your main apache configuration section such as:

    AddHandler cgi-script .cgi .pl .plx .ppl .perl

    Restart apache. See if that helps. I'm not an Apache guru.

    Mike
     
  11. approx

    approx Well-Known Member

    Joined:
    Mar 6, 2007
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    inside the virtual hosts
    Code:
        <IfModule !mod_disable_suexec.c>
            SuexecUserGroup myusername myusername
        </IfModule>
        ScriptAlias /cgi-bin/ /home/myusername/public_html/cgi-bin/
    In httpd.conf it's already contained
    Code:
    AddHandler cgi-script .cgi .pl .plx .ppl .perl
    Also I already restarted the apache by typing
    Code:
    /scripts/restartsrv_httpd
    still has no luck! :confused:
     
  12. approx

    approx Well-Known Member

    Joined:
    Mar 6, 2007
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    need fix please
     
  13. approx

    approx Well-Known Member

    Joined:
    Mar 6, 2007
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    bump.. need help
     
  14. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    You seem to be fairly persistent, which leads me to believe you really need this answer. I would suggest that you open a ticket with whomever provided your Cpanel license to you. You can plug the main IP address of your server in at http://verify.cpanel.net to determine who you need to contact. I'm sure that would be the best way to get support, as you can then give them appropriate access to take a look at everything.

    Mike
     
Loading...

Share This Page