We help IT Professionals succeed at work.

Allowing Directory Index

Medium Priority
939 Views
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.

Thanks,
Comment
Watch Question

Commented:
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

Commented:
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

Commented:
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
</IfModule>

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.

Thanks
Top Expert 2005

Commented:
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.