Create a CGI directory which allows Directory Listing

Written by James McDonald

March 6, 2011

I wanted to create a cgi-bin directory which would allow me to execute the files and also to view a directory index of them.

This is the default setup for the system cgi-bin directory but it wouldn’t allow me to do what I wanted.
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None

Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all


With some guidance from the Apache Documentation on CGI I was able to come up with a configuration that did what I wanted.
<Directory "/home/myuser/maps/cgi">
AllowOverride None
AddHandler cgi-script cgi pl sh
Options Indexes +ExecCGI -MultiViews +SymLinksIfOwnerMatch
# Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...