Apache won't default to index.html
I modified my httpd.conf file a while ago in order to install phpBB2, and I have recently found that Apache was sending the directory listing for all folders, even those that have index.html in them.
Code:
# As far as I can tell that's the only part of the httpd.conf that makes any difference. The .conf file was originally made with Redhat Apache Config but I have modified it by hand since then. When I get the root directory of the server it pretends that the index.html file isn't there. I know I have it capitalized right, but it doesn't work and instead gives me the RedHat "no index found" page. If I do that in other directores with an index.html file in them I get the directory listing. |
It seems that you only declare a DirectoryIndex for the virtual parts, not a global one.
# DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # # The index.html.var file (a type-map) is used to deliver content- # negotiated documents. The MultiViews Option can be used for the # same purpose, but it is much slower. # DirectoryIndex Should be something like: DirectoryIndex index.php index.html index.htm index.shtml Hope this helps. |
okay. How long does it usually take for the httpd.conf file to be applied.
|
You must restart Apache for the changes to take affect.
Either: killall -HUP httpd Or if you have a httpd startup script: /path/to/script/script restart |
There is also a directive somewhere, in UserDir I think
which enables you to turn off the ability to get a directory listing. |
/etc/init.d/httpd restart
Thanks. It worked! I don't know why redhat-httpd-conf didn't make the file right, maybe I didn't know what I was doing while using the tool, but anyway it works now. It's helpful to know that Apache must be restarted for changes to take effect. I had had some major problems with that earlier where I had no idea why it wasn't working. I guess I'm used to Samba, which re-applys the settings every few minutes. |
All times are GMT -5. The time now is 04:16 PM. |