
Originally Posted by
KnisterPeter
I think you could use mod_proxy in the apache httpd.
You're probably right, mod_proxy should work as well. But I've ended up using mod_rewrite and mod_jk, because it allows HTTPD to serve up static content such as images without invoking dm Server.
So now my HTTPD configuration in conf/extra/httpd-vhosts.conf looks like:
Code:
<VirtualHost *:80>
DocumentRoot "/path/static/example.com"
ServerName www.example.com
RewriteEngine on
RewriteRule ^/images/ - [NC,L]
RewriteRule ^/(.*) /ExampleWeb/$1 [NC,PT]
JkMount /* dmServerJK
JkUnMount /images/* dmServerJK
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/path/static/anothersite-example.com"
ServerName www.anothersite-example.com
RewriteEngine on
RewriteRule ^/images/ - [NC,L]
RewriteRule ^/(.*) /AnotherSiteExampleWeb/$1 [NC,PT]
JkMount /* dmServerJK
JkUnMount /images/* dmServerJK
</VirtualHost>
and conf/jk/workers.properties looks like:
Code:
worker.list=dmServerJK
worker.dmServerJK.type=ajp13
worker.dmServerJK.host=localhost
worker.dmServerJK.port=9010
From a technical perspective this works. But we still have the problem that the URLs used by Java / dm Server are different to the actual URLs that users see in their browser. This means our application has to be modified to catch URLs generated by Java and remove the context path from them -- not an ideal solution.
Ideally dm Server would allow multiple hostnames to be used by one server, just like the underlying Apache Tomcat instance does. That would simply things greatly.