| # Lenya proxy testing environment for Apache HTTPD 2.2.x |
| |
| NameVirtualHost 127.0.0.1:80 |
| |
| LoadModule rewrite_module /usr/lib/apache2/mod_rewrite.so |
| LoadModule proxy_module /usr/lib/apache2/mod_proxy.so |
| LoadModule proxy_ajp_module /usr/lib/apache2/mod_proxy_ajp.so |
| |
| |
| # |
| # NOTE: This apache config file should give you a working proxy setup. |
| # However, it may not be the most elegant/effective/robust. Please |
| # contribute your own experience, so that we can establish a set of |
| # best practices for proxied production setups. |
| # |
| |
| <VirtualHost www.example.com:80> |
| |
| ServerAdmin lenyatest@www.example.com |
| ServerAlias www.example.com www |
| DocumentRoot /srv/www/htdocs |
| |
| HostnameLookups Off |
| UseCanonicalName Off |
| ServerSignature On |
| |
| RewriteEngine On |
| ProxyRequests Off |
| |
| # force SSL protection for authoring: |
| # better to disable this during testing as it can create confusion wrt Lenya's own redirects. |
| # RewriteRule ^/lenya/(.*)/authoring/(.*) https://www.example.com/lenya/$1/authoring/$2 [R] |
| |
| |
| # map official name "customer" to publication id "default" |
| <Location /lenya/customer> |
| ProxyPass ajp://localhost:8009/webapp/default |
| ProxyPassReverse http://www.example.com/lenya/customer |
| ProxyPassReverseCookiePath /webapp/default /lenya/customer |
| </Location> |
| |
| # handle global Lenya resource requests |
| <Location /lenya> |
| ProxyPass ajp://localhost:8009/webapp |
| ProxyPassReverse http://www.example.com/lenya |
| ProxyPassReverseCookiePath /webapp /lenya |
| </Location> |
| |
| ErrorLog /tmp/LenyaTest_www.example.com-errors |
| CustomLog /tmp/LenyaTest_www.example.com-access combined |
| RewriteLogLevel 4 |
| RewriteLog /tmp/LenyaTest_www.example.com-rewrite.log |
| |
| </VirtualHost> |
| |
| |
| <IfDefine SSL> |
| <IfDefine !NOSSL> |
| <VirtualHost www.example.com:443> |
| |
| SSLEngine on |
| SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL |
| SSLCertificateFile /tmp/proxy-ssl-cert.pem |
| SSLCertificateKeyFile /tmp/proxy-ssl-key.pem |
| |
| ServerAdmin lenyatest@www.example.com |
| ServerAlias www.example.com www |
| DocumentRoot /srv/www/htdocs |
| |
| HostnameLookups Off |
| UseCanonicalName Off |
| ServerSignature On |
| |
| RewriteEngine On |
| ProxyRequests Off |
| |
| |
| # map official name "customer" to publication id "default" |
| <Location /lenya/customer> |
| ProxyPass ajp://localhost:8009/webapp/default |
| ProxyPassReverse https://www.example.com/lenya/customer |
| ProxyPassReverseCookiePath /webapp/default /lenya/customer |
| </Location> |
| |
| # handle global Lenya resource requests |
| <Location /lenya> |
| ProxyPass ajp://localhost:8009/webapp |
| ProxyPassReverse https://www.example.com/lenya |
| ProxyPassReverseCookiePath /webapp /lenya |
| </Location> |
| |
| ErrorLog /tmp/LenyaTest_www.example.com-SSL-errors |
| CustomLog /tmp/LenyaTest_www.example.com-SSL-access combined |
| RewriteLogLevel 4 |
| RewriteLog /tmp/LenyaTest_www.example.com-SSL-rewrite.log |
| |
| </VirtualHost> |
| </IfDefine> |
| </IfDefine> |
| |
| |
| <VirtualHost customer.example.com:80> |
| |
| ServerAdmin webmaster@customer.example.com |
| ServerAlias customer.example.com customer |
| DocumentRoot /srv/www/htdocs |
| |
| HostnameLookups Off |
| UseCanonicalName Off |
| ServerSignature On |
| |
| RewriteEngine On |
| ProxyRequests Off |
| |
| # catch funky addresses with "/"s and "."s to make |
| # cocoon matching behave like apache (where "foo/" and "foo" and "/./foo" all do the same): |
| # FIXME: could use some review and better documentation. Does this have security implications as well? |
| # RewriteRule ^/([^/\.]+)$ $1/ [R] |
| |
| # all requests to customer.example.com are passed to the live area: |
| <Location /> |
| # fixme: the trailing slash seems necessary here. looks like an inconsistency in our matchers... |
| ProxyPass ajp://localhost:8009/webapp/default/live/ |
| ProxyPassReverse http://customer.example.com |
| ProxyPassReverseCookiePath /webapp/default/live / |
| </Location> |
| |
| # handle global Lenya resource requests |
| <Location /lenya> |
| # fixme: the trailing slash seems necessary here. looks like an inconsistency in our matchers... |
| ProxyPass ajp://localhost:8009/webapp/ |
| ProxyPassReverse http://www.example.com/lenya |
| ProxyPassReverseCookiePath /webapp /lenya |
| </Location> |
| |
| ErrorLog /tmp/LenyaTest_customer.example.com-errors |
| CustomLog /tmp/LenyaTest_customer.example.com-access combined |
| RewriteLogLevel 4 |
| RewriteLog /tmp/LenyaTest_customer.example.com-rewrite.log |
| |
| </VirtualHost> |
| |