You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Martin Decker <ma...@fh-sbg.ac.at> on 2000/04/07 23:22:43 UTC

tomcat context problem (php+apache+tomcat)

Hello,

I have an apache 1.3.12 with php 3.0.15, php2.0.1 and tomcat 3.1beta.
I installed it like in the howto-file, but encountered the following problems:

1) In httpd.conf of apache, do I have to include tomcat.conf or 
tomcat-apache.conf ??
I want to use tomcat for jsp-only, other pages, such as static, php2 or 
php3 should
be executed by apache.

2) I have a problem setting up a context and could not find the appropriate 
info
neither in the manual, nor in the howto. The section about "contexts" in 
the manual
is too hard to follow, as is the howto.

I would greatly appreciate any help on the context problem:

I want to set up tomcat to execute every file with .jsp, independent of 
where the file is stored.

How can I do that?

3) How can I set a virtualhost in the httpd.conf and set the documentroot 
to a site containing a jsp project?

Thanks a lot,

Martin Decker
*****************************************
Martin Decker, martin.decker@fh-sbg.ac.at
Telekommunikationstechnik und -systeme
Fachhochschule Salzburg
Jakob-Haringer-Str. 1a/II/12
Tel. 0664 5775697


Re: tomcat context problem (php+apache+tomcat)

Posted by "Alexey V. Meledin" <av...@webclub.ru>.
Hi,
    Martin!

    There is my suggestions:

MD> I have an apache 1.3.12 with php 3.0.15, php2.0.1 and tomcat 3.1beta.
MD> I installed it like in the howto-file, but encountered the following problems:

MD> 1) In httpd.conf of apache, do I have to include tomcat.conf or 
MD> tomcat-apache.conf ??
MD> I want to use tomcat for jsp-only, other pages, such as static, php2 or 
MD> php3 should
MD> be executed by apache.
I only say, that if you mount a Context, then all requests are going
to Tomcat. So If you mount ApjSevount /myjsp /myjsp
Then http://host/myjsp/myphp.phtml will goes to Tomcat, that can't
understand PHP scripts. :)
So, myjsp Context is only for Servlets and JSP.

MD> 2) I have a problem setting up a context and could not find the appropriate 
MD> info
MD> neither in the manual, nor in the howto. The section about "contexts" in 
MD> the manual
MD> is too hard to follow, as is the howto.
There is a Minimalistic Users Guide. It says that full information
about contexts and Web-application structure you can find in Servlet
Specification at java.sun.com .
Specification describes what is Context and many other things. Read it
carefully.

MD> I would greatly appreciate any help on the context problem:

MD> I want to set up tomcat to execute every file with .jsp, independent of 
MD> where the file is stored.
MD> How can I do that?
:) I tried either. For me it works only inside Context (inside
http://host/myjsp/) . May be it's possible to start it elsewhere, but
I'm not sure. Possibly you can rewrite all .jsp URIs to appropriate
URIs starting with "/myjsp".
For security reasons (correct me, please) I map examples Context like:
ApJServMount /examples/servlet /examples
ApJServMount /examples/jsp /examples
#And ad
<Location /examples/WEB-INF >
AllowOverride None
order deny,allow
deny from all
</Location>



MD> 3) How can I set a virtualhost in the httpd.conf and set the documentroot 
MD> to a site containing a jsp project?
See Minimalistic Users Guide
http://jakarta.apache.org/cvsweb/index.cgi/jakarta-tomcat/src/doc/uguide/tomcat_ug.html?rev=1.6&content-type=text/x-cvsweb-markup
PS: But the decision is not elegant (one JVM per Vhost), so it's way
to make several unique contexts for each Vhost and ApjServMount it
under each Vhost. (then it possible to rewrite URIs to standart
mappings, like http://vhost/jsp (this is my suggestion, only).

Alexey V. Meledin <av...@webclub.ru>
> InterForge Developers Group,  St-Petersburg, Russia
New: http://www.crossroad.ru; http://www.garoway.com
> > > > > > "InterForge to Forge Ahead" > > > > > > >