arunangaj
arunangaj

Reputation: 1

Glassfish and Tomcat in same server machine and hosting more than one site on both?

I have a tomcat 6.0 web server on my server machine.now i created a glassfish server on the same machine. for avoid port conflict i just change glassfish port to 8081. now how can i access my web applications on both glassfish and tomcat from different DNS name.

Upvotes: 0

Views: 916

Answers (1)

Marks Polakovs
Marks Polakovs

Reputation: 508

Depends on your DNS/server setup.

  • You could use Apache and reverse proxies:
    
        <VirtualHost *>
        ProxyPreserveHost On
    
        # Servers to proxy the connection, or;
        # List of application servers:
        # Usage:
        # ProxyPass / http://[IP Addr.]:[port]/
        # ProxyPassReverse / http://[IP Addr.]:[port]/
        # Example: 
        ProxyPass / http://0.0.0.0:8081/
        ProxyPassReverse / http://0.0.0.0:8081/
    
        ServerName glassfish.server
    </VirtualHost>
    <VirtualHost *>
        ProxyPreserveHost On
    
        # Servers to proxy the connection, or;
        # List of application servers:
        # Usage:
        # ProxyPass / http://[IP Addr.]:[port]/
        # ProxyPassReverse / http://[IP Addr.]:[port]/
        # Example: 
        ProxyPass / http://0.0.0.0:8080/
        ProxyPassReverse / http://0.0.0.0:8080/
    
        ServerName tomcat.server
    </VirtualHost>
    
  • Or you could use your DNS. I'm afraid I can't help you with that.

Upvotes: 2

Related Questions