tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alon Marom <al...@cti2.com>
Subject RE: Execute JSP's in a different directory - sans-examples.
Date Tue, 31 Oct 2000 10:49:53 GMT


-----Original Message-----
From: Kitching Simon [mailto:Simon.Kitching@orange.ch]
Sent: Tuesday, October 31, 2000 10:24 AM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: Execute JSP's in a different directory - sans-examples.


Hi Sterling,

Basically, your description of the process to set 
up a new webapp below is correct.

I suggest that you consider this process as
having two parts:
(a) setting up tomcat
(b) setting up apache

You can configure tomcat, then check that it
is all correct by using tomcat's http port (default
port = 8080). Once this works, then try setting
up apache to pass on the relevant requests
to tomcat. Setting up apache causes lots of
people headaches, so I really recommend
making sure it works with plain tomcat first.

Tomcat 4.0 will apparently remove the need to
configure apache; tomcat will be able to tell
apache about what urls it wishes to handle.
This is not the case for tomcat3.1/3.2 though,
unfortunately.

[more comments embedded below]

Regards,

Simon

> -----Original Message-----
> From:	Sterling [SMTP:smullett@omeninc.com]
> Sent:	Monday, October 30, 2000 11:39 PM
> To:	Tomcat-user
> Subject:	Execute JSP's in a different directory - sans-examples.
> 
> H-
> 
> I've been poking around the docs and archives for this list and from
> what I see there isn't a simple way to make this happen.
> Set up another directory that will execute JSP files without having to
> go through examples. (And from what I've seen this directory cannot be
> inside the httpd/htdocs directory either. True?)
> 
> For example:
> Add to tomcat-apache.conf file:
> ApJServMount /MYDIRECTORY ajpv12://127.0.0.1:8007
> 
> Create a directory inside
> /usr/local/tomcat/webapps/MYDIRECTORY
	[Kitching Simon]  
	Well, you can put your document root anywhere. If it is under
	webapps, then you don't need to tweak the server.xml file
	manually, but you do have to live with the /MYDIRECTORY
	prefix for each url. The alternative is to edit $TOMCAT_HOME/
	server.xml, and define a <context>, with docRoot set to
	any directory you want. Tomcat3.2 also comes with an
	admin utility to define new contexts via a web page, but I 
	haven't tried this myself...

> Create all the special JSP files and dirs in that directory
> META-INF, WEB-INF, images, jsp, servlets.
	[Kitching Simon]  
	Well, yeah. If you want to serve files to a browser, you 
	need to put the pages somewhere...

> Now modify the web.xml file inside WEB-INF to include every servlet that
> I'm going to use. When I create another servlet I must re-edit this file
> to include that servlet than reload Tomcat, Restart Apache.
	[Kitching Simon]  
	If you are happy to have servlets which are accessed via the url
	/web-app-name/servlet/servlet-class-name, and you don't
	need any special parameters to be passed to the servlets, then
	you can use the default mapping [you still need to tell apache
	that /web-app-name/servlet/... is to be handled by tomcat].
	But if you want servlets to be executed by urls that don't
	have a particular prefix, or you want servlet init parameters,
	then yes you need a servlet entry in web.xml for each servlet.
	I really can't see how else it could be done...until we get that
	telepathic interface I've been waiting for.

> This can't be right. This is a lot of configuring just to pull up
> http://www.myserver.net/MYDIRECTORY
> and have it pull and executes JSP files.
> 
	[Kitching Simon]  
	No, if you just want to execute JSP files, it is quite simple. No
	WEB-INF directory is needed, no web.xml, etc.
	If you want *servlets* as well, then it gets a bit more complicated.
	I suggest that it is no more complicated than ASP+COM, or PHP.

> Is this the only way (did I even get it right?) or am I reading the
> wrong information?
> 
> Thanks for any thoughts or insights you might have.
> -Sterling
> 

Mime
View raw message