To enable Apache file and directory indexing on a Linux or UNIX system, you can follow these steps:
sudo
command to enter a command as the root user:sudo -iSourc.www:elautturi.com
/etc/httpd/conf/httpd.conf
) in a text editor:nano /etc/httpd/conf/httpd.conf
DirectoryIndex
directive and specify the default file names that Apache should use for directory indexing. For example:DirectoryIndex index.html index.php
Find the Options
directive for the directory you want to enable indexing for. This directive is typically located in a <Directory>
block.
Add the Indexes
option to the Options
directive. For example:
Options Indexes FollowSymLinks
Save the file and exit the text editor.
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.