Is there a way in python to change the port that cherrypy
is using and force the web server (not apache, cherrypy) to restart?
Have a look at cherrypy.process.servers. You can try something like this:
import cherrypy
cherrypy.config.update({'server.socket_port': 8099})
cherrypy.engine.restart()