Feisty, can't connect to localhost

Nils Kassube kassube at gmx.net
Sat Jul 21 20:44:54 UTC 2007


Dan Stieg wrote:
> I am trying to set up apache. I installed both apache and apache2 and
> am unable to connect to localhost through Firefox or telnet. I added
> port 80 to iptables. sudo telnet localhost gives:
>
> Trying 127.0.0.1...
> telnet: Unable to connect to remote host: Connection refused

Depending on the port you want to connect there must be a server 
listening. If you want to connect to your apache on port 80 you should 
first check, if there is a service listening on port 80:

netstat -tan | grep 80

The output should look like this:

tcp  0 0 0.0.0.0:80  0.0.0.0:*  LISTEN

If it isn't running, you should first find out what's wrong with it. If 
you can see there is a server listening, you can type

telnet localhost 80

to test the connection to your apache. Or you could just connect with your 
browser to <http://localhost>.

BTW: With the command you mentioned, telnet tried to connect to the 
standard port for telnet (23), but you should not have a telnetd running. 
And you don't need sudo to start telnet -- but it doesn't hurt :)


Nils




More information about the ubuntu-users mailing list