indexes Whm / Cpanel
Disable directory indexes on Apache using cPanel/WHM for increased security



DirectoryIndexes allows the files in a folder to be viewed via a directory index when there is no index file present in that directory. By default Apache's DirectoryIndexes value is turned on server wide.

It is always recommended to disable it on the server for security reasons. PCI scan fails if DirectoryIndexes is set to On on the server. This thread will walk you through disabling DirectoryIndexes on the server. If you wish to disable it, you will require root access of the server.

How can I disable directory indexes for all websites on cPanel server? Answer: yes, there is a very simple method to completely disable the indexes directive from Apache web server for all websites inside a cPanel / WHM server.
On this post we will learn about what is directory index or indexes, and how to disable indexes using the Apache configuration interface from WHM control panel.

What is directory index?

Before getting into the task, lets discover what is directory index after all.
Directory indexes or directory index, is an webserver feature that allows a remote user to browse your website files when there is no index file placed inside a directory.

Disable directory indexes server wide on Apache using cPanel

Altough this can lead attackers to know more information about your website, on cPanel servers it is enabled by default. There is absolutely no need to have this enabled by default because if you need to browse your files you can do it perfectly using FTP, SSH or SFTP instead.
You can disable directory indexes on cPanel from the command line or via WHM interface, that is our preffered way and the recommeded by cPanel official guides.
Lets start disabling indexes on Apache:
1. Log into WHM as root user.
2. Move to WHM Service Configuration Apache Configuration, as you see below:


Fig. 01. WHM Service Configuration Apache Configuration 3. Click on Global Configuration.
4. Move to Directory / Options.
5. Deactivate/uncheck Indexes option.



Fig. 02. WHM Service Configuration Apache Configuration Disable Indexes on cPanel 6. Save and rebuild Apache configuration to apply changes



Fig. 03. WHM Service Configuration Apache Configuration Rebuild Apache and Restart Thats all, at athis time you should have disabled directory index / directory listing for all your cPanel accounts.

:







-------------------------------------------------------------------
How can I disable directory listing for a single cPanel account?
-------------------------------------------------------------------

You can customize the directory settings of a website. By default, cPanel lists all the files and directories of the website. You can also disable directory listing of the website by choosing No indexes.

Method1

1) Login to your cPanel interface.
2) Click the icon Indexes under ADVANCED category.



3) Select the directory for which you want to change the index settings.
4) A new window will open and here you can click No Indexing option to disable directory listing.




Here you can see four types of indexing methods.
Default System Indexing: This is the default option set by a hosting provider.
No Indexing: This option allows to disable directory listing. The main reason to disable directory listing is to enable privacy in order to reduce the chances of the files being attacked.
Standard Indexing: This option will enable the directory listing. The user can see the name of the directories.
Fancy Indexing: This option will enable the directory listing. The user can see the name and description of the files and directories under your indexed directory.
5) Click Save.

Method 2

1) Login to your cPanel interface.
2) Click File manager icon from the FILES category.



3) Select the folder for which you want to disable directory listing.
4) Right click the folder and click Change Permissions option to set the permission of that folder.



5) Assign permission as 771. This means that the folder cant be accessible by users or visitors it can only be accessible to the owners and its groups.



6) Click Change Permissions to save the changes.



Method 3

1) Login to your cPanel interface.
2) Click File manager icon from the FILES category.



3) Select and right click the folder which you want to disable directory listing.
4) Click Manage Indices option.



5) Click the option No Indexing
6) Click Save.

:
https://forums.cpanel.net/threads/di...isting.666953/