can't access localhost

running 11.1 with Lamp pkg installed. cannot access localhost at all, but can access all other web sites. any suggestions sure appreciated. Linux newbie and trying hard!!

many thanks

Does /etc/hosts contain this line: localhost

Do you have the Apache web server running?

yes apache is running. problem seems to be - no /etc/hosts file.
how do i create one?

Normally /etc/hosts should be there. If it doesn’t exist, you may have a faulty installation which might give problems in other areas. You should look into that.

Anyway for this problem, all you need is this line in /etc/hosts: localhost

which you can add with a text editor (as root, of course). And the file must be publicly readable, so do

chmod 644 /etc/hosts

after editing it.

yes i think you are right. will do a re-install ad see what happens

many thanks for help!!!

Hi i cant access localhost either i have check etc/hosts and i have localhost

in that file here is error in error_log
[Mon Feb 23 16:19:14 2009] [error] [client] Directory index forbidden by Options directive: /srv/www/htdocs/

ok i found this
By default directory indexing is turned off in Apache2 on OpenSUSE.

by when i try and call http://localhost/index.php it ask me to open or save the file ???

I have the apache 2 php mod installed


ok i found this To set up basic Apache server, go to Yast → Network Services, activate “HTTP Server”
but i dont have that in network services

update for some strange reason after starting apache on the 5th time it now works

                                                 NOT SOLVED - now it is a new problem!

It has work for years and now, with a Leap 42.1 update:
With Leap 42.1 every morning I have to run Yast as above to get localhost to operate.and the next morning Apache2 is failing again! It was fine until a recent update to the Apache 2 code!

This is a seven year old thread, please start a new thread.