Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1112403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:42:14+00:00 2026-05-17T02:42:14+00:00

I am trying to run CherryPy behind Apache using mod_rewrite, as described in the

  • 0

I am trying to run CherryPy behind Apache using mod_rewrite, as described in the CherryPy documentation (BehindApache, ModRewrite), and it is not working.

Edit: Earlier, my description of this problem was somewhat inaccurate. It seems like I forgot to restart Apache during some of my attempts. I have revised the question significantly.

When I run my program (a very simple “hello world” program similar to the first tutorial file that comes with CherryPy), it seems to work fine. If I run curl "http://127.0.0.1:8080" from my server, I can see the output, and I see some sort of record of it in the CherryPy log.

However, if I try to access the site from my browser, I get a 403 Forbidden error saying “You don’t have permission to access / on this server.”. I do not see any record of it in the CherryPy log. I tried putting the RewriteRule (RewriteRule ^(.*) http://127.0.0.1:8080$1 [proxy]) in the appropriate VirtualHost section of my httpd.conf file, both with and without the slash, and both times I got the same error. In my Apache error log, I see lines like this:

[Mon Sep 27 15:54:11 2010] [error] [client 123.45.67.89] attempt to make remote request from mod_rewrite without proxy enabled: proxy:http://127.0.0.1:8080/

I tried putting the RewriteRule in the .htaccess file of my site instead, and I got 404 Not Found errors, with lines like this in my error log:

[Mon Sep 27 13:31:54 2010] [error] [client 123.45.67.89] Attempt to serve directory: proxy:http://127.0.0.1:8080/

I still didn’t see any entries in the CherryPy log.

I decided to see what would happen if I tried to access the site without CherryPy running, and I got the same thing. It is as if Apache is trying unsuccessfully to communicate with the CherryPy program if I put the line in httpd.conf, and completely unaware of it when I put the line in .htaccess.

Does anyone here know why this is happening, and what to do about it? I have tried everything I could think of. My site is running on a DreamHost private server with Debian 4.3.2-1.1, Apache 2.2.15, Python 2.6.5, and CherryPy 3.1.2.

Edit 2: lazy1, I tried your suggestion and it did not help. I am getting the same 403 errors.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:42:15+00:00Added an answer on May 17, 2026 at 2:42 am

    I run CherryPy behind Apache in a very similar way. Apache serves static content itself, and any URLs starting with ‘cp’ are servied by CherryPy. CherryPy is listening on port 8500. Here’s what works for me in httpd.conf:

    RewriteMap escape int:escape
      [...]
    RewriteRule ^/cp\/(.*) http://localhost:8500/cp/${escape:$1} [L,P]
    

    This is inside the VirtualHost definition (well, the RewriteMap line is outside it, but you get the picture)

    Obviously you have to make sure mod_proxy is getting loaded. Check the RewriteRule documentation as well.

    In my CherryPy config, I have:

    server.socket_host = "127.0.0.1"
    server.socket_port = 8500
    

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to run a website using Python 2.7.1, Jinja 2.5.2, and CherryPy
Trying to run a java test using bluecove, I got: Native Library bluecove_x64 not
I am trying to transfer from Cherrypy to Bottle & Gevent(server). After I run:
When trying to run an Eclipse Dynamic Web Project under a Tomcat setup using
I am trying run Apache web server on my computer without success, and I
I'm trying to test cherrypy framework by using example from their site: import cherrypy
I am trying to run Bottle on top of Cherrypy's server. I want to
Trying to run the Blocking Queue example given here . Using the .NET Queue
I am trying run a program from a qmake .pro file which modifies the
Situation: I'm trying run an https store (xcart) under one domain secure.example.com and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.