What is the smartest way to configure Tomcat to have two localhost instances?
Please note that I do not have admin rights to the system, and so don't have access to the /etc/hosts file. I would love to be able to do something like the following, but can't modify my /etc/hosts files: http://juststuffreally.blogspot.com/2007/03/enabling-multiple-localhost-sites-in.html
I'd like to have something like this, so that my instances of localhost would look as follows:
keith.localhost.com joe.localhost.com
...but I can't modify my /etc/hosts file =-(
Another resource that I found was this, but this gives instruction for multiple outside domains--I need multiple localhost instances: http://iam-rakesh.blogspot.com/2009/10/hosting-multiple-domains-in-tomcat.html
Any ideas?
Thank you for your help.
You can run multiple instances of tomcat on multiple ports. You would need a unique server.xml
for each instance, and each one would need different ports defined in the appropriate <Server>
and <Connector>
elements.
Once everything is set up, you would specify an explicit port when connecting to the instance, e.g.:
- http://localhost:8080/
- http://localhost:8081/
This document covers the process in a little more detail.