Results 1 to 9 of 9

Thread: can't access localhost

  1. #1

    Question 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

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: can't access localhost

    Does /etc/hosts contain this line:

    127.0.0.1 localhost
    Do you have the Apache web server running?

  3. #3

    Default Re: can't access localhost

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

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: can't access localhost

    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:

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

    Code:
    chmod 644 /etc/hosts
    after editing it.

  5. #5

    Default Re: can't access localhost

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

    many thanks for help!!!

  6. #6
    smskinner NNTP User

    Default Re: can't access localhost

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

    in that file here is error in error_log
    [Mon Feb 23 16:19:14 2009] [error] [client 127.0.0.1] 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

    Steve

  7. #7
    smskinner NNTP User

    Default Re: can't access localhost

    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
    Last edited by smskinner; 23-Feb-2009 at 17:53. Reason: problem solved

  8. #8

    Default Re: can't access localhost

    Quote Originally Posted by smskinner View Post
    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!

  9. #9
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,674
    Blog Entries
    15

    Default Re: can't access localhost

    Quote Originally Posted by johnlb2002 View Post
    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!
    Hi
    This is a seven year old thread, please start a new thread.

    Closed.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •