.htaccess  cgi

Posted on 2008-11-14
Last Modified: 2013-12-25
I try many times to run cgi scripts.
I located cgi script in "scgi-bin".
then I add the folloing in  "/public_html/.htaccess"
AddModule mod_cgi.c
AddModule mod_alias.c  
<IfModule mod_alias.c>
ScriptAlias /cgi-bin/ "/home/jorysoft/public_html/scgi-bin"
    <Directory "/home/jorysoft/public_html/scgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
 AddHandler cgi-script .cgi

But not working
I got this massage rrror :
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, 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.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Question by:sal1150
    LVL 5

    Expert Comment

    You should check /var/log/httpd/error.log (RedHat) or /var/log/apache2/error.log (Debian). There you can see the real error.
    cat /var/log/httpd/error_log
    [Fri Nov 14 14:24:47 2008] [error] [client x.x.x.x] (8)Exec format error: exec of '/../image.gif' failed, referer: https://...

    Open in new window

    LVL 27

    Expert Comment

    > then I add the folloing in  "/public_html/.htaccess"

    That should go into your httpd.conf, not .htaccess

    > AddModule mod_cgi.c
    > AddModule mod_alias.c  

    AddModule is a directive from apache 1.3x, do you use this version?

    Author Comment

    Apache  version is 1.3.41 (Unix) .
    but I did no find "httpd.conf".
    LVL 27

    Expert Comment

    Depending upon your configuration the file should live in a folder called "conf".

    You may also call
    apache -V  or
    httpd -V  via shell, which should show you the compile options. The path should be HTTPD_ROOT + SERVER_CONFIG_FILE.
    LVL 6

    Expert Comment

    your httpd.conf may be in /etc/httpd/

    Author Comment

    no it is not in /etc/httpd/
    LVL 5

    Accepted Solution

    # httpd -V | egrep "HTTPD_ROOT|SERVER_CONFIG_FILE"
     -D HTTPD_ROOT="/etc/httpd"
     -D SERVER_CONFIG_FILE="conf/httpd.conf"


    My httpd.conf is in: /etc/httpd/conf/httpd.conf

    Author Closing Comment

    I DO NOT HAVE a reason?

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
    Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now