How do I enable apache file and directory indexing under Linux or UNIX?

How do I enable apache file and directory indexing under Linux or UNIX?

To enable Apache file and directory indexing on a Linux or UNIX system, you can follow these steps:

  1. Open a terminal and use the sudo command to enter a command as the root user:
sudo -i
Sourc‮.www:e‬lautturi.com
  1. Open the Apache configuration file (/etc/httpd/conf/httpd.conf) in a text editor:
nano /etc/httpd/conf/httpd.conf
  1. Find the DirectoryIndex directive and specify the default file names that Apache should use for directory indexing. For example:
DirectoryIndex index.html index.php
  1. Find the Options directive for the directory you want to enable indexing for. This directive is typically located in a <Directory> block.

  2. Add the Indexes option to the Options directive. For example:

Options Indexes FollowSymLinks
  1. Save the file and exit the text editor.

  2. Restart Apache to apply the changes:

systemctl restart httpd

Now, when you access a directory on your Apache server without specifying a specific file, Apache will display a list of the files and subdirectories in the directory.

Note: The steps may vary depending on your Linux distribution and the version of Apache you are using. Consult the documentation for your specific system for more information.

Created Time:2017-10-28 21:38:54  Author:lautturi