# Cannot connect to localhost [SOLVED]

## szensz-siempre

I have been trying to configure cups on a new machine by trying 127.0.0.0/903 in konquerer but keep getting a message that I cannot connect to the server. 

If I run telnet I get the following:

```
telnet localhost 903

Trying 127.0.0.1...

telnet: Unable to connect to remote host: Connection refused
```

I can ping localhost and telnet directly

```
telnet localhost

Trying 127.0.0.1...

Connected to gentoo64

Escape character is '^]'.

Connection closed by foreign host.
```

My /etc/hosts looks as follows:

 *Quote:*   

> 127.0.0.1  gentoo64  localhost

 

I find that when I have the laptop at work I am able to ping the gateway on the network, but not outside of the gw. I don't know if this is related?

Anyone know what is the issue here??Last edited by szensz-siempre on Tue Jun 02, 2009 6:19 am; edited 1 time in total

----------

## Bircoph

 *szensz-siempre wrote:*   

> I have been trying to configure cups on a new machine by trying 127.0.0.0/903 in konquerer but keep getting a message that I cannot connect to the server. 
> 
> 

 

Why are you trying port 903?

631 is default for cupsd.

----------

## depontius

For CUPS I point my browser at "http://localhost:631/".

----------

## szensz-siempre

Sorry, also fighting with vmware, hence the 903 port. You are correct, 631 is the default for cups, but it still returns the same error. I get connection to server refused in konquerer and connection refused with telnet.

Any ideas where I can start looking for the problem?

----------

## Inodoro_Pereyra

Some firewall runing may be?

Cheers!

----------

## timeBandit

 *szensz-siempre wrote:*   

> Any ideas where I can start looking for the problem?

 First, verify services are indeed running and listening for connections on the expected ports. Please post the output of:

```
netstat -lpnt
```

----------

## szensz-siempre

Thanks for all the replies,

I have not configured any firewalls yet, I wanted to get the network working first

The output of netstat -lpnt:

 *Quote:*   

> Active Internet connections (only servers)
> 
> Proto    Recv-q    Send-Q    Local Address    Foreign Address    State        PID/Program name
> 
> tcp                0            0     0.0.0.0:23         0.0.0.0:*              LISTEN     5048/xinetd

 

----------

## szensz-siempre

**szensz-siempre slaps himself on the back of the head**   :Embarassed: 

the cups service wasn't started. Entered in 

```
/etc/init.d/cupsd start
```

and then I can connect to the cups admin from my browser.

Thanks for the help guys.

----------

