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.

cgi execution problem ( not found for exery file inside cgi-bin directories )

Discussion in 'General Discussion' started by LAZer, May 18, 2011.

  1. LAZer

    LAZer Well-Known Member

    Joined:
    Jan 18, 2010
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    at net :D
    hi , i faced a problem regarding cgi execution in my server . one of my customers wanted to use cgi in his host , but server returns
    Code:
    Not Found
    
    The requested URL /cgi-bin/mt/mt.cgi was not found on this server.
    
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    , i have checked everything i knew , even reinstalled apache with cgi again with fresh httpd configuration , but still the same problem exists.

    even i have changed php/suexec configuration , and set php to run in DSO , fcgi , cgi modes but it gives the same error. my apache 2.2 is running in SUphp mode and suexec is active too. i have pre user configuration file in following location
    /usr/local/apache/conf/userdata/std/2/{userhostname}/Username.conf


    i have seen in httpd.conf the following line :
    Code:
    <Directory "/home">
        Options -ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes -MultiViews SymLinksIfOwnerMatch
        AllowOverride AuthConfig Indexes Limit Fileinfo
        RemoveHandler cgi-script .pl .py .cgi
    </Directory>
    which i removed it and now i have :
    Code:
    <Directory "/">
        Options ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes -MultiViews SymLinksIfOwnerMatch
        AllowOverride AuthConfig Indexes Limit Fileinfo
    </Directory>
    but no changes in the result . still every file i place in cgi-bin folder of the users do no run.
    what else should can i do ?

    i should mention that , for that user , cgi execution is activated from whm > edit packages .
    also cgi execution is active from whm Main >> Service Configuration >> Apache Configuration >> Global Configuration ExecCGI

    also i think that cpanel cgi files are running with out any problems and every thing is working fine in cpanel.

    any helps would be appreciated.
     
  2. LAZer

    LAZer Well-Known Member

    Joined:
    Jan 18, 2010
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    at net :D
    also i have tested cpanel sample cgi scripts , they worked in cpanel page but those which linked directly didnt work too. i just dont know how should those cgi files be linked directly.

    for example this worked :
    /frontend/x3/cgi/Countdown/index.html

    but these didnt work

    http://domain.com/cgi-bin/entropybanner.cgi

    http://domain/cgi-bin/cgiemail

    Code:
    Not Found
    
    The requested URL /cgi-bin/entropybanner.cgi was not found on this server.
    
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
     
    #2 LAZer, May 18, 2011
    Last edited: May 18, 2011
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,707
    Likes Received:
    658
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    The error message reported indicates the file is not found. Have you ensured that your domain name is pointed this cPanel server? If so, please also check to see if the CGI files have been uploaded to:

    /home/username/public_html/cgi-bin

    Please feel free to open a ticket for this issue if you would like us to investigate further:

    Submit A Ticket

    Remember to post the ticket number here if you choose to open a ticket.

    Thank you.
     
  4. LAZer

    LAZer Well-Known Member

    Joined:
    Jan 18, 2010
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    at net :D
    hi , thank for your attention , i have submited a ticket : 1508018 i`ll be thankful if you check this.

    i even reinstalled apache-cgi with default easyapache profiles , but no result.
    and yes , i have checked that the files are uploaded to the Userdir and with the address you provided , even default cpanel cgi files are uploaded to that folder but they cannot be accessed directly .
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,707
    Likes Received:
    658
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    For others who may experience a similar error message, this was primarily the result of the following option being set to "NO" in "WHM >> Server Configuration >> Basic cPanel & WHM Setup":

    "Automatically create a cgi-bin script alias. This setting can be individually overridden during account creation."

    ScriptAlias is not necessary for CGI capabilities; however it does instruct Apache to treat files in the specified directory as CGI programs.

    Thank you.
     
    #5 cPanelMichael, May 19, 2011
    Last edited: May 19, 2011
  6. LAZer

    LAZer Well-Known Member

    Joined:
    Jan 18, 2010
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    at net :D
    about the first part , i had edited another user and allowed cgi access for him but it didnt work , as you say there must be the script alias.
    on that other host in my server ( on my own host ) i had edited it and gave cgi access directly to this host but it couldnt run cgi scripts too. now with the steps you mentioned and cgi file you tested , i did the same thing on my host and it couldnt work ! finnaly i found that in root of its home dir ( public_html ) there was a .htaccess file , in that there was a line
    Code:
    RewriteEngine On
    and it caused conflict for apache ! , when i remove this simple line and did the steps you told , cgi exection is fixed in this host too.
    thanks for your help :X
     
Loading...

Share This Page