----- Original Message -----
From: "Cristian Bullokles" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Monday, May 19, 2008 4:34 AM
Subject: Re: Deploying Servlets in users directory
On Sun, May 18, 2008 at 9:25 PM, Johnny Kewl <[EMAIL PROTECTED]> wrote:
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
My idea is to deploy servlets in the public_html directory of each
user in my host.
I've configured my tomcat, as the tomcat documentation suggests.
Using that configuration:
<Host name="localhost" ...>
...
<Listener className="org.apache.catalina.startup.UserConfig"
directoryName="public_html"
userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
...
</Host>
This configuration works fine and when I copy a file for example
hello.jsp in my public_html dir.
It works using that url: http://localhost:8080/~cbullokl/hello.jsp.
But when I copy a war file in my home directory it doesn't works.
Any suggestion?
Cristian
Its the stuff inside the WAR... you need to unpack it, rename to zip and
get
the stuff inside.
Before you do that... have a look at the examples that are already
installed
with Tomcat... there are some JSP and Servlet examples in tomcat/webapps
Just copy the stuff inside there... and test.
If its all working then try unpack the war and also do it.
Or drop the war into webapps and it will unpack, then copy that stuff
inside.
I'm not sure how good TC is outside of webapps when it comes to deploying
to
the ~user thing.
So I think you going to find that anything that works well from the
default
servlet works well... but servlets may be tricky.
Like if you dropped new servlets in while TC was running... I dont think
it
will detect it... not without restarting TC... so I think there are
issues
if its not simple JSP or html pages... like what happens if you have 10
webapps... they all overlay... its for simple stuff.
good luck ;)
Johnny,
When you drop a new servlet(.war) in webapps dir while TC is
running that .war file is unpackaged and deployed in tomcat, and you
could use it without restart TC.
Yes, that what I'm trying to say... its auto deploying.
But you cant do that in the ~user/public_html/THE UNPACKED WAR
You have to unpack it and stick it there yourself
So, I think if you changed it... you would have to reload the ~user folder
from http://localhost:8080/manager/html
And no... I dont think you can have multiple web-apps.... TC see's the ~user
folder as just one webapp
And I think that the TC Servlet examples work... because all the servlet
examples are called from a static page.
But if I remember... calling the servlet directly /~user/myservlet.... did
not work...
Its mimicing the typical static sites SP's give a user when they get an
account...
The user lays out a site, then FTP's it up.
It runs html and TC also allows JSP, and if there are servlets there they
utils, like site counters... that "you" put there.
Because as soon as the user touches a servlet... it has to be redeployed...
TC will not detect a new FTP's up servlet.
So... now what?
If you want to make every user have mini TC in their user folder, then you
have to get creative with that first deployment method I showed you.
Effectively it means making a special deployment web page for each user...
and that method then does not use the ~user... even though the webapps
are in the user folder... it works just like tomcat proper.... so user can
make lots of full webapps... but they have to be deployed thru your admin
page.
~user is just for simple user sites... I think
I've copied all servlets examples in default installation to my
home dir, and all jsp pages work, but when I call to a servlet it
fails, also if i drop a zip or a war or a folder containing a servlet
also doesn't works.
Yes thats what I found too... but the servlets do work if called from a html
page like in servlet_examples... so there is some unusual servlet mapping
going in inside TC.... good for a web counter, "not good" for powerful
web-apps.... I think
Another question:
Can I have multple webapps folders in my tomcat installation?
No... because you unpacking and they all overlay... its really just one
web-app
Have a look at what you got working in http://localhost:8080/manager/html
I think you will see.... just one web app per user... you seem to be wanting
to emulate a TC for each user... ~user is not going to do that for you.
Have fun ;)
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]