You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by migar <mi...@yahoo.com> on 2004/12/07 19:03:44 UTC
sharing apache DocumentRoot with tomcat webapp directory, serving .jsps via mod_jk
Hi -
I would like to set up my Apache2/Tomcat4.1 server so
that my domain root the.domain.com will point directly
to a Tomcat non-default webapp which contains static
HTML pages, jsp, servlets etc. In this scenario, I
have set up Apache with a VirtualHost whose
DocumentRoot is the directory location of my Tomcat
webapp (which resides outside of Tomcat's webapp
directory and is referenced with an XML context file
in the webapp directory.) I am using mod_jk to allow
Tomcat to serve all of the non-static content. Here's
what my mod_jk.conf file looks like, roughly:
<VirtualHost *:80 >
ServerName the.domain.com
DocumentRoot "C:/some/directory"
JkMount /*.jsp ajp13
</VirtualHost>
There are no servlets or anything that need to be
mapped to a URI. Within this webapp's context
container is:
<Context path="thePath" docBase="C:/some/directory"
crossContext="false" override="true"
reloadable="true"
useNaming="true" debug="0" privileged="false"
swallowOutput="false">
</Context>
My problem is that I don't want to eliminate the path
attribute of this webapp in order for the .jsp pages
to be served - my JkMount directive is telling Tomcat
to only serve jsps that are within the default webapp
(ie ROOT), and if I want to access this webapp without
any additional path info in the URI (ie.
the.domain.com/thePath). Is there a way to use
JkMount to append this path information to give to
Tomcat so it knows where to look for the jsps for this
webapp as opposed to looking in the default webapp? I
can't just set this webapp as default by eliminating
the path attribute in it's context element because
their are other resources on the server that need to
be accessed via the ROOT webapp that i want to leave
alone.
I know that their has to be an easy configuraton
technique that I'm missing to do this, and I was
hoping that someone might be able to point this out to
me.
TIA,
Migar
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: sharing apache DocumentRoot with tomcat webapp directory, serving .jsps via mod_jk
Posted by migar <mi...@yahoo.com>.
JkAutoAlias does not seem to produce the results that I was looking
for. I need some way to pass information to Tomcat as part of the
JkMount /*.jsp ajp13
about the particular webapp which this VirtualHost is serving. The
alias doesn't appear to give Tomcat any info about the Context path of
the webapp (/mywebapp) for example, which would be accessed via:
the.domain.com/mywebapp
in a more straightforward setup. Tomcat is still looking in the
default webapp (/ROOT) for my jsp page which is really in /mywebapp.
How can I append the context to the JkMount to get Tomcat to look in
the correct location so I dont have to use the URI:
the.domain.com/mywebapp/my.jsp
and use:
the.domain.com/my.jsp
instead?
Thanks for any help!
Migar
--- Mladen Turk <mt...@apache.org> wrote:
> migar wrote:
> >
> > I would like to set up my Apache2/Tomcat4.1 server so
> > that my domain root the.domain.com will point directly
> >
> <VirtualHost *:80 >
> ServerName the.domain.com
> DocumentRoot "C:/some/directory"
> #Add the auto aliasing here
> JkAutoAlias C:/some/directory
> JkMount /*.jsp ajp13
> </VirtualHost>
>
>
>
> MT.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: sharing apache DocumentRoot with tomcat webapp directory, serving .jsps via mod_jk
Posted by migar <mi...@yahoo.com>.
Well, I must have been using an older mod_jk version perhaps before
this was supported, I guess.... although I am still unclear about
whether the JkAutoAlias should go to Tomcat's webapps directory (where
I have my webapp's context XML definition file located) or if I should
just point it to the actual directory location of my webapp (which is
outside of Tomcat's install directory on the filesystem). In any
case, at least Apache is accepting the JkAutoAlias now, I think I just
need to complete a few more config steps to get it all going - Tomcat
is still giving a 404 for my .jsp file in the webapp.
Thanks for the help,
Migar
--- Mladen Turk <mt...@apache.org> wrote:
> migar wrote:
> > Keep getting error message when restarting Apache
> > after adding the JkAutoAlias directive. I don't know
> > if it's a syntactical thing or if I need to explicitly
> > give apache access to this directory somewhere? Is
> > there a syntactical modification necessary if the
> > server is running Windows? Or can I not add this
> > directive inside a Virtualhost?
> >
>
> Which version of mod_jk are you using?
> Also the JkAutoAlias should point to Tomcat's webapp directory,
> that need to have WEB-INF, etc...
>
> MT.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: sharing apache DocumentRoot with tomcat webapp directory, serving
.jsps via mod_jk
Posted by Mladen Turk <mt...@apache.org>.
migar wrote:
> Keep getting error message when restarting Apache
> after adding the JkAutoAlias directive. I don't know
> if it's a syntactical thing or if I need to explicitly
> give apache access to this directory somewhere? Is
> there a syntactical modification necessary if the
> server is running Windows? Or can I not add this
> directive inside a Virtualhost?
>
Which version of mod_jk are you using?
Also the JkAutoAlias should point to Tomcat's webapp directory,
that need to have WEB-INF, etc...
MT.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: sharing apache DocumentRoot with tomcat webapp directory, serving .jsps via mod_jk
Posted by migar <mi...@yahoo.com>.
Keep getting error message when restarting Apache
after adding the JkAutoAlias directive. I don't know
if it's a syntactical thing or if I need to explicitly
give apache access to this directory somewhere? Is
there a syntactical modification necessary if the
server is running Windows? Or can I not add this
directive inside a Virtualhost?
Thanks
--- Mladen Turk <mt...@apache.org> wrote:
> migar wrote:
> >
> > I would like to set up my Apache2/Tomcat4.1 server
> so
> > that my domain root the.domain.com will point
> directly
> >
> <VirtualHost *:80 >
> ServerName the.domain.com
> DocumentRoot "C:/some/directory"
> #Add the auto aliasing here
> JkAutoAlias C:/some/directory
> JkMount /*.jsp ajp13
> </VirtualHost>
>
>
>
> MT.
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
>
>
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: sharing apache DocumentRoot with tomcat webapp directory, serving
.jsps via mod_jk
Posted by Mladen Turk <mt...@apache.org>.
migar wrote:
>
> I would like to set up my Apache2/Tomcat4.1 server so
> that my domain root the.domain.com will point directly
>
<VirtualHost *:80 >
ServerName the.domain.com
DocumentRoot "C:/some/directory"
#Add the auto aliasing here
JkAutoAlias C:/some/directory
JkMount /*.jsp ajp13
</VirtualHost>
MT.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org