By default, the CS web server will not give a directory listing for security reasons. Allowing this feature makes it far too easy for the casual browser to find files that may not have been meant for public viewing. So, if you want people to be able to see a directory listing via the web, you have two options:
- Using DirectoryIndex - We have the web server configured so that users can use the DirectoryIndex directive in the personal hyplan (ie. ~username) webspace. (NOTE: this does not work outside of the hyplan area so you will have to use the second option in that case). To use this option, you must create a file called .htaccess and add a line like the following:
DirectoryIndex index.html /cgi-bin/makedirindex.cgi
This tells the web server to look for an index.html file and, if that isn't found, then to run the makedirindex.cgi script. This script just generates a directory listing.
Please note that this is recursively applied to all subdirectories under the directory containing the .htaccess file so use with caution.
- Creating an index.html - You can create a file called index.html in that directory that just contains the directory listing. You can use the makedirindex command to create this index.html file for you. Just cd to the directory and run:% makedirindex> index.htmlNote that you will have to regenerate the index.html file whenever the contents of the directory changes since this is a static page that is not auto-generated. You can automate this task via a machanism like cron if desired.
[Return to the FAQ index]