Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Unable to access localhost

  1. #11
    Join Date
    Sep 2007
    Location
    Olympia, Washington
    Beans
    548
    Distro
    Ubuntu

    Re: Unable to access localhost

    I would agree with both of you regarding the need for only 1 host. However, this is an ongoing issue with my server. Everything works great aside from the inability to access via localhost.

    I changed the /etc/hosts file to include only localhost 127.0.0.1, restarted the computer, and my apache failed to serve my web site. I tried many variations, changing the hostname to localhost, 127.0.0.1, and the current name. Each time a change was made, I restarted my box. Nothing.

    Quite odd. There must be some line in some file that is not quite right. Baffling to me.
    ~Mark
    http://nwlinux.com - tech blog

  2. #12
    Join Date
    Oct 2007
    Beans
    89

    Re: Unable to access localhost

    It's likely that apache's not starting because it can't resolve your hostname (set in your apache config) when you changed resolv.conf. You'll need to make sure that both localhost and the fqdn are resolvable....

    The other option is, comment out mod_unique_id loading in your apache configuration.
    Last edited by Zeosa; October 20th, 2008 at 04:04 AM.

  3. #13
    Join Date
    Sep 2007
    Location
    Olympia, Washington
    Beans
    548
    Distro
    Ubuntu

    Re: Unable to access localhost

    Apache has always ran perfectly with my current configuration. I simply cannot access my pages or other port associated programs attached to the domain using my buckyspalace.net domain.
    ~Mark
    http://nwlinux.com - tech blog

  4. #14
    Join Date
    Nov 2006
    Location
    Belgium
    Beans
    3,023
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Unable to access localhost

    For apache to work correctly, i.e serve pages to your browser, you need two things
    1- a correct network configuration,
    2- a correct apache configuration.

    So far you haven't even accomplished step 1, and adding wild guesses and plainly incorrect entries to /etc/hosts (like 127.0.0.1 buckyspalace thing or "router ip" localhost ) is not going to make it any better. It's just going to make troubleshooting harder.

    For starters, you complain that apache doesn't work when you appoach it with a fqdn, but there is no fqdn in your hosts file, so unless your resolv.conf solves that by forwarding to a publiek dns or appending a domain name, there's now way that can work.

    try something like this in /etc/hosts:
    Code:
    127.0.0.1 localhost
    123.123.123.123 buckyspalace.net buckyspalace
    replace 123.123.123.123 with the actual IP address of your web server - not your router address or anything like that.

    do a "ping buckyspalace.net" and see if it resolves to the correct address. Assuming you're behind a NAT router, that should be a private address, not (your router's) public address.

    Oh, and there's little use in obfuscating your addresses (the "router ip" part in /etc/hosts, e.g.) if they are in public DNS (does 24.18.97.15 look familiar ?) so if things don't work with the changes described here, post your
    - /etc/resolv.conf
    - /etc/hosts
    without modifications, so we can actually see where the problem is.

    Once you have this working correctly, it's merely a matter of making sure Apache is configured correctly (Server Name, Document Root, Listen Address, ...) and that the permissions on the files are correct.

  5. #15
    Join Date
    Sep 2007
    Location
    Olympia, Washington
    Beans
    548
    Distro
    Ubuntu

    Re: Unable to access localhost

    Ok, let me try the items that you indicated. I edited my /etc/hosts file to read:
    Code:
    127.0.0.1 localhost
    24.18.97.15 buckyspalace.net buckyspalace
    
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts
    my /etc/resolv.conf reads:
    Code:
    # generated by NetworkManager, do not edit!
    
    search hsd1.wa.comcast.net.
    
    
    nameserver 68.87.69.146
    nameserver 68.87.85.98
    nameserver 68.87.78.130
    My ServerName is buckyspalace.net, the DocumentRoot is /var/www (seems to be fairly standard), and a listen port of 80.

    I omitted my router ip. the information is public information, but there is no use to advertise for those who do not know how to get it. I get your point though...

    After changing my /etc/hosts file to what you recommended, I restarted my box. My server still times out on http://localhost/.
    ~Mark
    http://nwlinux.com - tech blog

  6. #16
    Join Date
    Nov 2006
    Location
    Belgium
    Beans
    3,023
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Unable to access localhost

    just so we know that we're talking about the same thing :
    your running an apache server on a desktop system, where run a browser that, when pointed to http://localhost, times out, right ?

    this is what you should get when pinging localhost :
    Code:
    k@nix:~$ ping localhost
    PING localhost (127.0.0.1) 56(84) bytes of data.
    64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.048 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.042 ms
    ...
    what do you get ?

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

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