LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-15-2005, 08:54 PM   #1
nebloof
Member
 
Registered: May 2004
Distribution: Slackware Current
Posts: 40

Rep: Reputation: 16
Apache problem - cannot get index.html file to show


I've got apache running on Slackware 9.1, go to localhost and I get the apache test page. I created a web folder to host webpages off of at /usr/web, and edited the httpd.conf file in these places:
...
DocumentRoot "/usr/web"
...
<Directory "/usr/web">
...
DirectoryIndex /usr/web/index.html

so what happens is if I type localhost, I get a directory listing.
if I type localhost/index.html, it'll display the page.

so I tried editing options in httpd.conf, by removing Indexes:
...
Options FollowSymLinks MultiViews

then when I try to view the page at localhost, it displays:
403 Forbidden
You don't have permission to access / on this server.

In this case, the error log has an entry:
[Sat Jan 15 21:35:07 2005] [error] [client 127.0.0.1] Directory index forbidden by rule: /usr/web/

but, again, if I type: localhost/index.html, it displays the page just fine.

So what I'm asking is, how do a simply make the F$#$ING thing display the index.html page by simply typing localhost.

I assumed that by placing index.html in /usr/web specified in DocumentRoot, Directory, and DirectoryIndex, that it would display that index page. Am I wrong? does the index.html file need to go somwhere else?
 
Old 01-15-2005, 09:06 PM   #2
dcostakos
Member
 
Registered: Aug 2004
Posts: 44

Rep: Reputation: 15
Firstly, the DirectoryIndex directive doesn't go inside a <Directory> tag.

Move it out. You should have a line like this at the same level as the "DocumentRoot" directive.

DirectoryIndex index.html index.htm index.cgi ...

Also, your Apache needs mod_dir.c compiled in. It most likely is since it is by default. You can tell by running "./httpd -l" to list the compiled in modules on your system.

Lastly, the <Directory> tag requires "Options Indexes" added. I believe you noted this already.

Hope this helps.
 
Old 01-15-2005, 09:44 PM   #3
nebloof
Member
 
Registered: May 2004
Distribution: Slackware Current
Posts: 40

Original Poster
Rep: Reputation: 16
still doesn't work

first, thanks for the reply, because I know there are tons of posts about apache.

I made the changes you mentined, but I still get a directory list instead of my index.html file:

Index of /

Parent directory ...
index.html...

is there something else I need to change in httpd.conf? I suppose I can leave it like that, if you click on the index.html link, THEN it will display the page, but I would like for this to work the "correct" way.
 
Old 01-15-2005, 10:32 PM   #4
nebloof
Member
 
Registered: May 2004
Distribution: Slackware Current
Posts: 40

Original Poster
Rep: Reputation: 16
wow, after three hours...

I decided to try changing DirectoryIndex from /usr/web/index.html to index.html, and it finally works...

note:
before this, I was trying to change permissions for a folder, I accidentally did chmod -755 /. Well, this trashed file permissions for a LOT of linux system files and folders, so after some time, I decided to reboot the computer, and it complained about the file permissions being too free, and linux didn't start, so I did a reinstall (it had a relatively fresh install of linux before).

Anyway, before all that, I PROMISE that with DirectoryIndex set to index.html, it was taking me to that retarded apache test page. Oh well, it works now.
 
  


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 is skipping index.html spicychicken Linux - Software 1 02-15-2005 01:25 AM
Konqueror + file:/usr/share/doc/HTML/index.html jon_k Linux - Software 2 11-25-2003 05:06 AM
Cant find apache index.html LinuxBlackBox Linux - Software 4 11-17-2003 10:35 AM
Apache 2.0 search for index.html file pawlub Linux - Software 2 10-28-2003 10:03 AM
Red Hat Linux 8 Apache index.html file muhammade Linux - General 10 02-11-2003 11:30 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration