Results 1 to 14 of 14

Thread: Error with cgi-bin 500 internal server error

  1. #1
    Member
    Join Date
    Mar 2007
    Posts
    59

    Default Error with cgi-bin 500 internal server error

    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. #2
    Member arunsv84's Avatar
    Join Date
    Oct 2008
    Location
    127.0.0.1
    Posts
    371
    cPanel/WHM Access Level

    Root Administrator

    Default

    Seems there is permission error on test.pl

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

    [root@linux ~]$ w
    1:00:01 up 28 years 300 days, 22:00, 1 user, Today's status : Fine

  3. #3
    Member
    Join Date
    Mar 2007
    Posts
    59

    Default

    Quote Originally Posted by arunsv84 View Post
    Seems there is permission error on test.pl

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

    the permission of the script is already 755

  4. #4
    Member arunsv84's Avatar
    Join Date
    Oct 2008
    Location
    127.0.0.1
    Posts
    371
    cPanel/WHM Access Level

    Root Administrator
    [root@linux ~]$ w
    1:00:01 up 28 years 300 days, 22:00, 1 user, Today's status : Fine

  5. #5
    Member
    Join Date
    Mar 2007
    Posts
    59

    Default

    the file is uploaded using ASCII mode aswell already

  6. #6
    Member
    Join Date
    Sep 2004
    Location
    inside a catfish
    Posts
    1,096
    cPanel/WHM Access Level

    Root Administrator

    Default

    What does your exact first line [the path to PERL] look like?

    You say you already make
    Mike

  7. #7
    Member
    Join Date
    Sep 2004
    Location
    inside a catfish
    Posts
    1,096
    cPanel/WHM Access Level

    Root Administrator

    Default

    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. #8
    Member
    Join Date
    Mar 2007
    Posts
    59

    Default

    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. #9
    Member
    Join Date
    Sep 2004
    Location
    inside a catfish
    Posts
    1,096
    cPanel/WHM Access Level

    Root Administrator

    Default

    Quote Originally Posted by approx View Post
    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*
    <deleted - you already posted the code that I asked for> No answer for you based upon information provided thus far.

    Mike

  10. #10
    Member
    Join Date
    Sep 2004
    Location
    inside a catfish
    Posts
    1,096
    cPanel/WHM Access Level

    Root Administrator

    Default

    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. #11
    Member
    Join Date
    Mar 2007
    Posts
    59

    Default

    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!

  12. #12
    Member
    Join Date
    Mar 2007
    Posts
    59

    Default

    need fix please

  13. #13
    Member
    Join Date
    Mar 2007
    Posts
    59

    Default

    bump.. need help

  14. #14
    Member
    Join Date
    Sep 2004
    Location
    inside a catfish
    Posts
    1,096
    cPanel/WHM Access Level

    Root Administrator

    Default

    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

Similar Threads

  1. 403 Forbidden Error / 500 Internal Server Error
    By saurabhnsonar in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 11-29-2010, 08:45 AM
  2. a 500 Internal Server Error error.
    By surapong in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 08-19-2009, 10:18 AM
  3. 500 Internal Server Error
    By zahiruddin in forum New User Questions
    Replies: 3
    Last Post: 03-05-2009, 06:18 AM
  4. accessing php code in cgi-bin=>500 http error
    By dmgens in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 02-19-2009, 01:59 PM
  5. error 500 internal server error on movable type
    By spoiledbrattine in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 07-04-2005, 01:15 PM