简体   繁体   中英

Cherrypy application running on apache server getting socket errors

When trying to launch a cherrypy website on an Apache server, no matter what port I select, I always get an error saying: "No socket could be created".

I used netstat to verify the port I am trying to connect to is listening. Is there some sort of configuration necessary to get the application to run on an Apache server? I have very little experience with cherrypy or Apache.

Cherrypy is a framework for handling http-requests - it's actually designed to run as a standalone webserver. Thus it has overlapping functionality with apache, and you have to make a choice:

  1. Skip cherrypy and let apache load your python script using mod_python . This will allow apache to run your python code very fast, without the overhead of cgi. Apache will call the handler(req) function in your code, and hand you all the request info via req . Django uses this approach.
  2. Keep both, but let apache handle the listening, and define your port in the apache config file (ie httpd.conf). Then read more about cherrypy behind apache
  3. Skip apache and use cherrypy as a standalone web server

I have good experience with 1, but all of them should be fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM