tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Eggers <its_toas...@yahoo.com>
Subject Re: Why doesn't my context work?
Date Thu, 29 Sep 2005 19:45:22 GMT
--- Michael Sullivan <michael@espersunited.com> wrote:

[ lots of stuff snipped ]

OK, I finally got around to putting this together on
my Limux (Fedora Core 4) box.

My environment:
2.6.12-1.1456_FC4 running on a Dell 8200 with 768 MB
java 1.5.0_04-b05
apache 2.0.54
mod_jk 1.2.14.1
tomcat 5.5.9

My configurations:

#
# httpd.conf stuff
#
LoadModule        jk_module modules/mod_jk.so

JkWorkersFile     /etc/httpd/conf/workers.properties
JkLogFile         logs/mod_jk.log
JkLogLevel        warn
JkLogStampFormat  "[%a %b %d %H:%M:%S %Y] "
JkShmFile         logs/shm-file

LoadModule userdir_module modules/mod_userdir.so
<IfModule mod_userdir.c>
    UserDir enable username
</IfModule>

<Directory /home/*/webspace>
  AllowOverride FileInfo AuthConfig Limit
  Options MultiViews Indexes SymLinksIfOwnerMatch
IncludesNoExec
    <Limit GET POST OPTIONS>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>

#
# Adding JkMounts for UserDir
#
JkMount /~*/*.jsp     local
JkMount /~*/*/*.jsp   local
JkMount /~*/servlet/* local
JkMount /~*/*.do      local

#
# workers.properties stuff - mostly default for now
#
worker.list=local

#
# one to serve the applications
#
worker.local.type=ajp13
worker.local.host=localhost
worker.local.port=8009

#
# server.xml stuff in Tomcat under <Host></Host>
#
<!-- adding listener to test local host directories
-->
<Listener 
  className="org.apache.catalina.startup.UserConfig"
  directoryName="webspace"
  userClass=
 "org.apache.catalina.startup.PasswdUserDatabase"/>

NOTES
=====
httpd.conf
----------
1. Add the appropriate user names in the line:

    UserDir enable username

This is a space-separated list of user names. 
Otherwise you can just have:

UserDir enabled

to get them all.

2. Excuse the wrapping in the Options line under the
Directory directive.

workers.properties
------------------
This is just a bare bones one.  There are lots of
options to explore.

server.xml
----------
This is the listener that will add the same directory
to Tomcat that was added to Apache with the userdir
module.

RESULTS
=======
You will get a single web application under
/~username.  If you look at Tomcat's manager
application, you will see a /~username application.

I ran the first application from the "Head First
Servlets & JSP" book (my standard "is it working"
application) and this setup worked.

One thing to note.  I did not get Tomcat to explode a
war file in /~username.  I had to explode the war
manually in ~username/webspace.

I didn't see a way of adding multiple user
applications by using this listener.  I just did a
quick scan of the UserConfig javadoc.  My guess is
that if you want multiple web applications per user
you will have to set up a virtual host for each user.

Just some thoughts.

HTH

/mde/


	
		
______________________________________________________ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message