How to enable directory indexing for domains or directory?

Created:

2016-11-16 13:25:34 UTC

Modified:

2017-07-15 20:40:58 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to enable directory indexing for domains or directory?

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk Onyx for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux

Question

How to enable directory indexing for domains or directory?

Answer

The following directives are responsible for directory indexing:

<LocationMatch "^/.*$">
Options +Indexes
</LocationMatch>
  1. Modify configuration file:

To enable directory indexing for all domains on a server, add above mentioned directives to the end of the /etc/httpd/conf/httpd.conf file.

To enable directory indexing for a particular domain, add above mentioned directives to the corresponding files (for HTTP, HTTPS, and subdomains accordingly):

    /var/www/vhosts/example.com/conf/vhost.conf
/var/www/vhosts/example.com/conf/vhost_ssl.conf
/var/www/vhosts/example.com/subdomain/conf/vhost.conf

To enable directory indexing for a particular directory, for example, /var/www/vhosts/example.com/httpdocs/DIR_NAME , add the following lines into the appropriate /var/www/vhosts/example.com/conf/vhost.conf file:

    <LocationMatch "^/DIR_NAME.*$">
Options +Indexes +SymLinksIfOwnerMatch
</LocationMatch>
  1. Once the changes have been made, run the utility below for the changes to take effect, and restart Apache service:
    # /usr/local/psa/admin/sbin/websrvmng -v -a
    # service httpd restart
Have more questions? Submit a request
Please sign in to leave a comment.