954,242 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Apache not finding index.html by default

Hi,

I have a problem with my apache install on Ubuntu. It finds index.php by default but not index.html or.htm
I tried adding DirectoryIndex index.html index.htm index.php to apache2.conf but that didn't work. It just give a Forbidden Error unless there is an index.php present.

Regards,

James

jamesl22
Light Poster
36 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

It seems that, there is no problem with apache configuration. The problem is with the access rights of the index.html and index.htm files. Now try the chown command and change the ownership of these files to same as index.php file.

For more information you can refer
http://www.checkupdown.com/status/E403.html

thewebhostingdi
Junior Poster
168 posts since Jun 2009
Reputation Points: 3
Solved Threads: 14
 

Check the parse handler.

printrobin
Light Poster
47 posts since Jun 2009
Reputation Points: 20
Solved Threads: 1
 

It seems that, there is no problem with apache configuration. The problem is with the access rights of the index.html and index.htm files. Now try the chown command and change the ownership of these files to same as index.php file.

For more information you can refer http://www.checkupdown.com/status/E403.html

Hi,

I think I hvn't made myself clear. If i go to www.mysite.com/index.html it appers. But if i go to www.mysite.com index.html is not automaticly readirected to. Index.html has all the right permissions.

jamesl22
Light Poster
36 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

Hi James,
I had a similar issue and I just found a solution, if you haven't already.
Here's how I solved it:
In my /etc/apache2/ folder I did a
grep -r "DirectoryIndex" .
I found I had
DirectoryIndex index.shtml
in my /etc/apache2/sites-available/default file.
After changing that line to DirectoryIndex index.html and reset the server it was working fine.
I hope it helps.

Tickon
Newbie Poster
6 posts since May 2009
Reputation Points: 10
Solved Threads: 1
 

Ok i'll give that a go

jamesl22
Light Poster
36 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 
Hi James, I had a similar issue and I just found a solution, if you haven't already. Here's how I solved it: In my /etc/apache2/ folder I did a grep -r "DirectoryIndex" . I found I had DirectoryIndex index.shtml in my /etc/apache2/sites-available/default file. After changing that line to DirectoryIndex index.html and reset the server it was working fine. I hope it helps.

Thanks, that worked i had conflicting instances of DirectoryIndex. I specified it in my virtual host config instead.

jamesl22
Light Poster
36 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

Great, I'm glad it helped!

Tickon
Newbie Poster
6 posts since May 2009
Reputation Points: 10
Solved Threads: 1
 

is in ubuntu, apache web server the default of DirectoryIndex index.html, isn't it?

ahromi
Newbie Poster
5 posts since Apr 2009
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: