Results 1 to 6 of 6

Thread: Apache2 localhost not available when no internet connection

  1. #1
    Join Date
    Jun 2010
    Beans
    3

    Unhappy Apache2 localhost not available when no internet connection

    Dear All,

    I am a new comer to Ubuntu, but during the last few months, I have enjoyed it very much.

    I am running the version 10.4. As I am learning mySQL and PHP, I installed Apache2, mySQL and PHP, as discribed in this link.

    The problem is I have to have any sort of Network, either LAN, WiFi or Mobile Broadband to access my localhost. When I am connected to internet, my local host works fine, without any problem, but as soon as I get disconnected from internet, localhost is not available.

    I have googled a lot, but could not find a solution.

    A help will be greatly appreciated.

    Thanks in advance

  2. #2
    Join Date
    Oct 2006
    Location
    Old Europe
    Beans
    859

  3. #3
    Join Date
    Jun 2010
    Beans
    3

    Smile Re: Apache2 localhost not available when no internet connection

    Dear eggdeng,

    Thank you very much for the answer. I followed that and now I can access localhost even when I am not connected to internet through firepox. It solved the problem, but I will be glad if anyone can resolve the actual issue as it still do not work with google chrome, and I have addicted to chrome.

  4. #4
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,505
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Apache2 localhost not available when no internet connection

    Quote Originally Posted by buddhika75 View Post
    Dear All,

    I am a new comer to Ubuntu, but during the last few months, I have enjoyed it very much.

    I am running the version 10.4. As I am learning mySQL and PHP, I installed Apache2, mySQL and PHP, as discribed in this link.

    The problem is I have to have any sort of Network, either LAN, WiFi or Mobile Broadband to access my localhost. When I am connected to internet, my local host works fine, without any problem, but as soon as I get disconnected from internet, localhost is not available.

    I have googled a lot, but could not find a solution.

    A help will be greatly appreciated.

    Thanks in advance
    Manually add the loopback entries to the /etc/network/interfaces file:

    Code:
    auto lo
    iface lo inet loopback
    and /etc/hosts should contain:
    Code:
    127.0.0.1	localhost
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  5. #5
    Join Date
    Jun 2010
    Beans
    3

    Cool Re: Apache2 localhost not available when no internet connection

    Dear Devid,

    My /etc/network/interfaces file already had those lines.

    My /etc/hosts files contain these lines

    127.0.0.1 localhost
    127.0.1.1 buddhika-laptop

    # The following lines are desirable for IPv6 capable hosts
    ::1 localhost ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts


    buddhika-laptop is my computer name. So I had nothing to change, I suppose.

    Thank you,

    Hoping a favorable replay,

    Buddhika

  6. #6
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,505
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Apache2 localhost not available when no internet connection

    Quote Originally Posted by buddhika75 View Post
    Dear Devid,

    My /etc/network/interfaces file already had those lines.

    My /etc/hosts files contain these lines

    127.0.0.1 localhost
    127.0.1.1 buddhika-laptop

    # The following lines are desirable for IPv6 capable hosts
    ::1 localhost ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts


    buddhika-laptop is my computer name. So I had nothing to change, I suppose.

    Thank you,

    Hoping a favorable replay,

    Buddhika
    If you can ping localhost when there is no connection then it should work.

    Try setting a Static IP address.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

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
  •