Could not connect to host localhost

Asked by LindseyD.

Just installed Kubuntu Hardy. I can't configure either Polipo or Wwwoffle, or install a printer. When I try to access the pages for Polipo or Wwwoffle, or CUPs (all of which use localhost and a port number) I get Could not connect to host localhost.

I suspect, therefore, that these problems are related. In KDE, the Add Printer menu item doesn't work at all. The Wizard won't launch.

I did, a few days ago, manage to install the printer in Gnome, but it will not print. The Print button is greyed out.

Furthermore, following a suggestion to "Right click, KDE panel -> Configure Panel... -> Menus -> check Print System -> OK. This will put a Print System folder in the Main menu" this operation changed the networkmanager icon to offline mode. Since I'm on dialup it didn't affect my connection to the internet. But it suggests that somehow printing and networking are related. Since I am the only user on only one machine, with a hardware modem, I don't even know what the networkmanager does.

Here is the entirety of my localhosts file:

127.0.0.1 localhost
127.0.1.1 darren

# 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

I hope this is sufficient information. Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
LindseyD.
Solved:
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

Not directly related but try this... https://answers.launchpad.net/ubuntu/+faq/93

HTH

Revision history for this message
LindseyD. (ai279) said :
#2

Thanks for the tip. My /etc/hosts now reads:

127.0.0.1 localhost darren
127.0.1.1 darren

# 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

And I rebooted, but ...

Reading the man page for wwwoffle in Konqueror, I clicked on the url and got:

An error occurred while loading http://localhost:8080/control/:
Could not connect to host localhost (port 8080).

Then, just for variety, entered http://localhost:631 into Firefox and got:

Firefox can't establish a connection to the server at localhost:631

I tried this in both online and offline mode using the knetworkmanager icon.

Oops! I've just noticed that when you mouse over the knetworkmanager icon, it *always* says Offline Mode currently active, whatever the icon looks like. Could that be part of the problem?

Revision history for this message
LindseyD. (ai279) said :
#3

I *finally* solved it.

My /etc/hosts *should* read (and now does)

127.0.0.1 localhost.localdomain localhost darren