Centos 4.2 CGI error

Discussion in 'Server Operation' started by redhatlover, Dec 29, 2005.

  1. redhatlover

    redhatlover New Member

    Hi,
    I installed centos-4.2 in my system.
    The problem is cgi script gives error message. The same cgi script is running with Centos-3.4 no problem at all.
    Why? please help me
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    What is the exact error message you get?
     
  3. redhatlover

    redhatlover New Member

    Centos4.2 CGI error

    Hi till,
    this is my error message

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, root@localhost 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.


    --------------------------------------------------------------------------------

    Apache/2.0.52 (CentOS) Server at * * * * * * Port 80


    BUT WHEN I RUN HELLO WORLD, It works fine no error message

    #!/usr/bin/perl -wT
    print "Content-type: text/html\n\n";
    print "Hello, world!\n";
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Did you make the script executable? Is there anything in the Apache error log?
     
  5. redhatlover

    redhatlover New Member

    Centos4.2 CGI error

    Hi falko,
    yes chmod 755 mail.cgi I did

    Apache error log

    no such file or directory exec of '/var/www/cgi-bin/'
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Does /var/www/cgi-bin exist, and did you put your file in there?
     
  7. redhatlover

    redhatlover New Member

    Centos4.2 CGI error

    yes. my cgi scripts are there.

    BUT WHEN I RUN HELLO WORLD, It works fine no error message

    #!/usr/bin/perl -wT
    print "Content-type: text/html\n\n";
    print "Hello, world!\n";
    ----------------------------------------------
    example list-modules.pl is not running. this script also give a error message.
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Can you post the output of
    Code:
    ls -la /var/www
    ?
     
  9. redhatlover

    redhatlover New Member

    Centos4.2 CGI error

    Hi Fllko

    total 72
    drwxr-xr-x 9 root root 4096 Dec 30 08:14 .
    drwxr-xr-x 24 root root 4096 Dec 30 08:13 ..
    drwxr-xr-x 2 root root 4096 Dec 30 08:44 cgi-bin
    drwxr-xr-x 3 root root 4096 Dec 30 07:56 error
    drwxr-xr-x 2 root root 4096 Dec 30 08:43 html
    drwxr-xr-x 3 root root 4096 Dec 30 08:13 icons
    drwxr-xr-x 13 root root 4096 Dec 30 07:56 manual
    drwxr-xr-x 2 root root 4096 Dec 30 08:14 mrtg
    drwxr-xr-x 2 webalizer root 4096 Dec 30 07:56 usage
     
  10. falko

    falko Super Moderator Howtoforge Staff

    Maybe it's a problem with suExec? Can you run
    Code:
    chown -R <Apache_user>:<Apache_group> /var/www/cgi-bin
    ?
     
  11. redhatlover

    redhatlover New Member

    Centos4.2 CGI error

    Hi Flako,
    thanks for your helps.
    I solved my problem.
    I convert my cgi script to unix format. now is working.:)

    The same cgi script working with centos 3.4 no problem.
    but centos 4.2 not working.
    you have any idea about this format problem?
     
    Last edited: Dec 31, 2005
  12. falko

    falko Super Moderator Howtoforge Staff

    You mean you converted Windows linebreaks to Unix linebreaks? But then you should have gotten errors when running that script on the command line with Windows linebreaks...
     
  13. redhatlover

    redhatlover New Member

    Centos4.2 CGI error

    Hi Falko,
    yes. I did dos2unix my.cgi
     

Share This Page