Directory listing on the Apache web server

In this example, we want to make files, that are stored within a directory on a web server, available to users by making the Apache web server list these files in the absence of an index file.

We are using the Apache 1.3 web server on a FreeBSD operating system.

We create the directory, that we will use to list files, as a sub directory of the website directory on the web server and allow the web server to access it.

cd www.foobar.com
mkdir listing
chmod listing 0775

We add the directory, that we will use to list files, to the virtual host section of the web server configuration file.

nano -w /usr/local/etc/httpd.conf
<Directory /usr/home/foobar/www/www.foobar.com/listing>
Options +Indexes
</Directory>

We test the changes and, if there is no problems, restart the web server.

apachectl configtest && apachectl restart

Print

You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.