>> anyway, here is the out put of the package query on my FreeBSD box:
>> ap22-mo_jk-ap2-1.2.30_1 Apache2 JK module for connecting to Tomcat usi=
ng AJP1X
>=20
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>=20
>=20
>=20
> Its a virtual host with following lines have been added to main httpd.c=
onf:
> LoadModule jk_module libexec/apache22/mod_jk.so
> JkWorkersFile /usr/local/etc/apache22/workers.properties
> JkShmFile /var/log/mod_jk.shm
> JkLogFile /var/log/mod_jk.log
> JkLogLevel debug=20
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>=20
> and following JkMount directives for each virtual host:
> JkMount /appexmp1/* appexmp1
> JkMount /appexmp1/*.jsp appexmp1
>=20
> and following is the worker file for two of the sites:
> worker.list=3Dappexmp2,appexmp1
> worker.appexmp2.type=3Dajp13
> worker.appexmp2.host=3Dlocalhost
> worker.appexmp2.port=3D8009
> worker.appexmp1.type=3Dajp13
> worker.appexmp1.host=3Dlocalhost
> worker.appexmp1.port=3D8109
>=20
>=20
> Created separate directories in CATALINA_BASE/webapps/
> for each application so , it contain following directories:
> CATALINA_BASE/webapps/ROOT
> CATALINA_BASE/webapps/appexmp1
> CATALINA_BASE/webapps/appexmp2
>=20
> context file for each application resides in=20
> CATALINA_BASE/conf/Catalina/localhost for example:
> CATALINA_BASE/conf/Catalina/localhost/appexmp1.xml
> CATALINA_BASE/conf/Catalina/localhost/appexmp2.xml
>=20
> cat CATALINA_BASE/conf/Catalina/localhost/appexmp1.xml
> <Context path=3D"/appexmp1" docBase=3D"appexmp1" debug=3D"0" reloadable=
=3D"true" crossContext=3D"true">
> </Context>
path & docBase are surplus to requirements here. debug is no longer
functional.
> and web.xml file as follow:
> cat CATALINA_BASE/webapps/appexmp1/WEB-INF/web.xml
> <web-app xmlns=3D"http://java.sun.com/xml/ns/javaee" version=3D"2.5">
> <servlet>
> <servlet-name>App1</servlet-name>
> <servlet-class>com.appexmp1.App1</servlet-class>
> </servlet>
>=20
> <servlet-mapping>
> <servlet-name>App1</servlet-name>
> <url-pattern>/APP1</url-pattern>
> </servlet-mapping>
>=20
> <welcome-file-list>
> <welcome-file>index.jsp</welcome-file>
> </welcome-file-list>
>=20
> </web-app>
> I already can access mydomain.com/App1/index.jsp and every thing works =
fine
> but want to be able to serve .jsp files as follow:
> mydomain.com/index.jsp
> for each of my virtual hosts.
If the ROOT application is just a default one, you can remove it.
You will need a separate appBase for each virtual host.
In server.xml, define multiple hosts, with _separate_ appBase's:
<Host name=3D"hostexmp1" appBase=3D"/path/to/host1/appBase" ... >
</Host>
<Host name=3D"hostexmp2" appBase=3D"/path/to/host2/appBase" ... >
</Host>
copy appexmp1 and appexmp2 into the appBase & rename them 'ROOT'.
Your app is now the default app in each host, so in each HTTPD virtual
host, add:
JkMount /* appexmp1
p
--=20
[key:62590808]
|