<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-signature">
<div class="moz-text-html" lang="x-unicode">
<div class="moz-signature">Anyone out there having experience
with haproxy to tomcat configuration? I would like to get rid
of all that apache virtualhost stuff and I'm seeking for a
configuration with haproxy as a front end an one tomcat with
multiple servers running at different ports.<br>
<br>
Here is a haproxy file that allows for connecting backends to
a haproxy frontend with stripping off the /opencms prefix
(requires<br>
opencms running as a ROOT app which I prefer anyway, origin:
Alex K.):<br>
<pre><code>defaults
<span class="command">log</span> <span class="keyword">global</span>
mode http
compression algo gzip
compression type <span class="type">text</span>/html <span class="type">text</span>/css <span class="type">text</span>/plain <span class="type">text</span>/vcard <span class="type">text</span>/vnd.rim.location.xloc <span class="type">text</span>/vtt <span class="type">text</span>/x-component <span class="type">text</span>/x-cross-domain-policy <span class="type">application</span>/atom+xml <span class="type">application</span>/javascript <span class="type">application</span>/x-javascript <span class="type">application</span>/json <span class="type">application</span>/ld+json <span class="type">application</span>/manifest+json <span class="type">application</span>/rss+xml <span class="type">application</span>/vnd.geo+json <span class="type">application</span>/vnd.ms-fontobject <span class="type">application</span>/x-font-ttf <span class="type">application</span>/x-web-app-manifest+json <span class="type">application</span>/xhtml+xml <span class="type">application</span>/xm
l font/
opentype image/bmp image/svg+xml image/x-icon <span class="type">text</span>/cache-manifest
balance roundrobin
option dontlog-normal
option dontlognull
option httpclose
option forwardfor
frontend http-<span class="keyword">in</span>
bind *:<span class="number">80</span>
acl is_static path_beg /export/ /opencms/ /resources/ /javadoc/ /VAADIN/ /workplace /opencms-login/
acl is_website hdr_beg(host) -i website
use_backend website-static <span class="keyword">if</span> is_website is_static
use_backend website <span class="keyword">if</span> is_website
backend website-static
server website website:<span class="number">8080</span>
backend website
reqirep ^([^\ :]*)\ /(.*) \<span class="number">1</span>\ /opencms/\<span class="number">2</span>
server website website:<span class="number">8080
</span></code></pre>
<br>
I'm having problems with the backend configuration. What is
"website" in the above example? Has it to be replaced by e.g.
cms.mydomain.org? <br>
The line "backend website" is a logical placeholder,
obviously, but the line "server website website:8080"?
Shouldn't that be replaced by<br>
server cms.mydomain.org <ip>:8080, where <ip>
could be either a DNS name, /etc/hosts alias or an explicit
IP, like 127.0.0.1?<br>
<br>
I have some connectors in my server.xml (tomcat) which I would
like to connect to haproxy and I tried to configure tomcat<br>
as listening to ports 127.0.0.1:8080 and the other (virtual)
hosts (webservers) at port 8081, 8082 etc...<br>
<br>
But I can't get connection to none of these ports.<br>
<br>
Any help appreciated. <br>
-- <br>
Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de </div>
</div>
</div>
</body>
</html>