You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Lockwood <jo...@directcon.net> on 2000/03/22 18:34:53 UTC

Configuration, context mappings, Virtual Hosts

Hi:

I'm running Tomcat/Jakarta on Redhat with Apache (Red Hat secure server,
which I'm going to guess is build 1.3.6, but certainly 1.3.x).  I've gotten
Tomcat up and running fine and now I'm working on some configuration issues.
I'm re-reading the faq and have also worked with server.xml somewhat and
read deployment.html, but the latter trails off with a TODO, and I'm still
doing a bit of head scratching about the following tasks:

I have a server that's running the old, pre-tomcat mod_jserv.so for servlet
support along with ApacheJSSI.jar to support the "<servlet>" tag.  I have a
legacy app running on some virtual hosts, which is all servlet, contained in
a jar file.  In httpd.conf, I simply point the virtual host DirectoryIndex
to a file with the servlet tag referencing the startup page.  I'm also
looking to configure my main "company page" (which is the "first" virtual
host container but would work without a virtual host, since it's "me" <g>)
for servlet and JSP support.

So, my questions...

1) In server.xml, I can see how directories get mapped into the main
server's space, but how does this work with virtual hosts (or does it yet?).
I'd like to set up multiple virtual hosts to support servlets and jsp.

2) I haven't yet been that successful in doing server.xml mappings to other
than the default "webapps" directory, especially when it comes to mapping ""
(root).  Could httpd.conf be interacting with this in some way, or is there
anything else I should be reading or aware of before trying this some more?

3) Once I get through those issues, is there a jakarta / jsp analog to the
servlet tag that I might use to have the user arrive at
"www.shopcameronpark.com", for example, and end up having that map into
myapp.jar --> com.particlewave.servlets.MainPage.class?  JSP "forward" looks
promising?  If not, if I can get through the rest I can probably rework my
awesome one line servlet tag page to do the trick until I port all those
ugly "out.printlns" to nice JSP pages. ;-)

Incidentally, if the answer to any of these questions also includes "hey,
someone should write this down for other users", I volunteer.

Thanks.

Regards,


John Lockwood
C.E.O.
ParticleWave, Inc.
Software Engineering Excellence
Toll Free:  1 (888) 784-9160
http://www.particlewave.com


RE: Configuration, context mappings, Virtual Hosts

Posted by John Lockwood <jo...@directcon.net>.
Hi,

First of all, thanks for the rest of your note regarding the state of
virtual hosts support.  Perhaps I'll try something clever in the meantime if
I don't get caught up in the awful treadmill of selling my next REAL
contract. ;-)

Regarding your next question, I haven't tried working with tomcat
independently of an apache connection, if that's what you're asking.  If
that's a technique I should learn, I'm certainly willing to.


> 2) I haven't yet been that successful in doing server.xml mappings to
other
> than the default "webapps" directory, especially when it comes to mapping
""
> (root).  Could httpd.conf be interacting with this in some way, or is
there
> anything else I should be reading or aware of before trying this some
more?

Does standalone works ?
It works for me.

Costin


--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org


Re: Configuration, context mappings, Virtual Hosts

Posted by Costin Manolache <Co...@eng.sun.com>.
> 1) In server.xml, I can see how directories get mapped into the main
> server's space, but how does this work with virtual hosts (or does it yet?).
> I'd like to set up multiple virtual hosts to support servlets and jsp.

It doesn't - it's not very difficult to add support for vhosts, but we want to
fix the bugs and have something stable before adding new features.

( support for vhost == one Request interceptor, fixing the config-  there are
2 or 3 ways to configure that, and fixing SimpleMapper )

It may be possible to do vhosts using Apache as a front end, using a
special httpd.conf - i.e. let apache deal with the vhost problem, it
will just send us the context. I never tried, probably it will need some
small code fixes.


> 2) I haven't yet been that successful in doing server.xml mappings to other
> than the default "webapps" directory, especially when it comes to mapping ""
> (root).  Could httpd.conf be interacting with this in some way, or is there
> anything else I should be reading or aware of before trying this some more?

Does standalone works ?
It works for me.

Costin


Re: Configuration, context mappings, Virtual Hosts

