You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by micker <mi...@schantz.com> on 2007/09/08 11:35:42 UTC

Virtual hosts problem

Hi, I have just installed tomcat5.5 on my fedora 7 server, and I need to
configure some virtual hosts for the first time.

I have searched the internet for some conclusive guide, but none seem to
work.

this is what i have so far:

<Host name="micker.dk" debug="0" appBase="webapps/micker.dk"
      unpackWARs="true" autoDeploy="true"
      xmlValidation="false" xmlNamespaceAware="false">

   <Logger className="org.apache.catalina.logger.FileLogger"
       directory="logs"  prefix="micker.dk\_log." suffix=".txt"
timestamp="true"/>

<Context displayName="micker.dk" docBase="" path="">
</Context>

   <Alias>www.micker.dk</Alias>
</Host>

This works, except when i need to call classes from /WEB-INF/classes from a
jsp not located in / 

I'm pretty sure the above is the wrong way of configuring a virtual host,
but I can't get anything else to work.

where have I screwed up?

Thank you,
Michael


-- 
View this message in context: http://www.nabble.com/Virtual-hosts-problem-tf4405374.html#a12568129
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Virtual hosts problem

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: micker [mailto:michael@schantz.com] 
> Subject: Virtual hosts problem
> 
> I have searched the internet for some conclusive guide, but 
> none seem to work.

Why not read the actual Tomcat doc first?  Besides the link Mark T
provided, here's the general one for Tomcat-specific configuration:
http://tomcat.apache.org/tomcat-5.5-doc/config/index.html

If you do go searching the internet, make sure you only look at
information for the 5.5 level.

> <Host name="micker.dk" debug="0" appBase="webapps/micker.dk"
>       unpackWARs="true" autoDeploy="true"
>       xmlValidation="false" xmlNamespaceAware="false">

Is this the only <Host>?  Is this the defaultHost for the <Engine>?  If
it's not the only one, make sure the appBase directory does not overlap
with other <Host>'s appBase settings.  If it is the only <Host> you'll
have, you don't need to change what comes with Tomcat.

>    <Logger className="org.apache.catalina.logger.FileLogger"
>        directory="logs"  prefix="micker.dk\_log." suffix=".txt"
> timestamp="true"/>

<Logger> elements are not supported in 5.5.

> <Context displayName="micker.dk" docBase="" path="">
> </Context>

<Context> elements should not be placed in server.xml; the preferred
location is in the webapp's META-INF/context.xml file.  Regardless, as
Mark T pointed out, the docBase is invalid.

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


Re: Virtual hosts problem

Posted by Mark Thomas <ma...@apache.org>.
micker wrote:
> I have searched the internet for some conclusive guide, but none seem to
> work.

You could always try the Tomcat documentation:
http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html

> where have I screwed up?

You set appBase == docBase

I'll look into adding some more explict instructions to the HOW-TO.

Using the above doc, the ROOT webapp should be deployed as a war at
$CATALINA_HOME/webapps/stimpy/ROOT.war
or as an exploded dir at
$CATALINA_HOME/webapps/stimpy/ROOT

Other webapps would be deployed as:
$CATALINA_HOME/webapps/stimpy/foo.war
$CATALINA_HOME/webapps/stimpy/bar.war
etc

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org