You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Doug Tucker <tu...@lyle.smu.edu> on 2014/04/11 16:33:03 UTC

mod_jk and ~userdir issue

Greetings!  I'm hopeful someone can help me here.  I used to have this 
running under tomcat 5.5/apache2.2 but have installed a centos6 with the 
packaged tomcat6/apache2.2.  I installed the latest mod_jk connector.  
All is working great except the whole reason I set it up in the first 
place.  I want users to be able to place .jsp's and servlets in their 
public_html directory and have it serve their pages.  As I mentioned I 
had this working previously under a different version and kept a backup 
of all those files for reference but I can't get it working on this new 
instance to save my life.

I added this into my Host directive in the servers.xml file per the 
tomcat6 docs

<Host name="localhost" ...>
   ...
   <Listener className="org.apache.catalina.startup.UserConfig"
             directoryName="public_html"
             userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
   ...
</Host>


https://tomcat.apache.org/tomcat-6.0-doc/config/host.html

This made it work under my old setup but not anymore.

My workers.properties looks like:

worker.list=worker1
worker.node1.type=ajp13
worker.node1.port=8009
worker.node1.host=localhost
worker.node1.lbfactor=1

My uriworkermap.properties looks like:

/admin/*=worker1
/manager/*=worker1
/jsp-examples/*=worker1
/servlets-examples/*=worker1
/examples/*=worker1
/*=worker1
!/servlets-examples/*.jpeg=lb
/jk-manager=jk-status

My httpd-jk.conf:

LoadModule jk_module modules/mod_jk.so
  JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkShmFile logs/mod_jk.shm
JkWatchdogInterval 60
JkMountFile conf/uriworkermap.properties

Thanks in advance to the group!

-- 
Sincerely,

Doug Tucker


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


Re: mod_jk and ~userdir issue

Posted by Doug Tucker <tu...@lyle.smu.edu>.
Ooops, I copied the wrong workers.properties file.  Here is the correct one

worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.lbfactor=1

Sincerely,

Doug Tucker

On 04/11/2014 09:33 AM, Doug Tucker wrote:
> Greetings! I'm hopeful someone can help me here.  I used to have this 
> running under tomcat 5.5/apache2.2 but have installed a centos6 with 
> the packaged tomcat6/apache2.2.  I installed the latest mod_jk 
> connector.  All is working great except the whole reason I set it up 
> in the first place.  I want users to be able to place .jsp's and 
> servlets in their public_html directory and have it serve their 
> pages.  As I mentioned I had this working previously under a different 
> version and kept a backup of all those files for reference but I can't 
> get it working on this new instance to save my life.
>
> I added this into my Host directive in the servers.xml file per the 
> tomcat6 docs
>
> <Host name="localhost" ...>
>   ...
>   <Listener className="org.apache.catalina.startup.UserConfig"
>             directoryName="public_html"
> userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
>   ...
> </Host>
>
>
> https://tomcat.apache.org/tomcat-6.0-doc/config/host.html
>
> This made it work under my old setup but not anymore.
>
> My workers.properties looks like:
>
> worker.list=worker1
> worker.node1.type=ajp13
> worker.node1.port=8009
> worker.node1.host=localhost
> worker.node1.lbfactor=1
>
> My uriworkermap.properties looks like:
>
> /admin/*=worker1
> /manager/*=worker1
> /jsp-examples/*=worker1
> /servlets-examples/*=worker1
> /examples/*=worker1
> /*=worker1
> !/servlets-examples/*.jpeg=lb
> /jk-manager=jk-status
>
> My httpd-jk.conf:
>
> LoadModule jk_module modules/mod_jk.so
>  JkWorkersFile conf/workers.properties
> JkLogFile logs/mod_jk.log
> JkLogLevel info
> JkShmFile logs/mod_jk.shm
> JkWatchdogInterval 60
> JkMountFile conf/uriworkermap.properties
>
> Thanks in advance to the group!
>


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


Re: mod_jk and ~userdir issue

Posted by Doug Tucker <tu...@lyle.smu.edu>.
> Sorry, I wrote that too quickly, just before packing in my laptop.
> It was "JkMountCopy", and you find it here :
> https://tomcat.apache.org/connectors-doc/reference/apache.html
>
> And since I sent you on a wrong track before, here is an explanation 
> as an apology :
>
> When your Apache httpd server is configured to handle VirtualHosts, 
> there are 2 parts to the configuration :
>
> 1) what is specified outside of the scope of any 
> <VirtualHost>..</VirtualHost> section, and which is sometimes referred 
> to as the "main" configuration.
> These directives act in fact as defaults for all <VirtualHost> 
> sections, unless they are overridden within any given <VirtualHost> 
> section.
>
> 2) what is specified inside a <VirtualHost> section, and affects only 
> this <VirtualHost>.
>
> The point is that the "JkMount" directives which you would specify in 
> the "main" configuration part, do not necessarily get "carried over" 
> to the <VirtualHost> sections as defaults. If you want this, you must 
> do something special.
> (JkMountCopy in either the "main" part, or in the <VirtualHost>, with 
> a slightly different syntax for each.)
>
> Similarly, any JkMount that is within a <VirtualHost> section, is 
> valid only for this <VirtualHost>.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
Ah, yes, thank you Andre.  I do understand this and do not have any 
virtual hosts set up in apache.  This is not a production box, just a 
dev box for students to practice writing jsp.  I wanted it as vanilla as 
possible, so everything applies only to the main section of the apache 
config.

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


Re: mod_jk and ~userdir issue

Posted by André Warnier <aw...@ice-sa.com>.
Doug Tucker wrote:
> 
>> He means : read on about the "JkCopy*" directives under Apache httpd.
>>
>>
>>
> Thank you.  I don't see this directive anywhere, and search google for 
> JkCopy apache or JkCopy tomcat both return zero results?
> 

Sorry, I wrote that too quickly, just before packing in my laptop.
It was "JkMountCopy", and you find it here :
https://tomcat.apache.org/connectors-doc/reference/apache.html

And since I sent you on a wrong track before, here is an explanation as an apology :

When your Apache httpd server is configured to handle VirtualHosts, there are 2 parts to 
the configuration :

1) what is specified outside of the scope of any <VirtualHost>..</VirtualHost> section, 
and which is sometimes referred to as the "main" configuration.
These directives act in fact as defaults for all <VirtualHost> sections, unless they are 
overridden within any given <VirtualHost> section.

2) what is specified inside a <VirtualHost> section, and affects only this <VirtualHost>.

The point is that the "JkMount" directives which you would specify in the "main" 
configuration part, do not necessarily get "carried over" to the <VirtualHost> sections as 
defaults. If you want this, you must do something special.
(JkMountCopy in either the "main" part, or in the <VirtualHost>, with a slightly different 
syntax for each.)

Similarly, any JkMount that is within a <VirtualHost> section, is valid only for this 
<VirtualHost>.


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


Re: mod_jk and ~userdir issue

Posted by Doug Tucker <tu...@lyle.smu.edu>.
> He means : read on about the "JkCopy*" directives under Apache httpd.
>
>
>
Thank you.  I don't see this directive anywhere, and search google for 
JkCopy apache or JkCopy tomcat both return zero results?


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


Re: mod_jk and ~userdir issue

Posted by André Warnier <aw...@ice-sa.com>.
Doug Tucker wrote:
> 
>>
>> 1. Check whether their pages are accessible when you connect to Tomcat
>> directly without HTTPD.
> Negative.  Either way I get the tomcat "container is not available".  
> You can see the error by going to:
> 
> http://webdev2.seas.smu.edu/~tuckerd/
>> The server.xml looks OK.
>> I am not sure that your mod_jk configuration is OK.
>>
>> 2. There are no "jsp-examples" and "servlet-examples" in Tomcat 6.
> Hmm..I installed yum install tomcat* and it installed some packages that 
> have them:
> 
> http://webdev2.seas.smu.edu/examples/servlets/
> 
> but no biggie, the fact that those work just lets me know tomcat is 
> working and I don't have a complete failure.
> 
>>
>> 3. Beware that in current mod_jk versions the mappings are local to a
>> HTTPD VirtualHost.
> Can you elaborate or point me to the doc?  I've read top to bottom the 
> last 2 days of the 6 docs and must have missed this.  Are you suggesting 
> if I create a virtual host in apache to the doc root the default is 
> currently pointing to (which is outside the userdir) it will help?  I 
> have a feeling I'm misunderstanding what you are saying.  My apologies.

He means : read on about the "JkCopy*" directives under Apache httpd.


> 
>>
>> 4. If you want Tomcat to be secure (and you do not trust your
>> students), you have to
> This is just for a classroom assignment and will go away as soon as 
> complete.  Thanks so much for that info though.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


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


Re: mod_jk and ~userdir issue

Posted by Doug Tucker <tu...@lyle.smu.edu>.
>
> 1. Check whether their pages are accessible when you connect to Tomcat
> directly without HTTPD.
Negative.  Either way I get the tomcat "container is not available".  
You can see the error by going to:

http://webdev2.seas.smu.edu/~tuckerd/
> The server.xml looks OK.
> I am not sure that your mod_jk configuration is OK.
>
> 2. There are no "jsp-examples" and "servlet-examples" in Tomcat 6.
Hmm..I installed yum install tomcat* and it installed some packages that 
have them:

http://webdev2.seas.smu.edu/examples/servlets/

but no biggie, the fact that those work just lets me know tomcat is 
working and I don't have a complete failure.

>
> 3. Beware that in current mod_jk versions the mappings are local to a
> HTTPD VirtualHost.
Can you elaborate or point me to the doc?  I've read top to bottom the 
last 2 days of the 6 docs and must have missed this.  Are you suggesting 
if I create a virtual host in apache to the doc root the default is 
currently pointing to (which is outside the userdir) it will help?  I 
have a feeling I'm misunderstanding what you are saying.  My apologies.

>
> 4. If you want Tomcat to be secure (and you do not trust your
> students), you have to
This is just for a classroom assignment and will go away as soon as 
complete.  Thanks so much for that info though.



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


Re: mod_jk and ~userdir issue

Posted by Konstantin Kolinko <kn...@gmail.com>.
2014-04-11 18:33 GMT+04:00 Doug Tucker <tu...@lyle.smu.edu>:
> Greetings!  I'm hopeful someone can help me here.  I used to have this
> running under tomcat 5.5/apache2.2 but have installed a centos6 with the
> packaged tomcat6/apache2.2.  I installed the latest mod_jk connector.  All
> is working great except the whole reason I set it up in the first place.  I
> want users to be able to place .jsp's and servlets in their public_html
> directory and have it serve their pages.  As I mentioned I had this working
> previously under a different version and kept a backup of all those files
> for reference but I can't get it working on this new instance to save my
> life.
>
> I added this into my Host directive in the servers.xml file per the tomcat6
> docs
>
> <Host name="localhost" ...>
>   ...
>   <Listener className="org.apache.catalina.startup.UserConfig"
>             directoryName="public_html"
>             userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
>   ...
> </Host>
>
>
> https://tomcat.apache.org/tomcat-6.0-doc/config/host.html
>
> This made it work under my old setup but not anymore.
>
> My workers.properties looks like:
>
> worker.list=worker1
> worker.node1.type=ajp13
> worker.node1.port=8009
> worker.node1.host=localhost
> worker.node1.lbfactor=1
>
> My uriworkermap.properties looks like:
>
> /admin/*=worker1
> /manager/*=worker1
> /jsp-examples/*=worker1
> /servlets-examples/*=worker1
> /examples/*=worker1
> /*=worker1
> !/servlets-examples/*.jpeg=lb
> /jk-manager=jk-status
>
> My httpd-jk.conf:
>
> LoadModule jk_module modules/mod_jk.so
>  JkWorkersFile conf/workers.properties
> JkLogFile logs/mod_jk.log
> JkLogLevel info
> JkShmFile logs/mod_jk.shm
> JkWatchdogInterval 60
> JkMountFile conf/uriworkermap.properties
>


1. Check whether their pages are accessible when you connect to Tomcat
directly without HTTPD.
The server.xml looks OK.
I am not sure that your mod_jk configuration is OK.

2. There are no "jsp-examples" and "servlet-examples" in Tomcat 6.

3. Beware that in current mod_jk versions the mappings are local to a
HTTPD VirtualHost.

4. If you want Tomcat to be secure (and you do not trust your
students), you have to

1) run it with Java SecurityManager being enabled
2) use latest patched JVM (with no known issues about bypassing a
SecurityManager)
3) use an up-to-date Tomcat

http://wiki.apache.org/tomcat/FAQ/Linux_Unix#Q5
http://tomcat.apache.org/security-6.html
http://tomcat.apache.org/tomcat-7.0-doc/security-howto.html

Best regards,
Konstantin Kolinko

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