Search code examples
virtualhostapachemod-jk

Apache mod_jk and virtual hosts


I have configured apache with mod_jk, to redirect the /taste context to my application server. Now I would like to create a virtual host, so that my domain name redirects to this context.

I tried the following configuration in httpd.conf :

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName www.suitmytaste.com
    ServerAlias suitmytaste.com *.suitmytaste.com
    DocumentRoot /taste
</VirtualHost>

But apache does not accept the /taste part as a DocumentRoot. How can I configure it so it redirects the virtual host to the mod_jk connector?


Solution

  • I made it work by removing the DocumentRoot line, and adding the following lines instead :

    JkMount / worker1
    JkMount /* worker1
    

    with worker1 being the worker I had configured in mod_jk worker.properties file.