Results 1 to 6 of 6

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

  1. #1
    Member
    Join Date
    Jan 2010
    Location
    at net :D
    Posts
    50

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

    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. #2
    Member
    Join Date
    Jan 2010
    Location
    at net :D
    Posts
    50

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

    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.
    Last edited by LAZer; 05-18-2011 at 08:07 PM.

  3. #3
    cPanel Staff cPanelMichael's Avatar
    Join Date
    Apr 2011
    Posts
    2,215
    cPanel/WHM Access Level

    Root Administrator

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

    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.
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists - Documentation - Migration Services
    -- cPanelMichael - Migration Specialist, Technical Analyst, cPanel Technical Support

  4. #4
    Member
    Join Date
    Jan 2010
    Location
    at net :D
    Posts
    50

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

    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. #5
    cPanel Staff cPanelMichael's Avatar
    Join Date
    Apr 2011
    Posts
    2,215
    cPanel/WHM Access Level

    Root Administrator

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

    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.
    Last edited by cPanelMichael; 05-19-2011 at 06:30 AM. Reason: edited for clarification
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists - Documentation - Migration Services
    -- cPanelMichael - Migration Specialist, Technical Analyst, cPanel Technical Support

  6. #6
    Member
    Join Date
    Jan 2010
    Location
    at net :D
    Posts
    50

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

    Quote Originally Posted by cPanelMichael View Post
    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.
    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

Similar Threads

  1. cgi-bin not found from http
    By tiggerific in forum cPanel & WHM Discussions
    Replies: 8
    Last Post: 09-23-2004, 02:59 AM
  2. CGI Execution Problem – Blank Pages
    By rochen in forum cPanel & WHM Discussions
    Replies: 5
    Last Post: 07-28-2003, 05:13 PM
  3. new day, new problem: no .cgi runs (outside cgi-bin)
    By kosmo in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 03-03-2002, 07:52 PM
  4. Interchange - Undefined catalog: /~xxxxx/cgi-bin/cart.cgi
    By wscreate in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 10-08-2001, 09:36 PM