CherryPy 3.2.2 behind Apache: No socket could be created

736 views
Skip to first unread message

cpcanta...@gmail.com

unread,
Jun 27, 2013, 7:33:13 AM6/27/13
to cherryp...@googlegroups.com
I have followed CherryPy Essentials to build up an app behind Apache with mod_python,
but I have the following error:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/CherryPy-3.2.2-py2.6.egg/cherrypy/process/servers.py", line 187, in _start_http_thread
    self.httpserver.start()
  File "/usr/lib/python2.6/site-packages/CherryPy-3.2.2-py2.6.egg/cherrypy/wsgiserver/wsgiserver2.py", line 1824, in start
    raise socket.error(msg)
error: No socket could be created

[27/Jun/2013:13:27:39] ENGINE Bus STOPPING
[27/Jun/2013:13:27:39] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 8080)) already shut down
[27/Jun/2013:13:27:39] ENGINE Stopped thread '_TimeoutMonitor'.
[27/Jun/2013:13:27:39] ENGINE Stopped thread 'Autoreloader'.
[27/Jun/2013:13:27:39] ENGINE Bus STOPPED
[27/Jun/2013:13:27:39] ENGINE Bus EXITING
[27/Jun/2013:13:27:39] ENGINE Bus EXITED

I have tried to change port to 9091 or others, and it is not working. "localhost" is not helping either.
It seems that the setup function in my code has been located correctly.
In google chrome I got Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

Any idea would be appreciated, thanks
Carlos

Sylvain Hellegouarch

unread,
Jun 28, 2013, 5:38:08 AM6/28/13
to cherryp...@googlegroups.com
Hi Carlos,


Unfortunately, I would discourage you from using mod_python. It's been a dead project for years now. The book is dating as well sadly. Rather you should use mod_wsgi or a reverse_proxy module (my favourite option).


--
- Sylvain
http://www.defuze.org
http://twitter.com/lawouach

cpcanta...@gmail.com

unread,
Jun 28, 2013, 6:00:47 AM6/28/13
to cherryp...@googlegroups.com
Sylvain,

I have finally created an apache conf.d file like:

ProxyPassReverse /myapp http://127.0.0.1:9091/myapp

And it works. Apache serves everything except /myapp (there are other apps in this server, done in php, perl, ...)
However, I have had to change all css, images, etc links
with /myapp prefix.
Maybe I am missing something, but with my ignorance about both Apache and CherryPy
is the best solution I have achieved.

Thank you for your advice
Reply all
Reply to author
Forward
0 new messages