we have the following three tier application configuration:

1) Elastic Load Balancer as entry point

2) Two Apache webservers as proxies and load balancers (two for failover) behind the ELB. The webservers have some configuration, that is impossible to make with the ELB alone.

3) Behind the webservers are two application servers (Tomcats with the Liferay application) in a working failover cluster

4) Behind the app servers is the MySQL DB

All this works just fine!

Now: We would like to install the OmniDB application on the application servers (3) and use the Apache webservers (2) to proxy it "to the outside world" (company intranet in this case). OmniDB is needed to present the MySQL DB in a webfrontend GUI, so nobody has to login on the servers directly. More info on OmniDB here

The OmniDB application has one special particularity: It uses/needs two ports and the proxy in front of OmniDB should forward the requests to both of the ports - more info on this topic here

So I have two aplications servers ( .71) and each of these have the following active web applications:

Tomcat app-server on AJP port 8009 OmniDB web-server on port TCP/8000 OmniDB web-socket on port TCP/25482

Now I would like to acces all this from a frontend apache webservers ( .69) (or the ELB in front of the webservers in this case).

The tomcat application should be accessible over the default address, like:


And the OmniDB service should be accessible over:


Here is my Apache configuration:

<VirtualHost *:8080>
ProxyRequests     Off
ProxyPreserveHost On
RewriteEngine     On
TraceEnable       Off

<Directory /data0/software/apache2/htdocs>
  Options -Indexes -FollowSymLinks
  AllowOverride None
  Order allow,deny
  allow from all

<Proxy balancer://liferaycluster>
    BalancerMember ajp:// route=node1 ping=5 loadfactor=1
    BalancerMember ajp:// route=node2 ping=5 loadfactor=1
    ProxySet stickysession=ROUTEID
    ProxySet lbmethod=byrequests

<Proxy balancer://omnidbcluster>
    BalancerMember route=node1 ping=5 loadfactor=1
    BalancerMember route=node2 ping=5 loadfactor=1
    ProxySet stickysession=ROUTEID
    ProxySet lbmethod=byrequests

<Proxy balancer://omnidbwsscluster>
    BalancerMember route=node1 ping=5 loadfactor=1
    BalancerMember route=node2 ping=5 loadfactor=1
    ProxySet stickysession=ROUTEID
    ProxySet lbmethod=byrequests

Header set X-Frame-Options SAMEORIGIN
ProxyPass        /error/ !
ProxyPass        /ErrorPages/ !
ProxyPass        /sitemap.xml !
ProxyPass        /robots.txt !
ProxyPass        /server-status !
ProxyPass        /balancer-manager !

ProxyPass        / balancer://liferaycluster/
ProxyPassReverse / balancer://liferaycluster/

ProxyPass        /omnidb/ balancer://omnidbcluster/
ProxyPassReverse /omnidb/ balancer://omnidbcluster/
ProxyPass        /omnidb/ balancer://omnidbwsscluster/wss
ProxyPassReverse /omnidb/ balancer://omnidbwsscluster/wss

RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule . https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]
Header set Strict-Transport-Security "max-age=31536000"

<Location />
    AllowOverride None
    Order allow,deny
    Allow from all
    AllowMethods GET POST

#ELB IP range:
RemoteIPHeader X-Forwarded-For

The liferay application works just fine! But I can't access the additional OmniDB service, because in the current configuration the apache redirects all traffic to the Liferay application.

I'd like to acces my OmniDB service over /omnidb in my-liferay-app.com/omnidb so all requests to ../omnidb should be redirected to ports 8000 and 25482 on the same application servers. As I said, I have two application servers for failover purposes, so a simple proxy won't work here. The Apaches have to work as load balancers - that's why I have LB directives in my httpd.conf

Currently all requests (also these for ../omnidb) are routed to the Tomcat application and it responds with 404, which is correct. I'd like to access the ports 8000 + 25482 on the application servers, when I open the ../omnidb address on my server.

How do I do it? I'm relatively new to the Apache web server, so I'm struggling here... If a rewrite rule on the Apache is needed here, then I kindly ask somebody to deliver the complete code for it.

Thank you all kindly in advance!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.