English 中文(简体)
Plone with Apache Proxy
原标题:

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?

最佳回答

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





相关问题
How to change firefox proxy from webdriver?

how can I access Firefox proxy settings from Python Webdriver and change them to make Firefox use modified proxy settings without needing to restart it?

Regex Proxy Server

I control access via a proxy server and run some regex on every request. For prototype I have used curl, regex and php. Obviously this will not put up with any serious load. Can anyone suggest and ...

Specify a Proxy in config vs code for a WSE/SOAP web service

Is there a way to specify a WSE3 proxy in the config file instead of code. I figured out how to get it working in code as follows: valservice.Proxy = new System.Net.WebProxy("http://10.192.xx.xx:...

Accessing a git repository via ssh behind a firewall

I would like to access (clone/push/pull) a private (via ssh) git repository while behind a corporate firewall that only allows http proxy access. I have written a robust Java (daemon) program (based ...

Set proxy data for an app

I have a few .NET apps which use the HttpWebRequest. My gut says i can create a config or manifest file and set the proxy data in there and .NET will automatically load it. But i dont know if that ...

热门标签