Jump to content

httpd.conf - What to put for a certain setting


Recommended Posts

Hi Guys,

I am really new to this Apache server stuff and am stuck.

I have a Apache webserver up and running, I am trying to make a directory on the server NOT list the index of files if there is no index.htm or index.html or index.php etc in the directory.

I looked on google and found a website that said this is what I needed to change in my httpd.conf:

#

# This may also be "None", "All", or any combination of "Indexes",

# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".

#

# Note that "MultiViews" must be named *explicitly* --- "Options All"

# doesn't give it to you.

#

Options Indexes FollowSymLinks MultiViews

It stated that I should remove Indexes from the Options line, however I made this change by taking the Indexes out, restarted the server but when I type in http://www.mydomain.com/images/ the browser still lists the contents of the directory, I know I could just put a blank index.htm file in but wondered if there was a better way using the server configuration?

Any advice appreciated.

Cheers.

TC

Link to comment
Share on other sites


i do the simple blank index.html file. its actualy not blank, it says access denied lol. Works for me. you could also just redirect them to the front page using .htaccess (if possible) or just with html

Link to comment
Share on other sites

In the section that says

<Directory "/var/www/html">

Options Indexes Includes FollowSymLinks

AllowOverride all

Allow from all

Order allow,deny

</Directory>

remove Indexes so that you see this:
<Directory "/var/www/html">

Options Includes FollowSymLinks

AllowOverride all

Allow from all

Order allow,deny

</Directory>

then save the httpd.conf and restart the services. i tested on my apache server and it worked. when you have indexes turned off, apache auto generates an error page saying you don't have access. when turned on, it shows the index of the files in the directory.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...