LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache problem - cannot get index.html file to show (https://www.linuxquestions.org/questions/linux-software-2/apache-problem-cannot-get-index-html-file-to-show-278264/)

nebloof 01-15-2005 08:54 PM

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?

dcostakos 01-15-2005 09:06 PM

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.

nebloof 01-15-2005 09:44 PM

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.

nebloof 01-15-2005 10:32 PM

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.


All times are GMT -5. The time now is 06:53 AM.