Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm Running Apache 2.2 on the RackSpace CloudSites. I have a Perl CGI script that works fine if called directly via URL. I want to use the script as a custom ErrorDocument, but instead of being parsed and run it displays the text as plain text.

Here is my .htaccess file:
DirectoryIndex index.php index.html index.htm
Options +ExecCGI
ErrorDocument 404 /cgi/test.cgi

Any help wold be appreciated!

share|improve this question
When the cgi works fine are they inside cgi-bin or outside ? that could be your problem if the cgi is not allowed to run outside of the cgi-bin folder so you would need to put the test.cgi inside it. – Prix Oct 4 '10 at 18:05
Thanks for the replay Prix,The cgi is in a sub-dir of the document root with ExecCGI enabled. So it's outside the cgi-bin but enabled. It runs fine from this location just not if invoked by the .htaccess' ErrorDocument directive. – joatis Oct 5 '10 at 15:46
up vote 0 down vote accepted

After working with CloudSites support: 1. I had my .htaccess in a directory which won't allow the running of cgi scripts, no matter what options you add. I had to move the .htaccess up one level and refer to a file in a child dir. 2. They said the popular way to do this now is to use PHP instead of CGI.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.