• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Allow directory browsing for one domain

Kroptokin

Regular Pleskian
Hi

I am using Plesk 11.5 on Centos 6.4.

I am trying to achieve directory listing. Normally I would do this by putting:

Options +Indexes

in a .htaccess file.

This isn't working.


EDIT:

OK. I have found out how to add Apache directives through Plesk by going to the web server settings. Accessed by the customer control panel, then clicking on the domain name). But adding Options +Indexes still does not work here.

Any ideas gratefully received.

Thanks

--Justin Wyllie
 
Last edited:
OK. It seems that the default Apache configuration with Plesk (I am on Plesk 11.5) is that if there is no index.html (or index.php I think) file in the root directory of a web site it will show a file /var/www/error/noindex.html. So setting Options +Indexes either in an .htaccess file or through the Control Panel Web Server Settings tab will not work because this - showing an error file if no index file is found takes precedence.

Options +Indexes works perfectly fine in all sub directories.

The fix would probably be to either find this Apache configuration and change it - or possibly adjust the way that 'errors' are handled through the interface. I don't know. After 2 hours on this I decided to use a PHP script to emulate directory listing.
 
Hello,

Please check : http://kb.parallels.com/en/437

Also you can set your own DirectoryIndex through .htaccess for your domain.

Hi InderS,

This used to work with 9/10 but no joy for me with 11. This is a server move and move from a plesk 10 to plesk 11 server, directory browsing used to work, doesn't anymore - even with the custom vhost.conf and apache reboot.

Have a look here:
http://www.techiecorner.com/1822/how-to-remove-apache-test-page-in-centos/

I only turned off the error page, leaving the /etc/httpd/conf.d/welcome.conf looking like this:

Code:
<LocationMatch "^/+$">
    Options -Indexes
#   ErrorDocument 403 /error/noindex.html
</LocationMatch>

OK. It seems that the default Apache configuration with Plesk (I am on Plesk 11.5) is that if there is no index.html (or index.php I think) file in the root directory of a web site it will show a file /var/www/error/noindex.html. So setting Options +Indexes either in an .htaccess file or through the Control Panel Web Server Settings tab will not work because this - showing an error file if no index file is found takes precedence.

Options +Indexes works perfectly fine in all sub directories.

The fix would probably be to either find this Apache configuration and change it - or possibly adjust the way that 'errors' are handled through the interface. I don't know. After 2 hours on this I decided to use a PHP script to emulate directory listing.

I almost did the same and resorted to a PHP script but sometimes you come so far and just have to find the problem :D

With the error document removed you can then do the usual custom vhost file in /var/www/vhosts/yourdomain.com/conf/vhost.conf containing:

Code:
<Directory "/var/www/vhosts/secretfiles.co.uk/httpdocs">
        Options +Indexes
</Directory>

And you will have Apache directory browsing working again. Just need to get this working with icons and I will be back in happy land:

Code:
<Directory "/var/www/vhosts/secretfiles.co.uk/httpdocs">
        Options +Indexes
        AddIcon /icons/wordicon.gif .doc .docx
</Directory>
 
Back
Top