• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 784
  • Last Modified:

.htaccess cgi

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, webmaster@jorysoft.com 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.
  • 3
  • 2
  • 2
  • +1
1 Solution
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

> 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?
sal1150Author Commented:
Apache  version is 1.3.41 (Unix) .
but I did no find "httpd.conf".
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

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.
James LooneySr. Programmer/AnalystCommented:
your httpd.conf may be in /etc/httpd/
sal1150Author Commented:
no it is not in /etc/httpd/
 -D HTTPD_ROOT="/etc/httpd"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"


My httpd.conf is in: /etc/httpd/conf/httpd.conf
sal1150Author Commented:
I DO NOT HAVE a reason?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now