"Connection Refused" Error For CherryPy Apps

2,342 views
Skip to first unread message

jonathansamuel

unread,
Jun 10, 2008, 11:42:52 PM6/10/08
to cherrypy-users
I have attempted to run several tutorial applicatons on my server. In
every case the apps run fine as long as I access them from that same
server using http://127.0.0.1:8080

However, when I try to access my apps using my domain name, even from
my server itself I receive the following error:

Resolving goodbyebrian.com... 64.34.193.89
Connecting to goodbyebrian.com|64.34.193.89|:8080... failed:
Connection refused.

I have verified that Apache is not listening on port 8080, and that
nothing else is using that port.

Other domain names on my server which use this IP address work fine. I
use the current Cherrypy and Centos 4.6 with Python 2.4.4.

Does anyone know why I receive this error, and what I can do about it?

Sylvain Hellegouarch

unread,
Jun 11, 2008, 9:31:16 AM6/11/08
to cherryp...@googlegroups.com
Probably your OS supports IPv6 and therefore binds the CP server on a IPv6
address.

To ensure it's not the case, force IPv4:

cherrypy.config.update({'server.socket_host': '127.0.0.1'})

Before you start the server.

- Sylvain


--
Sylvain Hellegouarch
http://www.defuze.org

Robert Brewer

unread,
Jun 11, 2008, 12:25:31 PM6/11/08
to cherryp...@googlegroups.com
Sylvain Hellegouarch wrote:

> jonathansamuel wrote:
> > I have attempted to run several tutorial applicatons on my server.
In
> > every case the apps run fine as long as I access them from that same
> > server using http://127.0.0.1:8080
> >
> > However, when I try to access my apps using my domain name, even
from
> > my server itself I receive the following error:
> >
> > Resolving goodbyebrian.com... 64.34.193.89
> > Connecting to goodbyebrian.com|64.34.193.89|:8080... failed:
> > Connection refused.
>
> Probably your OS supports IPv6 and therefore binds the CP server on a
> IPv6 address.
>
> To ensure it's not the case, force IPv4:
>
> cherrypy.config.update({'server.socket_host': '127.0.0.1'})
>
> Before you start the server.

I'm not sure that's the problem--if he wants to expose the server to the
world, the local address (127.0.0.1) won't cut it. Try
server.socket_host: '0.0.0.0' instead to listen on all addresses.


Robert Brewer
fuma...@aminus.org

Sylvain Hellegouarch

unread,
Jun 11, 2008, 12:41:13 PM6/11/08
to cherryp...@googlegroups.com
Robert Brewer a écrit :

Good point Bob.

- Sylvain

jonathansamuel

unread,
Jun 11, 2008, 6:43:39 PM6/11/08
to cherrypy-users
Robert and Sylvain's solution fixed the problem.

It is a joy to be able to receive such expert advice. I have and use
Sylvain Hellegouarch's excellent book CherryPy Essentials.

Reply all
Reply to author
Forward
0 new messages