Posted by Peter Carr <pc...@infinitemarket.com>.
If you are still having problems with server.xml mappings read below. And if you
want to start building a better (dummies guide) feel free to use the following,
which is my cheat sheet after spending way too much time trying to figure it all
out. Of course I still haven't gotten around to reading any of the official
Servlet specs.

Building a Web Applicaiton with Apache-Jakarta
----------------------------------------------
RedHat Linux 6.1
Apache-ssl 1.3.9
Tomcat3.1beta
JDK1.2.2
----------------------------------------------
All of this is in the documentation, but it was kind of spread out,
and I had trouble getting it all working the first time around.

To launch tomcat I did the following:
   unsetenv CLASSPATH
   setenv JAVA_HOME /usr/jdk1.2.2
   setenv TOMCAT_HOME /usr/jakarta-tomcat
   TOMCAT_HOME/startup.sh

1. the web application is deployed by putting a WEBAPP into a CONTEXT.

TOMCAT_HOME - the location of the root tomcat directory

WEBAPP -- gets the name of the folder which contains your application
CONTEXT -- gets the link from your websevers document root to your application
I put WEBAPP folder into TOMCAT_HOME/webapps

A. set up a folder, WEBAPP, which contains the following subdirectories
   /WEB-INF
   /WEB-INF/web.xml
   /WEB-INF/classes/
   /WEB-INF/lib/
   /WEB-INF/jsp/
   /WEB-INF/servlets/
   *.html
   et cetera

B. edit TOMCAT_HOME/conf/tomcat.conf by adding the following
   ApJservMount /CONTEXT

C. edit TOMCAT_HOME/conf/server.xml by adding the following
   <Context path="/CONTEXT" docBase="webapps/CONTEXT">
   </Context>

D. restart tomcat  (to force loading of classes), don't know if this is
necessary.
E. restart apache (to force reading of tomcat.conf)


John Lockwood wrote:

> Hi:
>
> I'm running Tomcat/Jakarta on Redhat with Apache (Red Hat secure server,
> which I'm going to guess is build 1.3.6, but certainly 1.3.x).  I've gotten
> Tomcat up and running fine and now I'm working on some configuration issues.
> I'm re-reading the faq and have also worked with server.xml somewhat and
> read deployment.html, but the latter trails off with a TODO, and I'm still
> doing a bit of head scratching about the following tasks:
>
> I have a server that's running the old, pre-tomcat mod_jserv.so for servlet
> support along with ApacheJSSI.jar to support the "<servlet>" tag.  I have a
> legacy app running on some virtual hosts, which is all servlet, contained in
> a jar file.  In httpd.conf, I simply point the virtual host DirectoryIndex
> to a file with the servlet tag referencing the startup page.  I'm also
> looking to configure my main "company page" (which is the "first" virtual
> host container but would work without a virtual host, since it's "me" <g>)
> for servlet and JSP support.
>
> So, my questions...
>
> 1) In server.xml, I can see how directories get mapped into the main
> server's space, but how does this work with virtual hosts (or does it yet?).
> I'd like to set up multiple virtual hosts to support servlets and jsp.
>
> 2) I haven't yet been that successful in doing server.xml mappings to other
> than the default "webapps" directory, especially when it comes to mapping ""
> (root).  Could httpd.conf be interacting with this in some way, or is there
> anything else I should be reading or aware of before trying this some more?
>
> 3) Once I get through those issues, is there a jakarta / jsp analog to the
> servlet tag that I might use to have the user arrive at
> "www.shopcameronpark.com", for example, and end up having that map into
> myapp.jar --> com.particlewave.servlets.MainPage.class?  JSP "forward" looks
> promising?  If not, if I can get through the rest I can probably rework my
> awesome one line servlet tag page to do the trick until I port all those
> ugly "out.printlns" to nice JSP pages. ;-)
>
> Incidentally, if the answer to any of these questions also includes "hey,
> someone should write this down for other users", I volunteer.
>
> Thanks.
>
> Regards,
>
> John Lockwood
> C.E.O.
> ParticleWave, Inc.
> Software Engineering Excellence
> Toll Free:  1 (888) 784-9160
> http://www.particlewave.com
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org