You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Michael Percy <mp...@portera.com> on 2000/09/26 02:00:57 UTC

RE: Tomcat ROOT == Apache Root

This is what everyone [or just about everyone] wants to do with their
systems... I believe an real-world example of this is an imperative for
Tomcat's deployment-level documentation.

Mike

-----Original Message-----
From: Pascal-Eric Servais [mailto:pascal-eric@videotron.ca]
Sent: Monday, September 25, 2000 4:05 PM
To: tomcat-user@jakarta.apache.org
Subject: Tomcat ROOT == Apache Root


Hi ! I want Tomcat ROOT to be equivalent to Apache root (htdocs). Is there
any way to do that ?
Of course the goal is to let Apache serve static content while Tomcat serves
dynamic content but I want the home page to be a jsp file without having to
create or to show a sub directory (web app).

Thanks for any hint.
---
Pascal-Eric Servais ( http://pages.infinit.net/denethor )
www.clickon.com
---
PGP Fingerprint : 8D0C FB66 CAF0 B9B3 E925  8D2E 7BDB 1D47 DC0B 4AEA
"La carte n'est pas le territoire", Alfred H. Korzybski

Re: Tomcat ROOT == Apache Root

Posted by Steve Weiland <sw...@viatraining.com>.
This is what I'm doing.

Perhaps this will be somewhat helpful, I hope not annoying.

The docroot is the context.
Static html, images, pdf's and for me php go to apache.
*.jsp and mounted servlets go to tomcat.
It's nice because the jsp/servlet subrequests [images etc]get handled by
apache.

I run name based virtual hosts thru apache each one of which gets its own
jvm/instance of tomcat.
I plop the servlet mount directives in in the virtual host directives and
inform apache what port to
connect to tomcat thru.

One can even modify the tomcat shell script to start / stop all the tomcat
instances.
I then include this file with the other glorious sys V init scripts and viola
it all starts
when I reboot the machine.

I am actually quite thrilled with the setup and tomcat on whole.

But I prattle, here are the pertinant entries in the various con files.

server.xml:
*snip*

        <Context path="" docBase="/path/to/apachesorvhosts/htdocs/" debug="0"
reloadable="true" >
        </Context>

*snip*


httpd.conf:
-----------------------------------

*snip*

LoadModule jserv_module libexec/mod_jserv.so

<IfModule mod_jserv.c>
ApJServManual on
ApJServDefaultProtocol ajpv12
ApJServSecretKey DISABLED
ApJServMountCopy on
ApJServLogLevel notice

ApJServDefaultPort 8007

ApJServMount default /root
AddType test/jsp .jsp
AddHandler jserv-servlet .jsp

*snip*

# this I enclude in th vhost sections.

<location /WEB-INF/>
  AllowOverride None
  deny from all
</location>

# I use this for the mvc jsp's.
<location /jsp/>
  AllowOverride None
  deny from all
</location>

## this is a full url mount on this servlet
  ApJServMount /Foo ajpv12://localhost:8007/root


web.xml:
--------------------------------------------

*snip*

   <servlet>
      <servlet-name>
          Foo
      </servlet-name>
      <servlet-class>
          Foo
      </servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>
            Foo
        </servlet-name>
        <url-pattern>
           /Foo
        </url-pattern>
    </servlet-mapping>

*snip*



Michael Percy wrote:

> This is what everyone [or just about everyone] wants to do with their
> systems... I believe an real-world example of this is an imperative for
> Tomcat's deployment-level documentation.
>
> Mike
>
> -----Original Message-----
> From: Pascal-Eric Servais [mailto:pascal-eric@videotron.ca]
> Sent: Monday, September 25, 2000 4:05 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Tomcat ROOT == Apache Root
>
> Hi ! I want Tomcat ROOT to be equivalent to Apache root (htdocs). Is there
> any way to do that ?
> Of course the goal is to let Apache serve static content while Tomcat serves
> dynamic content but I want the home page to be a jsp file without having to
> create or to show a sub directory (web app).
>
> Thanks for any hint.
> ---
> Pascal-Eric Servais ( http://pages.infinit.net/denethor )
> www.clickon.com
> ---
> PGP Fingerprint : 8D0C FB66 CAF0 B9B3 E925  8D2E 7BDB 1D47 DC0B 4AEA
> "La carte n'est pas le territoire", Alfred H. Korzybski


Re: Tomcat ROOT == Apache Root

Posted by greg <em...@gregorybittar.com>.
Including tomcat-apache.conf has not worked for me either, but Apache seems
to work well when I include tomcat.conf instead.

Nick Holloway wrote:

> ......
>
> I personally don't include "tomcat-apache.conf" into the Apache
> "httpd.conf", because I was moving from a JServ setup, and I think
> there is a bug in 3.1 where the docBase specified in the Context is not
> reflected in the directories emitted in the Apache directives.


Re: Tomcat ROOT == Apache Root

Posted by Nick Holloway <Ni...@alfie.demon.co.uk>.
mpercy@portera.com (Michael Percy) writes:
> This is what everyone [or just about everyone] wants to do with their
> systems... I believe an real-world example of this is an imperative for
> Tomcat's deployment-level documentation.

In "server.xml", point the root context at the same directory as your
Apache document root:

    <Context path="" docBase="C:/Program Files/Apache Group/Apache/htdocs"
    debug="1" reloadable="true">
    </Context>

I personally don't include "tomcat-apache.conf" into the Apache
"httpd.conf", because I was moving from a JServ setup, and I think
there is a bug in 3.1 where the docBase specified in the Context is not
reflected in the directories emitted in the Apache directives.

The keys bits (apart from all of the ApJ* settings) from my Apache
"httpd.conf":

    To have JSP pages passed to Tomcat:

	AddType test/jsp .jsp
	AddHandler jserv-servlet .jsp

    To have "index.jsp" to be used as the directory index page:

	DirectoryIndex index.jsp index.html

If you do have a "WEB-INF" directory, then you will need to add the rules
for denying access, as this is also not put into the apache-tomcat.conf
for the <Context path="" ...>.

-- 
 `O O'  | Nick.Holloway@pyrites.org.uk
// ^ \\ | http://www.pyrites.org.uk/

RE: Tomcat ROOT == Apache Root

Posted by "Rob S." <rs...@home.com>.
To get me started on updating the Apache HOWTO, what's the "right" way to do
it? =)

(Briefly, I'll expand)

- r

> -----Original Message-----
> From: Nick Bauman [mailto:nick@cortexity.com]
> Sent: October 1, 2000 10:20 PM
> To: 'tomcat-dev@jakarta.apache.org'
> Cc: 'tomcat-user@jakarta.apache.org'
> Subject: RE: Tomcat ROOT == Apache Root
>
>
> Agreed,
>
> However, there are, IMO, "right" ways to do it and "wrong" ways. It would
> be important to show the "right" way to do it.
>
>
> On Mon, 25 Sep 2000, Michael Percy wrote:
>
> > This is what everyone [or just about everyone] wants to do with their
> > systems... I believe an real-world example of this is an imperative for
> > Tomcat's deployment-level documentation.
> >
> > Mike
> >
> > -----Original Message-----
> > From: Pascal-Eric Servais [mailto:pascal-eric@videotron.ca]
> > Sent: Monday, September 25, 2000 4:05 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Tomcat ROOT == Apache Root
> >
> >
> > Hi ! I want Tomcat ROOT to be equivalent to Apache root
> (htdocs). Is there
> > any way to do that ?
> > Of course the goal is to let Apache serve static content while
> Tomcat serves
> > dynamic content but I want the home page to be a jsp file
> without having to
> > create or to show a sub directory (web app).
> >
> > Thanks for any hint.
> > ---
> > Pascal-Eric Servais ( http://pages.infinit.net/denethor )
> > www.clickon.com
> > ---
> > PGP Fingerprint : 8D0C FB66 CAF0 B9B3 E925  8D2E 7BDB 1D47 DC0B 4AEA
> > "La carte n'est pas le territoire", Alfred H. Korzybski
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
>
> --
> Nicolaus Bauman
> Software Engineer
> Simplexity Systems
> I'll give you $5 if you follow this link:
> https://secure.paypal.x.com/refer/pal=nixnixnix%40yahoo.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>


RE: Tomcat ROOT == Apache Root

Posted by Nick Bauman <ni...@cortexity.com>.
Agreed,

However, there are, IMO, "right" ways to do it and "wrong" ways. It would
be important to show the "right" way to do it.


On Mon, 25 Sep 2000, Michael Percy wrote:

> This is what everyone [or just about everyone] wants to do with their
> systems... I believe an real-world example of this is an imperative for
> Tomcat's deployment-level documentation.
> 
> Mike
> 
> -----Original Message-----
> From: Pascal-Eric Servais [mailto:pascal-eric@videotron.ca]
> Sent: Monday, September 25, 2000 4:05 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Tomcat ROOT == Apache Root
> 
> 
> Hi ! I want Tomcat ROOT to be equivalent to Apache root (htdocs). Is there
> any way to do that ?
> Of course the goal is to let Apache serve static content while Tomcat serves
> dynamic content but I want the home page to be a jsp file without having to
> create or to show a sub directory (web app).
> 
> Thanks for any hint.
> ---
> Pascal-Eric Servais ( http://pages.infinit.net/denethor )
> www.clickon.com
> ---
> PGP Fingerprint : 8D0C FB66 CAF0 B9B3 E925  8D2E 7BDB 1D47 DC0B 4AEA
> "La carte n'est pas le territoire", Alfred H. Korzybski
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 

-- 
Nicolaus Bauman
Software Engineer
Simplexity Systems
I'll give you $5 if you follow this link:
https://secure.paypal.x.com/refer/pal=nixnixnix%40yahoo.com



RE: Tomcat ROOT == Apache Root

Posted by Nick Bauman <ni...@cortexity.com>.
Agreed,

However, there are, IMO, "right" ways to do it and "wrong" ways. It would
be important to show the "right" way to do it.


On Mon, 25 Sep 2000, Michael Percy wrote:

> This is what everyone [or just about everyone] wants to do with their
> systems... I believe an real-world example of this is an imperative for
> Tomcat's deployment-level documentation.
> 
> Mike
> 
> -----Original Message-----
> From: Pascal-Eric Servais [mailto:pascal-eric@videotron.ca]
> Sent: Monday, September 25, 2000 4:05 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Tomcat ROOT == Apache Root
> 
> 
> Hi ! I want Tomcat ROOT to be equivalent to Apache root (htdocs). Is there
> any way to do that ?
> Of course the goal is to let Apache serve static content while Tomcat serves
> dynamic content but I want the home page to be a jsp file without having to
> create or to show a sub directory (web app).
> 
> Thanks for any hint.
> ---
> Pascal-Eric Servais ( http://pages.infinit.net/denethor )
> www.clickon.com
> ---
> PGP Fingerprint : 8D0C FB66 CAF0 B9B3 E925  8D2E 7BDB 1D47 DC0B 4AEA
> "La carte n'est pas le territoire", Alfred H. Korzybski
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 

-- 
Nicolaus Bauman
Software Engineer
Simplexity Systems
I'll give you $5 if you follow this link:
https://secure.paypal.x.com/refer/pal=nixnixnix%40yahoo.com