Reputation: 267
I have a CentOS
server and on it, I have a tomcat server. I have two clients with two web applications eg. 131.163.121.215/application1
and 131.163.121.215/application2
Both of those clients need a separate domain name for their web applications
eg. www.application1.com
and www.application2.com
Is that possible and if it is, how can I achieve that?
Upvotes: 0
Views: 987
Reputation: 139
Yes, it is possible.
I suppose you are using the default Tomcat port (8080), You can edit the server.xml
file on <TOMCAT_DIR>/conf/server.xml
to add another service with a connector running on a different port for example 9090
, you then place your other app on the second service. With this configuration you can add your application on a different folder for example webapps2
Example of server.xml
...
<Service name="Service1">
<Connector port="8080" connectionTimeout="20000" protocol="HTTP/1.1" maxThreads="250"/>
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
</Host>
</Service>
<Service name="Service2">
<Connector port="9090" protocol="HTTP/1.1" maxThreads="300" connectionTimeout="20000" />
<Host name="localhost" appBase="webapps2" unpackWARs="true" autoDeploy="true">
</Host>
</Service>
...
Your tomcat directory should have 2 webapps folders with your applications:
<TOMCAT_DIR>/webapps/application1
<TOMCAT_DIR>/webapps2/application2
The domains will redirect to the same server but to different port:
www.application1.com -> 131.163.121.215:8080/application1
and
www.application2.com -> 131.163.121.215:9090/application2
Upvotes: 1