LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache won't default to index.html (https://www.linuxquestions.org/questions/linux-software-2/apache-wont-default-to-index-html-165870/)

TexasDex 04-03-2004 07:47 PM

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:

#
# Virtual hosts
#

# Virtual host Default Virtual Host
<VirtualHost 192.168.0.1>
        ServerName texasdex.com
        DirectoryIndex index.php index.html index.htm index.shtml
        LogLevel debug
        HostNameLookups off
</VirtualHost>

The rest of the file can be found here
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.

druuna 04-04-2004 06:25 AM

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.

TexasDex 04-04-2004 06:21 PM

okay. How long does it usually take for the httpd.conf file to be applied.

artistikone 04-04-2004 06:32 PM

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

bigearsbilly 04-05-2004 05:50 AM

There is also a directive somewhere, in UserDir I think
which enables you to turn off the ability to get a directory
listing.

TexasDex 04-05-2004 08:33 AM

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