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.

perl internal server error

Discussion in 'General Discussion' started by brunobrown1409, Nov 7, 2006.

  1. brunobrown1409

    Joined:
    Oct 11, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    I have enterred correctly in the httpd.conf the cgi-bin script aliss
    also set permissions of perl corrctly 755

    i have also debugged correctly and the prog is not showing synatx error

    yet when i take it on the browser it shows internal server error.
    help?:mad:
     
  2. erik@delphi

    erik@delphi Well-Known Member

    Joined:
    Jul 9, 2005
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Belgium

    1)is the path to perl correct ? (verry first line of the cgi script it should be something like #!/usr/bin/perl
    2) to be sure about the perl path run which perl (it returns the correct path)

    3) are you using SuExec ? then the cgi must be owned and in the group of the "apache" user (chmod 755 is correct but check the chgrp rights

    Code:
    cd /path/to/your_script
    ls -la
    
    this will show you a list of files in the defined directory and also show who owns the files ...

    also don't forget your logs...

    Code:
    /etc/httpd/logs
    tail error_log
    
    this should at least give you a clue what is causing the problem
     
  3. brunobrown1409

    Joined:
    Oct 11, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    thanks for the reply
    error log shows
    Premature end of script headers:
     
  4. brunobrown1409

    Joined:
    Oct 11, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    ls -la shows file owned by root..
     
  5. erik@delphi

    erik@delphi Well-Known Member

    Joined:
    Jul 9, 2005
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Belgium
    there's your problem you should not run CGI's as root in your httpd.conf where your vhost is defined you will see something like

    Code:
    user username
    group groupname
    
    you can also use this command to find out this information

    Code:
    grep "^User" /etc/httpd/conf/httpd.conf
    
    (paths may be different on your server through enter the correct path to httpd.conf)

    change the ownership of the cgi you want to run to that information

    Code:
    chown username:groupname file.cgi
    
     
    #5 erik@delphi, Nov 8, 2006
    Last edited: Nov 8, 2006
  6. brunobrown1409

    Joined:
    Oct 11, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Thanks its working now
    i also changed the permission of cgi-bin to 755
    i aslo changes the first line to #!/usr/bin/perl
    now it works
    but in my apache
    which perl shows
    /usr/local/bin/perl
     
    #6 brunobrown1409, Nov 8, 2006
    Last edited: Nov 8, 2006
Loading...

Share This Page