Search code examples
lampcherrypy

How can I serve requests to one Apache controlled directory to standalone CherryPy?


I have an existing web application in a sub folder such as domain.com/myapp/.

I wish to replace this with a CherryPy app running it's standalone server, whilst not affecting other web apps running via Apache on the same domain.

How can I do this on a LAMP stack?

Can I symlink the folder to the CherryPy root or such?


Solution

  • Assuming your domain.com is served by a single Apache instance you can configure a Proxy/ReverseProxy pair to your standalone CherryPy application. It should be something like:

    ProxyPass         /myapp  http://localhost:8080/myapp
    ProxyPassReverse  /myapp  http://localhost:8080/myapp
    

    Assuming your myapp server runs on localhost on port 8080.