> From: hellian [mailto:rashedulhasan2...@yahoo.com]
> Subject: RE: Problem setting Host
> 
>  <Host name="nexusroi.com" appBase="C:\superior\nexus\war"
> deployOnStartup="true" autoDeploy="false" unpackWARs="true"
> deployXML="false" xmlValidation="false" xmlNamespaceAware="false">
>  <Context path="/nexus" docBase="C:\superior\nexus\war"
> workDir="C:\superior\nexus\work" reloadable="true">
>   <Resource auth="Container" name="jdbc/NEXUS"
> type="javax.sql.DataSource"
> password="root" driverClassName="com.mysql.jdbc.Driver" maxIdle="2"
> maxWait="2000" username="root" url="jdbc:mysql://localhost:3306/nexus"
> maxActive="4" />
>   </Context>
>   </Host>

First, placing <Context> elements in server.xml is extremely bad practice.  The 
<Context> element should be in the webapp's META-INF/context.xml file, or in 
conf/Catalina/[host]/[appName].xml; where you have it requires a restart of 
Tomcat anytime you make changes.  Note that when in the proper locations, the 
path and docBase attributes must not be used in a <Context> element.

Second, docBase and appBase must *never* be the same.  The appBase directory is 
where each of your webapps should be placed; it must not point to a specific 
webapp.

Third, if you want a webapp to be the default one, it must be named ROOT (case 
sensitive, even on Windows).

Fourth, unless you are using multiple <Host> elements, there is no point in 
changing the name attribute; you can leave it at localhost.

So, if you want this nexus webapp to be the default, change appBase to 
"C:\superior", put the webapp in C:\superior\ROOT, place your <Context> element 
in C:\superior\ROOT\META-INF\context.xml, and remove the path and docBase 
attributes from the <Context>.  If the webapp is distributed as a .war file 
that you don't want to modify, place the .war in C:\superior\ROOT.war, and the 
<Context> element in conf\Catalina\[host]\ROOT.xml.

If you are not using multiple <Host> elements, put the <Host> name back to 
localhost; regardless, make sure the defaultHost of your <Engine> points to one 
of your <Host> elements.

Other directory locations will also work, as long as you maintain the proper 
relationship between appBase and the location of the webapp.

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to