Plone with Apache Proxy

守給你的承諾、 提交于 2019-12-20 05:29:07

问题


I have a plone zinstance set up through Apache Proxy on OS X Server 10.5. The server is set up with a single vhost on port 80, with Proxy & Proxypass directives to the Plone zinstance:

        ProxyPass / http://localhost:8080/VirtualHostBase/http/server:80/Plone/VirtualHostRoot/
        ProxyPassReverse / http://localhost:8080/VirtualHostBase/http/server:80/Plone/VirtualHostRoot/

However, I have some static HTML and PHP content that I want to display in an iframe via the plone site. I'm thinking I'll need to set up another vhost on a different port, then just specify the port # inline?


回答1:


Set up a static URL that will not be proxied but served from Apache directly, like this:

ProxyPass /static !
ProxyPass / http://localhost:8080/VirtualHostBase/http/server:80/Plone/VirtualHostRoot/
ProxyPassReverse / http://localhost:8080/VirtualHostBase/http/server:80/Plone/VirtualHostRoot/

Then configure /static to contain your static content.




回答2:


I'd recommend rolling your configuration into a virtual host block. You can deliver static content directly form apache by rewriting a specific path. Here's an example

<VirtualHost *:80>
  ServerName yoursite.com
  Alias /static /var/www/some/path/

  <Directory "/var/www/some/path">
    Options Includes FollowSymLinks
    AllowOverride All
  </Directory>

  # Zope rewrite.
  RewriteEngine On
  RewriteRule /static - [L]
  RewriteRule ^/(.*) http://127.0.0.1:8080/VirtualHostBase/http/%{SERVER_NAME}:80/Plone/VirtualHostRoot/$1 [L,P]
</VirtualHost>



回答3:


Sorry, not enough information but I'll offer a couple of comments that might help point you in the right direction.

First, ProxyPassReverse is unnecessary as Plone already takes care of fixing up any self-referential urls. That is the point of the crazy url after all.

Another poster already showed how to configure ProxyPass to selectively bypass the proxy to Plone and serve from Apache directly.

Regarding the "additional vhost on port 8888". It's not clear what you mean by this. What is the extra vhost serving? If it's where your static html and php content is supposed to come from then restricting to localhost only means you're going to have to also configure an internal proxy to reach it. You can do that with Rewrite rules but that seems like an overly-complicated way to go in this usecase. Why is this vhost available to localhost only? For that matter, why are using a separate vhost... you can do this all (Plone, static files, and PHP) in just one vhost with the appropriate ProxyPass lines (or Rewrite lines if you need more flexibility).



来源:https://stackoverflow.com/questions/2020332/plone-with-apache-proxy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!