LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-16-2010, 10:25 PM   #1
lspiehler
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Rep: Reputation: 0
Apache 2.2 Virtual Hosts won't serve index.html


I've hosted my own apache2.2 server on debian lenny for a while now, and the other day, I went to set up a new virtual host with an index.html file in the document root. I had to actually type index.html in the end of the url for the page to display. Otherwise I get a 404 "Not Found" "The requested URL / was not found on this server." All of my other virtual hosts work fine. I then realized that all other pages were index.php, so I checked the DirectoryIndex directive, and index.html is at the front of the list. I did try to move it down the list out of desperation, but it didn't help. I then changed my index.html to index.php, and sure enough, it came up correctly. Index.htm is also in the DirectoryIndex directive, but changing it to that didn't work either. The php thing does seem to work fine, but I'd really like to figure out whats going on. Also, in my test setup, with a .htm and .html file (I have attempted with only one or the other) when trying to access the site, my error log shows "Attempt to serve directory: /var/www/test/" for every attempt. Any help is greatly appreciated.
 
Old 05-17-2010, 12:48 AM   #2
sushantchawla2005
Member
 
Registered: Jun 2009
Location: India
Distribution: All flavours of linux
Posts: 93

Rep: Reputation: 14
Thumbs up

Quote:
Originally Posted by lspiehler View Post
I've hosted my own apache2.2 server on debian lenny for a while now, and the other day, I went to set up a new virtual host with an index.html file in the document root. I had to actually type index.html in the end of the url for the page to display. Otherwise I get a 404 "Not Found" "The requested URL / was not found on this server." All of my other virtual hosts work fine. I then realized that all other pages were index.php, so I checked the DirectoryIndex directive, and index.html is at the front of the list. I did try to move it down the list out of desperation, but it didn't help. I then changed my index.html to index.php, and sure enough, it came up correctly. Index.htm is also in the DirectoryIndex directive, but changing it to that didn't work either. The php thing does seem to work fine, but I'd really like to figure out whats going on. Also, in my test setup, with a .htm and .html file (I have attempted with only one or the other) when trying to access the site, my error log shows "Attempt to serve directory: /var/www/test/" for every attempt. Any help is greatly appreciated.

In your virtual host section try putting DirectoryIndex index.html
I was facing the same problem & it got resolved with this extra directive in my virtual host container.

Regds
Sushant Chawla
Linux Administrator
 
Old 05-17-2010, 06:27 PM   #3
lspiehler
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you for your reply. I had tried that previously, but I tried it again hoping I'd made a mistake before. Unfortunately its a no-go. Any other ideas?
 
Old 05-18-2010, 12:30 AM   #4
sushantchawla2005
Member
 
Registered: Jun 2009
Location: India
Distribution: All flavours of linux
Posts: 93

Rep: Reputation: 14
Quote:
Originally Posted by lspiehler View Post
Thank you for your reply. I had tried that previously, but I tried it again hoping I'd made a mistake before. Unfortunately its a no-go. Any other ideas?
Can you send me the configurations of your apache file?

Regds
Sushant Chawla
Linux Administrator
 
Old 08-11-2011, 05:27 AM   #5
tniemela
LQ Newbie
 
Registered: May 2007
Location: Finland
Distribution: Debian 6.0
Posts: 9

Rep: Reputation: 0
I encountered today the same problem using Apache 2.2.18.

Do you have any other virtual host defined under the same document root? I mean if your configuration is this way:

VHOST A uses: DocumentRoot /home/test/public_html
VHOST B uses: DocumentRoot /home/test/public_html/test

It causes that error. It's getting even more interesting, my another shell that uses 2.2.17, does not have this error. After configuring VHOST B to it's own documentroot, it solved this issue for 2.2.18

Last edited by tniemela; 08-11-2011 at 05:35 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache index.html doesn't show up but index.php do zoffmann Linux - Server 5 01-28-2008 04:53 PM
[apache 2.0] can't get index.html to load fraggie Linux - Software 5 04-09-2005 06:55 AM
apache is skipping index.html spicychicken Linux - Software 1 02-15-2005 02:25 AM
Index pages for virtual hosts dienerk Linux - General 1 10-22-2004 01:44 PM
Virtual Hosts/Directory Index Forbidden by Rule Alan Powell Linux - Newbie 4 04-26-2004 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration