Mark
asked on
How to set default webapp for host
I am using Apache Tomcat 8.0.15 on Linux Slackware 14.1. I have a server with multiple URLs. In $CATALINA_HOME/webapps I have separate app directories corresponding to each of these URLs.
How to I configure things so that a user just has to type the URL and gets the right app? For example:
enter: http://www.mydomain.comĀ ---- instead of: http://www.mydomain.com/thisApp
How to I configure things so that a user just has to type the URL and gets the right app? For example:
enter: http://www.mydomain.comĀ ---- instead of: http://www.mydomain.com/thisApp
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm not using WARs at the moment. I have several folder under $CATALINA_HOME/webapps:
thisgroup/
thatgroup/
anothergroup/
For each of these I have a corresponding public domain/URL
http://www.thisgroup.org
http://www.thatgroup.org
http://www.anthergroup.org
I'm also using Apache httpd, and have the following httpd-tomcat.conf
thisgroup/
thatgroup/
anothergroup/
For each of these I have a corresponding public domain/URL
http://www.thisgroup.org
http://www.thatgroup.org
http://www.anthergroup.org
I'm also using Apache httpd, and have the following httpd-tomcat.conf
# Load mod_jk module
LoadModule jk_module lib64/httpd/modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile /etc/httpd/workers.properties
# Where to put jk shared memory
JkShmFile /var/log/httpd/mod_jk.shm
# Where to put jk logs
JkLogFile /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# Send everything for context /examples to worker named worker1 (ajp13)
JkMount /thisgroup/* worker1
JkMount /thisgroup worker1
JkMount /thatgroup/* worker2
JkMount /thatgroup worker2
What would I do in this configuration? Some change to httpd.conf? Something in web.xml, server.xml? I thought I'd figured this out once, but apparently can't remember.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The contributors didn't really solve my problem as their answers did not apply. I guess I solved my own problem but can't say how.
1. Stop your tomcat.
2. Place your war file outside of CATALINA_BASE/webapps. And remove the applications/war from CATALINA_BASE/webapps.
3. Create a file called ROOT.xml and place it in CATALINA_BASE/conf/. The one and only element (Context) in this context file must have a docBase attribute pointing to the location of your war file. The path element should not be set - it is derived from the name of the .xml file, in this case ROOT.xml.
4. Start your tomcat.