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've reviewed numerous guides to find out why my CGI isn't working and cant' seem to find it. My site config looks like this:

<VirtualHost *:80>

 # Directory Root.
 DocumentRoot /sites/

 # CGI Directory
 ScriptAlias /cgi-bin/ /sites/
 <Location /cgi-bin>
   Options +ExecCGI
 <Directory /sites/>
   Options ExecCGI
   AddHandler cgi-script cgi pl

 # Logfiles
 ErrorLog  /sites/
 CustomLog /sites/ combined

I'm trying to get CGI on /bugzilla. I'm not sure if it runs on cgi-bin or not. I also installed perl using sudo aptitude install libapache2-mod-perl2


The CGI bin is not within my www directory, is there a way that I can test it via command line?

share|improve this question
up vote 0 down vote accepted

Obvious answer first: You're restarting Apache, right?

Otherwise, I don't think you need to explicitly state +ExecCGI for /cgi-bin -- The ScriptAlias directive should do that automatically. And why not just use the ScriptAlias directive on the bugzilla directory, if that's what you want? Removing the uncessary Location and Directory sections might help out.

Does this work OK for cgi-bin? If so, you may want to copy the functionality a bit closer, by using the ScriptAlias directive, etc.

If none of that helps, can you let us know exactly how it fails? Are you getting 404s? The text of your cgi-scripts?

--Christopher Karel

share|improve this answer
I get the text of my CGI scripts outputted on the page. The CGI bin is outside of www so I'm not sure how to access it. – Webnet Jul 7 '10 at 18:04
The Script alias defines what URL you use to get it. From your example of ScriptAlias /cgi-bin/ /sites/, you would access a cgi bin as – Christopher Karel Jul 7 '10 at 21:00

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.