Virtual Hosts In Tomcat
Apache Tomcat is an open-source Java Servlet Container developed by the Apache Software Foundation. Tomcat implements several Java EE specifications including Java Servlet, JavaServer Pages (JSP), Java EL, and WebSocket, and provides a “pure Java” HTTP web server environment in which Java code can run.
To create virtual host edit the tomcat-users.xml file from the conf Tomcat installation directory:
After that edit the TOMCAT_HOME/conf/server.xml config file and add a new virtual host:
And add the virtualhost to /etc/hosts file:
Restart Tomcat if is running and deploy ROOT.war to the new appBase, TOMCAT_HOME/outdoorapps – now we have a ‘root context’ for the new domain name.