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

My friend and I are working on an art site and one of our scripts works fine in most of the upper levels of ./www but once we get down to ./www/testing/project2/cgi-bin/.. cgi files seem to only return 500 errors. The exact same scripts work higher up the directory. Any way to coax apache into letting us run this cgi file in these lower directories?

share|improve this question
up vote 1 down vote accepted

The default apache2 configuration in Ubuntu will enable the ExecCGI option only for a specific directory below your main one (cgi-bin). You can however add this option to any directory you like including your main one.

Find the Apache configuration for that site. Look for the relevant <Directory> section which will either be in one of your virtual host config files, or if it's site-wide, it'll be in /etc/apache2/sites-available/default. You can either edit it here, or put your new configuration into a separate file under /etc/apache2/conf.d/.

You'll need to add ExecCGI to your Options directive (or create a new Options parameter with +ExecCGI added).

Example for editing an existing Options directive:

<Directory /usr/home/joe/www>
    Options Indexes FollowSymLinks Includes ExecCGI
    Order allow,deny
    Allow from all

Example for creating a new Options directive for a directory that overrides the Apache-wide default one:

<Directory /usr/home/joe/www>
    Options +ExecCGI
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.