LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-03-2004, 08:47 PM   #1
TexasDex
Member
 
Registered: Feb 2003
Location: The Attic. Nowhere near Texas.
Distribution: Gentoo, Kubuntu, formerly LFS, SuSE, and RedHat
Posts: 133

Rep: Reputation: 15
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.
 
Old 04-04-2004, 07:25 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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.
 
Old 04-04-2004, 07:21 PM   #3
TexasDex
Member
 
Registered: Feb 2003
Location: The Attic. Nowhere near Texas.
Distribution: Gentoo, Kubuntu, formerly LFS, SuSE, and RedHat
Posts: 133

Original Poster
Rep: Reputation: 15
okay. How long does it usually take for the httpd.conf file to be applied.
 
Old 04-04-2004, 07:32 PM   #4
artistikone
Member
 
Registered: Jul 2003
Distribution: slackware-current
Posts: 76

Rep: Reputation: 15
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
 
Old 04-05-2004, 06:50 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,420

Rep: Reputation: 198Reputation: 198
There is also a directive somewhere, in UserDir I think
which enables you to turn off the ability to get a directory
listing.
 
Old 04-05-2004, 09:33 AM   #6
TexasDex
Member
 
Registered: Feb 2003
Location: The Attic. Nowhere near Texas.
Distribution: Gentoo, Kubuntu, formerly LFS, SuSE, and RedHat
Posts: 133

Original Poster
Rep: Reputation: 15
/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.
 
  


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 does not open index.html ekinox Linux - Software 15 05-01-2005 01:21 PM
changeing default document from index.html in apache thebover Linux - Software 3 03-30-2005 10:26 PM
How to change the default index.html in Apache bngrhl Linux - Newbie 2 06-08-2004 02:47 PM
Cant find apache index.html LinuxBlackBox Linux - Software 4 11-17-2003 11:35 AM
In apache, i want to set my default page to be index.html, or something thep Linux - Newbie 3 04-17-2001 03:27 AM


All times are GMT -5. The time now is 05:18 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