Chapter 18.2.2. Configuring Apache with mod_rewrite

Let’s assume that your CherryPy process is listening on port 80. All you have to do is tell Apache to forward requests to CherryPy. If you use mod_rewrite, this is done like this:

RewriteEngine on
RewriteRule ^(.*) http://127.0.0.1:8000$1 [P]

The equivalent with mod_proxy is this:

ProxyPass           /   http://localhost:2432/
ProxyPassReverse    /   http://localhost:2432/

For this to work, you have to make sure that the mod_rewrite or mod_proxy module is loaded (either dynamically, or statically linked when Apache was built). For more details about mod_rewrite or mod_proxy, refer to their documentation:

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.