Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 trying to install bugzilla 4 on ubuntu 11.04

I've added the following to my httpd.conf

<Directory “/var/www/dev.spincentre/bugzilla”>
   AddHandler cgi-script .cgi
   Options +Indexes +ExecCGI
   DirectoryIndex index.cgi
   AllowOverride Limit

But when I go to the URL, apache shows the text of index.cgi instead of executing the script. Any idea how to fix it?

share|improve this question

Did you load the mod_cgi module? You can see if the directory /etc/apache2/mods-enabled/ has a symlink cgi.load. If there is no such symlink, you can create it by running

sudo a2enmod cgi

and then restart Apache:

sudo service apache2 restart

You can run man a2enmod to see what a2enmod does.

share|improve this answer
I had similar issue on Ubuntu 14.04 in a process of migration from old servers. I never thought cgi would have been disabled by default which is not with old server. This fixed it!. Plz recommend them the same at…. Thank you! – user3215 Jun 3 '14 at 8:08
I have the symlink but cgi is still not running. – Whitecat Feb 24 at 0:28

When installing apache 2.4 I had a number of issues to solve and also had the same issue with text showing instead of running the cgi. The solution is not the same as above, which is the solution for apache 2.2

first you will download the 2.4 gz file and unpack. If you try to compile it will complain the APR is not found, since it is no longer included. You need to download the apr and apr-util files from apache and unpack them into the directory you are compiling apache into the sub directory called srclib, so your path would be ./httpd/srclib/apr and ./httpd/srclib/apr-util. you must also remove any version numbers from the directory name.

cd to your /path/httpd directory and the compile with

$ ./configure --with-included-apr

You config will default to PREFIX=/usr/local/apache2

$ make

$ make install

$ vi PREFIX/conf/httpd.conf

You will need to edit your httpd.conf file to get you cgi's to run

In my case I did the following:

change Listen 80 to Listen

activate the line: LoadModule cgid_module modules/

changed SeverName to: ServerName

changed the paths in DocumentRoot and Directory to suit my system

changed the path in ScriptAlias

enabled the line Scriptsock cgisock

changed the path in Directory after the ScriptAlias to suit my system

enabled the line AddHandler cgi-script .cgi

saved the changes and started apache with:

$ /usr/local/apache2/bin/apachectl -k start

Hope this helps anyone struggling with this ;)

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.