开发者

Plone with Apache Proxy

开发者 https://www.devze.com 2022-12-15 14:08 出处:网络
I have a plone zinstance set up through Apache Proxy on OS X Se开发者_运维知识库rver 10.5.The server is set up with a single vhost on port 80, with Proxy & Proxypass directives to the Plone zinsta

I have a plone zinstance set up through Apache Proxy on OS X Se开发者_运维知识库rver 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?


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.


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>


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消