Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Intermittent display directory index or correct index.html

Status
Not open for further replies.

SM777

Technical User
Mar 7, 2001
208
GB
I have a problem where Apache will intermittently display either the directory index, or serve the correct index.html

I open up a new IE browser and go to
Sometimes I will either get the correct index.html page displayed, sometimes a directory listing is returned.

If I click the browser refresh, again, it is random as to if the directory is listed or the proper index.html served.

This is most annoying and it is happening for search engines too.

Note that it only happens if a request for the 'homepage' i.e. is called for. If a request for
is made then it is correctly served.

Centos 4. Apache 2.052.
 
Do you have these options in your httpd.conf file ?

Code:
<Directory "/usr/path/to/Apache/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>



DirectoryIndex index.html index.html.var


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
This is what is in the main part of httpd.conf:

-------------------------------
DocumentRoot "/home/mysite/public_html"
DirectoryIndex index.html index.htm index.php
IndexOptions FancyIndexing SuppressColumnSorting SuppressDescription SuppressLastModified SuppressSize SuppressIcon SuppressRules
IndexIgnore .?* *~ *# HEADER* RCS CVS *,v *,t
---------------------------------

Then in the Virtual Server Section:
-------------------------------------------
<Directory "/home/mysite/public_html/*">
Options -Indexes FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
--------------------------------------------

As I say, it's intermittent so can't see why a simple mistake in httpd.conf would cause this. The effect is like the apache looks for an index.html and but sometimes can't see it so returns the directory listing instead.
 
In the Virtual Section, why did you put the symbols i point with red?
Code:
<Directory "/home/mysite/public_html[b][red]/*[/red][/b]">
remove them and try again, and remember, you have to restart the Apache server and also your browser.
Tell me what happen..


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
I don't know why the /* is in there. The conf file has been like that on the server for a while.

I've removed it now and will have to wait and see what happens. As I said - it's intermittent so it's not clear cut if there is a mistake in httpd.conf which causes the problem.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top