We help IT Professionals succeed at work.

Allowing Directory Index

Medium Priority
Last Modified: 2008-03-06
I'm trying to allow Directory Indexing in my /var/www/cgi-bin/ so when someone goes to my site example.com/cgi-bin index.cgi will come up without having to type it.

Watch Question

If you're having trouble setting the filetype permissions you can always create an index.htm file with a redirect to index.cgi.....inelligant solution, but it's a workaround I've had to use on certain acaemic servers before...
Top Expert 2008

Create an .htaccess file in your main directory (/var/www/html) or a subdirectory of your choice.  This file will control settings for the directory it is placed in , plus all subdirectories below it unless they have .htaccess files of their own.

Add this line to that file:

Options +Indexes

if you are running apache2 then you can check your /etc/apache/httpd.conf file for the following line

<IfModule dir_module>
   DirectoryIndex index.html index.htm

Adding index.cgi behind the index.htm should cause apache to look for index.html if it doesn't find it, then it will look for index.htm, then if it doesn't find that, it will look for index.cgi ...

Hopefully that is what you are looking for.

Top Expert 2005

jcullins is almost there. Just add the index.cgi at the end of list of those insexes - restart apache.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.