Note that there are some explanatory texts on larger screens.

plurals
  1. PORunning 2 CherryPy instances on the same machine
    primarykey
    data
    text
    <p>I am running CherryPy as a webserver on a remote Linux machine. End users access a website over the internet which the CherryPy instance serves. So far, so good.</p> <p>Now, I want to have a dev version of the site, running on the same machine but on a different port, so that I can develop and test without disturbing the prod website. I need to do development on the same machine because it contains a lot of data which would not be practical to move to a different machine.</p> <p>The code for the dev instance is in a different directory, of course, so as I edit the dev code it does not trigger a reload for the prod instance or affect the prod instance in any way.</p> <p>However, if I configure my dev instance to run on a different port than the prod instance and try to start up the dev instance, I get:</p> <pre><code>Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/cherrypy/process/wspbus.py", line 197, in publish output.append(listener(*args, **kwargs)) File "/usr/lib/python2.7/dist-packages/cherrypy/_cpserver.py", line 151, in start ServerAdapter.start(self) File "/usr/lib/python2.7/dist-packages/cherrypy/process/servers.py", line 167, in start wait_for_free_port(*self.bind_addr) File "/usr/lib/python2.7/dist-packages/cherrypy/process/servers.py", line 410, in wait_for_free_port raise IOError("Port %r not free on %r" % (port, host)) IOError: Port 8080 not free on '127.0.0.1' </code></pre> <p>Neither the dev nor prod instance are running on port 8080. The prod instance is on SSL (443) and the dev instance I can put on an arbitrary port (let's suppose it's on 98765). I haven't specified 8080 anywhere in any config file. So I didn't expect there to be a port conflict, However, it appears that for one instance, CherryPy spawns 2 processes- I guess there is some sort of parent-child relationship- and one of the processes is somehow listening on <code>localhost:8080</code>. Because this happens for both instances I try to launch, the second one is unable to launch because there ends up being this conflict on 8080.</p> <p>I have tried several things, such as turning off autoreloading and timeout monitoring, in the hopes that CherryPy would not launch the process associated with 8080, but no luck so far.</p> <p>Thanks in advance for any help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload