wierd error with localhost on apache 2?

So I started Up apache via /etc/init.d/apache2 start and it started fine how ever going to localhost gave me:

Access forbidden!

You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403
Thu Apr 21 22:24:17 2011
Apache/2.2.17 (Linux/SUSE)


It is exactly as it says.

Is that directory (carefully unnamed by you so that we have to talk in vague terms like “that directory” readable by the Apache process? Normaly the Apache process runs as user wwwrun. Check that and use an

ls -l "server-root"/"that directory"

to check if wwwrun can read from it and search in it. (Not only “that directory”, but also all the directories leading to it in the path must be readable/serachable of course).

Then, when you have just a directory and not a file as URL, the server must take a decision what to show and you as web-master has to configure that decision (remember computer programs have no own initiative). Thus you either have a file like* index.html* there, or failing that, you have to configure that “directory listing” is allowed in that directory. In the first case it will show the “that directory”/index.html page, in the second case it will show a page with a listing of what is in that directory. Failing at least one of those these two being done, it will show the error.

Annd as an afterthought: when you want Apache not only to run for some test but want to have it running “allways” and doing so from boot, you better go to YaST > System > System services (runlvel) and switch it on there. This cares for everything.