apache - Redirecting to multiple webapps in same Tomcat -
i must tried lot of possibilities knowledgment in apache ws not advanced.
apache web server version: 2.2.22 os: centos 6 64 bits tomcat version: 7.0.57
what need achieve following: have plain websites defined way:
<virtualhost *:80> serveradmin example1@example1.com documentroot "/opt/sites/example1/" servername example1.com errorlog logs/example1-error_log customlog logs/example1-access_log common redirectmatch permanent ^/(.*) http://www.example1.com/$1 </virtualhost> <virtualhost *:80> serveradmin example1@example1.com documentroot "/opt/sites/example1/" servername www.example1.com errorlog logs/example1-error_log customlog logs/example1-access_log common </virtualhost>
i have tomcat several webapps, each 1 accessible own context. must access each 1 of webapps different domain. example, have following webapps: wbexample1, wbexample2, wbexample3
it should accessible way:
www.example1.com/wbexample1 www.example2.com/wbexample2 www.example3.com/wbexample3
so, domain defined each website must access specific webapp.
for extra, know if www.example1.com/wbexample1 accessible url www.example1.com/contact without showing name context of webapp , showing text contact or contact.html.
thank time.
you can that. first need set redirecton apache webserver apache tomcat. how sdo can found here. remove "/blog* no-jk" line.
the second thing need is, creating virtual hosts:
<virtualhost *:80>
will listen domains, can leave way, in scenario. edit [tomcat]/conf/server.xml , add virtual hosts every domain, having different names , appbases:
<host name="example1.com" appbase="webapps-example1" unpackwars="true" autodeploy="true"> ... </host>
create directories next default "webapps" directoy: "webapps-example1", ... sure tomcat can access them.
restart tomcat , deploy applications root context of vhosts, i.e.: [tomcat]/webapps-example1/root. can renaming them root.war before deployment. way can access applications without additional application name.
Comments
Post a Comment