Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Re: Problem setting server.xml <host> <context> field.

Jacob Rhoden

2007-01-03

Replies:

Thanks for your reply! I was not aware that mod_jk2 was not the best one
to use (I assumed 2=apache2). Rather than fixing my mess, how about I
ask a different question! I am using the latest version of tomcat, I
would like to have a single version of tomcat running on one port, which
I can deploy multiple applications.

I would like to use virtual hosts so that:
mainserver.com:8080/Application1/index.jsp maps to fish.com/index.jsp
mainserver.com:8080/Application2/index.jsp maps to apples.com/index.jsp

Ignoring the mess i have made, how would i do this? Any help or
pointers to documents that might help would be much appreciated!

Best Regards,
Jacob

Caldarale, Charles R wrote:
>> From: Jacob Rhoden [mailto:jacob@(protected)]
>> Subject: Problem setting server.xml <host> <context> field.
>>
>> I have setup a second <host> entry, to enable mapping of a particuar
>> application to a virtual host in apache (via mod_jk2).
>>  
>
> You do know that mod_jk2 has been deprecated for almost two years?
> Pretty much all the useful stuff has been implemented in mod_jk in the
> interim.
>
>  
>> The following seems to work ok, except or a possible bug:
>>     <Host name="fish.org" appBase="webapps" unpackWARs="true">
>>      <Logger className="org.apache.catalina.logger.FileLogger"
>>            directory="logs" prefix="virtual_log."
>> suffix=".txt" timestamp="true"/>
>>      <Context path="" docBase="/usr/local/tomcat/webapps/FishApp"
>> debug="0" reloadable="true"/>
>>     </Host>
>>  
>
> You probably don't want the two <Host> entries to use the same appBase,
> unless you really want the apps deployed in both of them at the same
> time. You don't say what level of Tomcat you're using, but with current
> versions (5.0 and beyond), the above will get the app deployed twice
> under fish.org, once as the default, once as FishApp. The doc for
> current levels also recommends quite strongly against putting <Context>
> elements inside server.xml.
>
>  
>> However if i undeploy/redeploy the application within the
>> tomcat manager, it no longer works.
>>  
>
> You need to have a separate manager app for each <Host>. In current
> levels, this would be accomplished by putting a manager.xml file in
> conf/Catalina/fish.org as well as the usual conf/Catalina/localhost.
> However, unless the overlap of the deployment directories of the two
> <Host>s is straightened out, I suspect it will never work reliably.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@(protected)
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>  


---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.