cassioso
cassioso

Reputation: 976

Mapping address to multiple tomcat instances

I have 3 tomcat instances running on Windows Server 2008 machine. Each one with one app:

How I can configure my server to map an address without the port number?

Is it a tomcat configuration or something with DNS?

Thanks.


Ok, I tried the following:

Now the redirect works well local in the machine. But it doesn't works when I try access from another machine in the same network. (this another machine can ping 'machine' host. And I tried putting the ip number too).

Upvotes: 3

Views: 2199

Answers (3)

user1430511
user1430511

Reputation: 61

Try mod proxy configuration on below code in httpd:

ProxyPass           /app0   http://localhost:8080/app0/
ProxyPassReverse    /app0   http://localhost:8080/app0/
ProxyPass           /app1   http://localhost:8081/app1/
ProxyPassReverse    /app1   http://localhost:8081/app1/
ProxyPass           /app2   http://localhost:8082/app2/
ProxyPassReverse    /app2   http://localhost:8082/app2/

Upvotes: 0

Stugal
Stugal

Reputation: 880

You can use nginx (http://nginx.org/en/docs/) as proxy for example.

Try simply (no load balancing etc.):

    server {

    listen here.your.ip:80/YourApp;

    location / {
        root /path/to/your/webapp;
        proxy_pass http://host:8080/YourApp;
    }

}

Same way for other ports

Upvotes: 1

Steve
Steve

Reputation: 1875

It is quite common to use multiple Tomcats behind Apache to do load balancing. While this is not load balancing the principle is the same. Instead of having one application with 3 load-balanced Tomcat workers, you would have 3 applications with 1 tomcat worker each.

You can find the tomcat documentation here: http://tomcat.apache.org/connectors-doc/

Upvotes: 0

Related Questions