擅长:python、mysql、java
<p>我在Apache后面运行CherryPy的方式非常相似。Apache本身提供静态内容,任何以“cp”开头的url都由CherryPy提供服务。CherryPy在8500端口监听。以下是对我有用的httpd.conf公司名称:</p>
<pre><code>RewriteMap escape int:escape
[...]
RewriteRule ^/cp\/(.*) http://localhost:8500/cp/${escape:$1} [L,P]
</code></pre>
<p>这是在VirtualHost定义内(好吧,RewriteMap行在它外面,但是您可以看到图片)</p>
<p>显然你必须确保mod_proxy正在加载。同时检查<a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule" rel="nofollow">RewriteRule documentation</a>。在</p>
<p>在我的CherryPy配置中,我有:</p>
^{pr2}$
<p>祝你好运!在</p>