Results 1 to 8 of 8

Thread: Localhost problems

  1. #1
    Join Date
    May 2008
    Location
    WI
    Beans
    15
    Distro
    Ubuntu 8.04 Hardy Heron

    Localhost problems

    I'm trying to develop my own personal website using mySQL and php. Everything was starting out ok, then one day my loopback address started not working. I got that restarted, but ever since then, I cannot connect to sites on localhost, i.e., phpmyadmin or even my basic "hello world" page. Any help would be appreciated.

    Thanks in advance,

    Brian

  2. #2
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Localhost problems

    Post your /etc/hosts file - and results of ifconfig -a.
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  3. #3
    Join Date
    May 2008
    Location
    WI
    Beans
    15
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Localhost problems

    Post your /etc/hosts file - and results of ifconfig -a.

    /etc/hosts:
    27.0.0.1 localhost

    # 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

    ifconfig -a:
    eth0 Link encap:Ethernet HWaddr 00:19:21:32:1b:3a
    inet addr:192.168.1.67 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::219:21ff:fe32:1b3a/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:60280 errors:0 dropped:0 overruns:0 frame:0
    TX packets:16506 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:8386664 (8.3 MB) TX bytes:7031122 (7.0 MB)
    Interrupt:220 Base address:0xc000

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:120 errors:0 dropped:0 overruns:0 frame:0
    TX packets:120 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:6000 (6.0 KB) TX bytes:6000 (6.0 KB)

    Thanks!
    Brian

  4. #4
    Join Date
    Feb 2006
    Beans
    5,714

    Re: Localhost problems

    have you tried restarting Apache?

    Code:
    sudo /etc/init.d/apache2 restart
    Debian Testing(64bit) + XFCE4 AM2 5200+ ATI Radeon HD4350, 4gig RAM,320Gig and 750gig HDs

    what's the difference between an answer and a solution? An answer is what they want to hear, a solution is what they don't want to hear

  5. #5
    Join Date
    Feb 2006
    Location
    Adelaide, South Australia
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Localhost problems

    Quote Originally Posted by wafflcommish View Post
    Post your /etc/hosts file - and results of ifconfig -a.

    /etc/hosts:
    27.0.0.1 localhost

    # 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

    ifconfig -a:
    eth0 Link encap:Ethernet HWaddr 00:19:21:32:1b:3a
    inet addr:192.168.1.67 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::219:21ff:fe32:1b3a/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:60280 errors:0 dropped:0 overruns:0 frame:0
    TX packets:16506 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:8386664 (8.3 MB) TX bytes:7031122 (7.0 MB)
    Interrupt:220 Base address:0xc000

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:120 errors:0 dropped:0 overruns:0 frame:0
    TX packets:120 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:6000 (6.0 KB) TX bytes:6000 (6.0 KB)

    Thanks!
    Brian
    27.0.0.1 localhost should be 127.0.0.1 I'm assuming you just cut it accidentally in the paste though right?
    Linux Mint 8 64 Bit | Intel Core 2 Duo CPU E8500 @ 3.80GHz (OC) | 4GB Kingston RAM | Asus P5Q Delux Motherboard | Asus EN9800GT (NVIDIA) | WD 120GB / WD 720GB SATA2 HDDs

  6. #6
    Join Date
    Jul 2008
    Location
    Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Localhost problems

    Quote Originally Posted by wafflcommish View Post
    /etc/hosts:
    All looks fine, except that your hostname is not mentioned in /etc/hosts. Is your /etc/hostname OK ?

    Can you change /etc/hosts into this :
    Code:
    # /etc/hosts
    127.0.0.1	localhost
    127.0.1.1	ubuntu-desktop
    
    # 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
    Where the "ubuntu-desktop" part is the hostname you should have in /etc/hostname.

  7. #7
    Join Date
    May 2008
    Location
    WI
    Beans
    15
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Localhost problems

    Ok, after adding the "localhost" line I can now get at "localhost" sites, thanks! However I have another question. When I enter "sudo /etc/init.d/apache2 restart", I get the following:

    sudo: unable to resolve host server1
    * Restarting web server apache2 [Sun Apr 05 13:37:55 2009] [warn] The Alias directive in /etc/phpmyadmin/apache.conf at line 3 will probably never match because it overlaps an earlier Alias.
    apache2: apr_sockaddr_info_get() failed for server1
    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    ... waiting [Sun Apr 05 13:37:56 2009] [warn] The Alias directive in /etc/phpmyadmin/apache.conf at line 3 will probably never match because it overlaps an earlier Alias.
    apache2: apr_sockaddr_info_get() failed for server1
    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    [ OK ]
    So it runs, but is not perfectly clean. Any ideas? Thanks again.

  8. #8
    Join Date
    Feb 2006
    Beans
    5,714

    Re: Localhost problems

    not sure on the alias issue but for the 127.0.0.1 for the servername

    taken from http://www.webune.com/forums/how-to-...-name-t23.html

    you have to edit the /etc/apache2/apache2.conf and, at the end of the file, add:

    # added servername to avoid the could not determine fqdn error
    servername myserver

    place your server name in place of myserver.

    (post #5)
    Debian Testing(64bit) + XFCE4 AM2 5200+ ATI Radeon HD4350, 4gig RAM,320Gig and 750gig HDs

    what's the difference between an answer and a solution? An answer is what they want to hear, a solution is what they don't want to hear

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
  •