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 access CGI files

Discussion in 'General Discussion' started by Nameslot, Nov 8, 2007.

  1. Nameslot

    Nameslot Member

    Joined:
    Oct 3, 2007
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Hello :eek:

    I have put on one CGI script but it always gives me 404 page not found error.

    So I tried a hello world script

    Code:
    #!/usr/bin/perl
    
    print "Content-type: text/html\n\n";
    print "Hello World! <br><br>";
    print "<br><br>\n";
    It is located here http://www.12buzz.com/cgi-bin/hello.cgi

    I can see it from FTP. But in browser it says File not found.

    I have used FTP to upload it in ASCII mode and even have CHMOD it to 755

    Please let me know what should be next step :(
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Are you sure it is hello.cgi and not Hello.cgi? URLs on a Unix-based system are case-sensitive.
     
  3. consultorpc

    consultorpc Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Check the ScriptAlias line for cgi in the httpd.conf, we had this problem also after update to apache 2.2 from 1.3 version.
     
  4. navjeet2k9

    navjeet2k9 Registered

    Joined:
    Oct 12, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Jeet N.

    Hi!

    Please make sure that the ownership of file should be "user.user" and permission should be 755. Also check for below entry in httpd.conf file, for respective domain.

    ===============

    ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/

    ===============
     
  5. Nameslot

    Nameslot Member

    Joined:
    Oct 3, 2007
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Humm... Thanks to all of you. I had missed this thread but subscribed to it now.

    Will do the suggested changes.

    Thanks.
     
  6. Nameslot

    Nameslot Member

    Joined:
    Oct 3, 2007
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    This is what I see in httpd.conf:(
     
  7. Rickvz

    Rickvz Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    There should also be a line that looks like the one below under the entry for each domain further down in the httpd.conf file.

    ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/

    If the line is missing then you will have the problem you describe. When I moved some accounts to a new server I saw this problem and manually added the ScriptAlias line for each domain and everything worked fine.
     
  8. Nameslot

    Nameslot Member

    Joined:
    Oct 3, 2007
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Humm.... Yes there is a line for scriptalias also

    1) I checked that the File name is not case sensitive.
    2) CHMOD is set to 755
    3) Script Alias is also there in httpd.conf
    4) The same script is running on another shared server but not in this server. :confused:

    It is giving 500 Internal Server Error. :eek:

    Can someone throw some light on this issue. If they have been through this or have some idea to get it working.

    Thanks.
     
  9. Rickvz

    Rickvz Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    What error messages are listed in your error log? I would try deleting the file and upload it again and be sure that it is uploaded in ASCII mode and make sure there are no blank lines at the end of the file.
     
  10. siya

    siya Member

    Joined:
    Sep 28, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    IHmm... I just noticed today that all virtualhost entries in httpd.conf have a RemoveHandler statement for cgi-scripts. If it is present in your apache virtualhost entries, comment or remove it and restart apache.
     
Loading...

Share This Page