Hi Jörn,

> ...
the pain starts when using ssl: as you may know, it is not possible to have name-based virtual ssl hosts, because you can only have one ssl certificate and alternative vhost names would not match the server name in that certificate.

Yes, that's what the Apache documentation says. Not sure if this is true... We are running Apache 2.2.4 and the following works on our development machines (sorry it's a bit lenghty):

ProxyRequests Off

<VirtualHost _default_:443>
    ServerName pc2.inventec.ch:443
    ServerAdmin [EMAIL PROTECTED]
    DocumentRoot "C:/inetpub/wwwroot"
    SSLEngine on
    SSLCertificateFile "conf/server.crt"
    SSLCertificateKeyFile "conf/server.key"
    ...
</VirtualHost>

...

NameVirtualHost www.mypub.dev:80

<VirtualHost www.mypub.dev:80>
    ServerName www.mypub.dev
    ServerAdmin [EMAIL PROTECTED]
    DocumentRoot "C:/htdocs/mypub"
    Options -Indexes
    RewriteEngine On

    #redirect shop to https (VH for https below will handle the request)
RewriteRule ^/shop$ https://www.mypub.dev/shop/shops/allgemein/scripts/main.php?g_cid=1 [R,L]
    RewriteRule ^/shop(.*) https://www.mypub.dev/shop/$1 [L]

    #redirect /edit to https authoring
    RewriteRule ^/(.*)/edit$ https://www.mypub.dev/mypub/authoring/$1 [R,L]
    RewriteRule ^/edit https://www.mypub.dev/mypub/authoring/index.html [R,L]

    RewriteRule ^/$ index.html [P]

    # the following rule cuts off /mypub/live and redirects
    RewriteRule ^/mypub/live/(.*)$ $1 [R,L]

    # lenya wide resources
    RewriteRule ^/lenya/?(.*) http://www.mypub.dev:8888/lenya/$1 [P]
    # modules
    RewriteRule ^/modules/?(.*) http://www.mypub.dev:8888/modules/$1 [P]
    # mypub wide resources
    RewriteRule ^/mypub/?(.*) http://www.mypub.dev:8888/mypub/$1 [P]

    # exclude the shop (probably the rule will never match (rule above)
    RewriteCond %{REQUEST_URI} !^/shop(.*)$

    RewriteRule ^/(.*) http://www.mypub.dev:8888/mypub/live/$1 [P]

    ProxyPassReverse / http://www.mypub.dev:8888/
</VirtualHost>

NameVirtualHost www.mypub.dev:443

<VirtualHost www.mypub.dev:443>
    ServerName www.mypub.dev
    ServerAdmin [EMAIL PROTECTED]
    DocumentRoot "C:/htdocs/mypub"
    Options -Indexes
    RewriteEngine On

    SSLEngine On
    SSLCertificateFile "conf/mypub-dev.crt"
    SSLCertificateKeyFile "conf/mypub-dev.key"

    # lenya wide resources
    RewriteRule ^/lenya/?(.*) http://www.mypub.dev:8888/lenya/$1 [P]
    # modules
    RewriteRule ^/modules/?(.*) http://www.mypub.dev:8888/modules/$1 [P]
    # mypub wide resources
    RewriteRule ^/mypub/?(.*) http://www.mypub.dev:8888/mypub/$1 [P]

    # cut off /mypub/live for encrypted live pages and redirect
    # (last rule before proxpassreverse will match)
    RewriteRule ^/mypub/live/(.*) $1 [R,L]

RewriteRule ^/mypub/authoring/(.*) http://www.mypub.dev:8888/mypub/authoring/$1 [P]

    # exclude the shop
    RewriteCond %{REQUEST_URI} !^/shop(.*)$
    RewriteRule ^/(.*) http://www.mypub.dev:8888/mypub/live/$1 [P]

    ProxyPassReverse / http://www.mypub.dev:8888/
</VirtualHost>

We haven't set any Lenya proxy settings. They don't seem to be necessary in our environment. Besides Lenya, we have a shop that is written in PHP and is tightly integrated with the Lenya publication by some of the rewrite rules above and a tab in the navigation.

Note that there are two different (self-signed) certificates with matching names in two different virtual hosts. Note also that this setting is a work in progress and has not yet been used in a productive environment.

Hope this helps,
Markus Angst

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to