1

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?

kgautron
  • 7,915
  • 9
  • 39
  • 60

1 Answers1

0

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.

kgautron
  • 7,915
  • 9
  • 39
  • 60
  • How did you configure that your content lies in /taste ? – Sir Hackalot Aug 15 '22 at 11:28
  • 1
    The content is not static so it does not lie in any particular folder. It is instead genrated by tomcat dynamically. The purpose of mod jk is to act as a proxy between apache and tomcat, so it delegates the request to tomcat instead of serving a static file. – kgautron Sep 05 '22 at 14:50