You might try writing some script they can use that will create a
symlink in the webapps directory to their home directory:
#!/bin/csh
# do whatever needed to write to directory and read or prompt for user
directory
# maybe some other logging or setup ???
cd /usr/local/tomcat/webapps
#create symlink to userdir
ln -s /home/user/dirname dirname
#wait for tomcat to load
sleep 10
exit
Then tomcat will load this as a webapp providing ofcourse that the
directory structure the link is pointing to is a true webapp (containing
WEB-INF, WEB-INF/lib, WEB-INF/classes) directories
Ofcourse, if you are using apache on port 80, and using jk, you will
have to write a script to add the jk-mount as well
Mike Sabroff
Web Services
Developer
[EMAIL PROTECTED]
920-568-8379
Darryl Miles wrote:
Robert Frank wrote:
I'm trying to set up the standalone server such that users can
install and deply webapplications in their home directory (this
is for a lab).
Heh... Container stability during development for a single user is
hard enough than to have to worry about what your other lab students
are doing at the same time.
The general get-out when you first find a problem that isn't an
obvious programming error is to restart the container and re-test the
situation.
Maybe you'd be better off teaching students how to use Eclipse and
manage their own Tomcat instance from within it. But to use Eclipse
you'd need PCs of half decent spec with a little more RAM on board.
Sorry I don't have an answer to your request, and whatever I do say
has more bearing on TC 5.5.x than 5.0.x. But my understanding is that
there is a single deployment directory folder per virtual hostname.
So if you wanted to give each student/computer their own workspace
maybe you could setup DNS to point lab01host001.tomcat.mydomain.com to
the same IP address.
Then setup <Host> directives in conf/server.xml like:
<Host name="lab01host001.tomcat.mydomain.com"
appBase="/opt/website/lab01host001.tomcat.mydomain.com/tomcat/webapps"
workDir="/opt/website/lab01host001.tomcat.mydomain.com/tomcat/work"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
To setup each lab users workspace use:
mkdir /opt/website/lab01host001.tomcat.mydomain.com/tomcat
mkdir /opt/website/lab01host001.tomcat.mydomain.com/tomcat/work
mkdir /opt/website/lab01host001.tomcat.mydomain.com/tomcat/webapps
# chown the "work" folder to the same user the TC JVM instance runs as:
chown jakarta.jakarta
/opt/website/lab01host001.tomcat.mydomain.com/tomcat/work
chmod 775 /opt/website/lab01host001.tomcat.mydomain.com/tomcat/work
# chown the "webapps" folder to the same user as the student that is
allowed to deploy, but also give the TB JVM instalce group permission
to write too.
chown student0123.jakarta
/opt/website/lab01host001.tomcat.mydomain.com/tomcat/webapps
chmod 775 /opt/website/lab01host001.tomcat.mydomain.com/tomcat/webapps
# deploy your webapp and access as:
http://lab01host001.tomcat.mydomain.com/
cp ROOT.war
/opt/website/lab01host001.tomcat.mydomain.com/tomcat/webapps/ROOT.war
# or under a context and access as:
http://lab01host001.tomcat.mydomain.com/student0123/
cp student0123.war
/opt/website/lab01host001.tomcat.mydomain.com/tomcat/webapps/student0123.war
# You may wish to create inside your WAR the file META-INF/context.xml
for any context specific parameters. See TC documentation.
You'd still need to give the students the ability to shutdown and
restart the container themselves, it really is a necessary requirement
to successfully develop with TC. More so if you are a student and
don't understand anything to begin with and need to learn from making
as many mistakes as possible.
HTH
Darryl
Following the instructions of the documentation (for 5.0),
I found the topic 'User Web Applications' in the host container
documentation. The doc states:
'If a user home directory has been set up for a user named
craigmcc, then its contents will be visible from a client browser
by making a request to a URL like:'
which is the behaviour I get. I.e., it will only list the contents of
the directories and return files if selected. The doc then goes on:
'Successful use of this feature requires recognition of the
following considerations:
Each user web application will be deployed with characteristics
established by any DefaultContext element you have configured
for this Host.'
Which tells me that user applications are *deployed* - but how?
No matter what applictaion I put into the user's webapp directory
(given as attribute to the Listener tag), it is never deployed, but if I
put it into the webapp of the tomcat home, then it will be deployed.
The logs state:
catalina.out:
4-May-06 11:50:37 AM org.apache.catalina.startup.ContextConfig
applicationConfig()
INFO: Missing application web.xml, using defaults only
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/~unilogon]
Okay, so where should this web.xml be put? Into the same directory
given in the directoryName attribute of the Listener tag?
and localhost_log.2006-05-04.txt:
2006-05-04 11:50:34 UserConfig[localhost]: UserConfig: Processing START
2006-05-04 11:50:34 UserConfig[localhost]: Deploying user web
applications
2006-05-04 11:50:36 UserConfig[localhost]: Deploying web application
for user unilogon
which make me think all's ok, but it isn't.
What am I missing?
many thanks in advance, Robert
Departement Informatik FGB tel +41 (0)61 267 14 66
Universit�t Basel fax. +41 (0)61 267 14 61
Robert Frank
Klingelbergstrasse 50 [EMAIL PROTECTED]
CH-4056 Basel
Switzerland
http://www.informatik.unibas.ch/personen/frank_r.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]