InMotion Hosting Support Center

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

If you happen to have read our previous article on how to pass PCI compliance scans, leaving DirectoryIndexes on is a common way to fail a PCI scan. In this article we'll walk you through disabling this server wide on your server, please note that this would require root access to your server.

  1. Log into WHM
  2. In the top-left Find box enter in Apache, then click on Apache Configuration.
  3. Click on Global Configuration.
  4. Scroll down to the Directory "/" Options section, then un-check Indexes.
  5. Scroll down to the bottom of the page and click on Save.
  6. Finally click on Rebuild Configuration and Restart Apache, Apache can take up to a few minutes to rebuild and during this time your websites won't respond to requests.
  7. You should see that Apache was successfully restarted now.
  8. Now when you try to browse to a directory that doesn't have an index file, you'll receive an error instead of a directory listing.

You should now know how to disable Apache's DirectoryIndex setting server wide on your server. This can help increase security by ensuring a directory that doesn't include an index file isn't exposing any other possibly sensitive files.

Was this article helpful?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

n/a Points
2018-08-12 10:11 am

Will this limit Google search indexing of the site?

1,104 Points
2018-08-13 1:43 pm
It shouldn't as your websites' communication with Google bots and others are normally determined by a robots.txt file.
n/a Points
2016-01-29 10:47 am

I want to know how much time need to apache resatrt. My VPS has 2 GB Ram & 4 Core CPU

10,077 Points
2016-01-29 11:13 am
Hello Bishojit,

With VPS it should only take ~15 seconds for an Apache shutdown and startup. Are you experiencing longer periods for restarts.

Best Regards,
TJ Edens

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

4 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!