ÇáãÓÇÚÏ ÇáÔÎÕí ÇáÑÞãí

ãÔÇåÏÉ ÇáäÓÎÉ ßÇãáÉ : ÔÑÍ ÊÚØíá indexes ááÍãÇíÉ Ýì ÇáÓí ÈÇäá Whm / Cpanel



Rise Company
23-05-2020, 22:29
ÔÑÍ ÊÚØíá indexes ááÍãÇíÉ Ýì ÇáÓí ÈÇäá Whm / Cpanel
Disable directory indexes on Apache using cPanel/WHM for increased security

https://www.rise.company/upload/uploads/159026566652721.png

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, let’s 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.
Let’s start disabling indexes on Apache:
1. Log into WHM as root user.
2. Move to WHM » Service Configuration » Apache Configuration, as you see below:

https://www.rise.company/forum/images/imported/2020/05/44.jpg
Fig. 01. WHM » Service Configuration » Apache Configuration 3. Click on Global Configuration.
4. Move to Directory “/” Options.
5. Deactivate/uncheck Indexes option.

https://www.rise.company/forum/images/imported/2020/05/45.jpg

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

https://www.rise.company/forum/images/imported/2020/05/46.jpg

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

ÇáäÊíÌÉ ÞÈá :

https://www.rise.company/forum/images/imported/2020/05/20.png

ÇáäÊíÌÉ ÈÚÏ

https://www.rise.company/forum/images/imported/2020/05/21.png

-------------------------------------------------------------------
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.

https://www.rise.company/forum/images/imported/2020/05/22.png

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.

https://www.rise.company/forum/images/imported/2020/05/23.png


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.

https://www.rise.company/forum/images/imported/2020/05/24.png

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.

https://www.rise.company/forum/images/imported/2020/05/25.png

5) Assign permission as “771”. This means that the folder can’t be accessible by users or visitors it can only be accessible to the owners and it’s groups.

https://www.rise.company/forum/images/imported/2020/05/26.png

6) Click ‘Change Permissions’ to save the changes.

https://www.rise.company/forum/images/imported/2020/05/27.png

Method 3

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

https://www.rise.company/forum/images/imported/2020/05/28.png

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

https://www.rise.company/forum/images/imported/2020/05/29.png

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

ÇáãÑÌÚ:
https://forums.cpanel.net/threads/disable-directory-listing.666953/