CGI problems

Discussion in 'Installation/Configuration' started by badben, Nov 17, 2005.

  1. badben

    badben ISPConfig Developer ISPConfig Developer

    I have a problem in that I can't seem to get a cgi script to work.

    They all worked perfectly on my other server but i get either a 403 server error or a 500 server error.

    If I uncomment the line

    # AddHandler cgi-script .cgi

    in

    /etc/httpd/conf/commonhttpd.conf

    I get the 500 error and if the line is commented out I get the 403 error.

    I am unsure as to what the problem could be.

    I have used the perfect setup on Mandrake 10.2
    :confused:
     
  2. benbalbo

    benbalbo ISPConfig Developer ISPConfig Developer

    The most common reason for 403 on a cgi script is it's not executable. Make sure the file is modded at least 755 and try that again.

    If that doesn't fix it, check the web server's error log - it's usually pretty good at giving clues :)

    Hope this helps
    BB
     
  3. benbalbo

    benbalbo ISPConfig Developer ISPConfig Developer

    Oh - maybe also check that "Options ExecCGI" or similar is set in the virtualhost directive. I guess this should be there if you've ticked the 'cgi' box in the web site 'basis' tab though.
     
  4. badben

    badben ISPConfig Developer ISPConfig Developer

    Still not working

    The virtual host settings are as follows:

    <VirtualHost XX.XXX.X.XXX:80>
    ServerName www.tidy-designs.com:80
    ServerAdmin [email protected]
    DocumentRoot /home/www/web3/web
    ServerAlias www.tidy-designs.com tidy-designs.com
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ScriptAlias /cgi-bin/ /home/www/web3/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/www/web3/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php3>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php4>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php5>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode On
    php_admin_value open_basedir /home/www/web3/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /home/www/web3/phptmp/
    php_admin_value session.save_path /home/www/web3/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    AddType application/vnd.wap.wmlscriptc .wmlsc .wsc
    AddType text/vnd.wap.wml .wml
    AddType text/vnd.wap.wmlscript .ws .wmlscript
    AddType image/vnd.wap.wbmp .wbmp
    Alias /error/ "/home/www/web3/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /home/www/web3/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/www/web3/user/$1/web/$3
    </VirtualHost>
     
  5. falko

    falko Super Moderator ISPConfig Developer

    Please post the output of
    Code:
    ls -la /home/www/web3/cgi-bin
     
  6. badben

    badben ISPConfig Developer ISPConfig Developer

    I have since reinstalled ISP Config so the site is now at web1

    ls -la /home/www/web1/web/domainname_checker/
    produces:

    drwxr-xr-x 2 web1_ web1 4096 Nov 21 19:54 ./
    drwxrwxr-x 6 web1_ web1 4096 Nov 21 20:31 ../
    -rw-r--r-- 1 web1_ web1 1526 Nov 21 19:54 index.html
    -rwxr-xr-x 1 web1_ web1 2976 Nov 21 20:26 whois.cgi*

    The virtualhost details in file Vhosts_ispconfig.conf reads:

    <VirtualHost XX.XXX.X.XXX:80>
    ServerName www.tidy-hosting.com:80
    ServerAdmin [email protected]
    DocumentRoot /home/www/web1/web
    ServerAlias tidy-hosting.com
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ScriptAlias /cgi-bin/ /home/www/web1/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/www/web1/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php3>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php4>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php5>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode On
    php_admin_value open_basedir /home/www/web1/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /home/www/web1/phptmp/
    php_admin_value session.save_path /home/www/web1/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    AddType application/vnd.wap.wmlscriptc .wmlsc .wsc
    AddType text/vnd.wap.wml .wml
    AddType text/vnd.wap.wmlscript .ws .wmlscript
    AddType image/vnd.wap.wbmp .wbmp
    Alias /error/ "/home/www/web1/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /home/www/web1/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/www/web1/user/$1/web/$3
    </VirtualHost>


    When I try to run the script I get a 500 error page
     
  7. badben

    badben ISPConfig Developer ISPConfig Developer

    Is it because the file is not in the cgi bin and if so can I get the file to run anywhere?
     
  8. falko

    falko Super Moderator ISPConfig Developer

    Yes, you have to put the file into cgi-bin!
     
  9. badben

    badben ISPConfig Developer ISPConfig Developer

    In that case does anybody know of a good php based site search script.
     
  10. falko

    falko Super Moderator ISPConfig Developer

    Can't you use the script if it's in cgi-bin?

    You can search www.hotscripts.com for PHP search engines. PHPDig is a good one, but maybe there are better ones...
     

Share This Page