Error 403 when trying to run CherryPy for Apache

I am trying to run CherryPy for Apache using mod_rewrite as described in the CherryPy documentation ( BehindApache , ModRewrite ) and it does not work.

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

When I run my program (a very simple hello world program, similar to the first training file that comes with CherryPy), it works fine. If I run curl "http://127.0.0.1:8080"from my server, I will see the output, and I see its entry in the CherryPy log.

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

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

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

[ 27 13:31:54 2010] [] [ 123.45.67.89] : : http://127.0.0.1: 8080/

CherryPy.

, , CherryPy, . Apache CherryPy, httpd.conf , .htaccess.

- , , ? , . DreamHost Debian 4.3.2-1.1, Apache 2.2.15, Python 2.6.5 CherryPy 3.1.2.

2: lazy1, , . 403 .

+3
2

CherryPy Apache . Apache , URL-, 'cp', CherryPy. CherryPy 8500. httpd.conf:

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

VirtualHost (, RewriteMap , )

, , mod_proxy . RewriteRule.

CherryPy :

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

!

+4

, cherrypy 0.0.0.0 ( )

    cherrypy.config.update({"server.socket_host" : "0.0.0.0"})
0

Source: https://habr.com/ru/post/1766848/


All Articles