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

There are 2 ways to enable apache file and directory indexing.

Using Apache config file :

  1. You can add directory options in the Apache configuration file directly. httpd.conf is a apache config file or you can add it in /etc/apache2/apache2.conf:

    # vi /etc/apache2/apache2.conf
<Directory /var/www/example.com/folder>
Options Indexes FollowSymLinks
</Directory>
  1. Once you add the above code, save and close the file.

  2. Restart httpd service.

    # /etc/init.d/httpd restart

Using .htaccess Files with Apache :

If you have .htaccess enabled, you can put a config line options indexes in your .htaccess file.

  1. Open your .htaccess file.

    # vi .htaccess
    
  2. Add the following apache directive.

    Options Indexes
    DirectoryIndex index.php index.html /example.php
  3. Save and close your .htaccess file.
  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How to Kill a Process Running on Specific Port in Linux?

First of all, we will need to identify the Process ID which runs on any port. Once we find the...

How to change Magento site URL from phpMyAdmin?

Magento is a widely used E-commerce store management system. In this article, we will show you...

How to Manage Linux Cloud VPS From Client Area?

This article will assist you to manage your Linux Cloud VPS from client area (though you will...

How to Enable Plaintext Authentication in Dovecot?

Dovecot is an Open source IMAP or POP3 server used to create light-weight and high-performance...

How to upgrade MySQL/Maria DB in WHM/cPanel?

Note: These steps will work only with the cPanel version 88 and later. Please refer to the below...