Now I have another problem on my work. I have adjusted the configuration so that now, depending on the URL, the request should be forwarded to the 3 tomcats in the backend.
If the URL is www.mysite.com, the request should be forwarded to Tomcat 1, and so on.
Of course, they're dummy websites in virtualhost, or at least that's what my server should think so. However, it doesn't work that way. If I go to mysite.com, as expected, mysite.com is actually called instead of the request being forwarded to Tomcat 1.
When I call up localhost, the Tomcat start page is displayed directly, which should actually be displayed for localhost:8181. The Apache start page should actually appear. The Tomcats can be reached at /app1..3. So that's not the problem.
The question is: what and where exactly do I have to change in order to achieve my goal?
httpd.conf
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.mysite.com
RewriteEngine on
RewriteRule ^/(.*)$/app1/$1 [l,PT]
JkMount /* tomcat1
</VirtualHost>
<VirtualHost *:80>
ServerName www.test.de
RewriteEngine on
RewriteRule ^/(.*)$/app2/$1 [l,PT]
JkMount /* tomcat2
</VirtualHost>
<VirtualHost *:80>
ServerName www.example.de
RewriteEngine on
RewriteRule ^/(.*)$/app3/$1 [l,PT]
JkMount /* tomcat3
</VirtualHost>
output of "httpd -S"
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf/httpd.conf:48
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80 is a NameVirtualHost
default server www.mysite.com (/etc/httpd/conf/httpd.conf:50)
port 80 namevhost www.mysite.com (/etc/httpd/conf/httpd.conf:50)
port 80 namevhost www.test.de (/etc/httpd/conf/httpd.conf:57)
port 80 namevhost www.example.de (/etc/httpd/conf/httpd.conf:64)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex lua-ivm-shm: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex default: dir="/etc/httpd/run/" mechanism=default
Mutex cache-socache: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
PidFile: "/etc/httpd/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48