RE: mod_jk problem related to multiple hosts on Apache and Tomcat

2009-10-08 Thread Maciej Zabielski
Well Andre, you are right, but when I started reading what is the easiest way 
to 
make Tomcat available on port 80 (under Centos 5.3) the most common answer was: 
use Apache HTTPD.

Other solutions looked even more complicated as:
1 - Ports below 1024 are available only to root user, and I wanted to run 
Tomcat under default Tomcat user
2 - I have removed aliases and exclusions from host configurations and left 
parts relevant to my question, so not everything will be served by Tomcat.
3 - The applications that I'm using have multiple endpoints defined (more than 
10 I believe) in different configuration files, and as far as I know it might 
be the case that not all of them are configurable. Because of that I still need 
localhost:8080 to serve the same application. This is going to be solved in 
some future releases of Alfresco so it is going to be possible to set main 
endpoint as just one configuration value.
4 - I can still use Apache HTTPD to host other applications on that server, 
that are PHP based. (I know you can make PHP work on Tomcat somehow, but I 
believe it is recommended or advised to run PHP on Apache HTTPD if possible?) 
 

Regards,
Maciej

-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Thursday, October 08, 2009 2:14 AM
To: Tomcat Users List
Subject: Re: mod_jk problem related to multiple hosts on Apache and Tomcat

One real question is why you are bothering with an Apache httpd in 
front, since unless I saw this wrong, you are proxying absolutely 
everything to Tomcat, in both virtual hosts.
JkMount /* etc..

Why not just turn off Apache, and have Tomcat listen on port 80 ?
You would save yourself some complication and some overhead.


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


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



RE: mod_jk problem related to multiple hosts on Apache and Tomcat

2009-10-08 Thread Caldarale, Charles R
 From: Maciej Zabielski [mailto:m...@tessel.pl]
 Subject: RE: mod_jk problem related to multiple hosts on Apache and
 Tomcat
 
 when I started reading what is the easiest way to make Tomcat 
 available on port 80 (under Centos 5.3) the most common
 answer was: use Apache HTTPD.

Probably written by someone very familiar with httpd and unfamiliar with 
Tomcat.  Using Tomcat standalone on port 80 without root privileges is actually 
much easier and less overhead, as described here:
http://tomcat.apache.org/tomcat-6.0-doc/setup.html#Unix%20daemon

 1 - Ports below 1024 are available only to root user, and I wanted to
 run Tomcat under default Tomcat user

See above.  You can also use iptables to do port forwarding.

 Because of that I still need localhost:8080 to serve the same
 application.

All you need for that is two Connector elements, one for port 80, one for 
8080.

 4 - I can still use Apache HTTPD to host other applications on that
 server, that are PHP based.

Now you have a real reason for keeping httpd in the mix.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



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



RE: mod_jk problem related to multiple hosts on Apache and Tomcat

2009-10-07 Thread Caldarale, Charles R
 From: Maciej Zabielski [mailto:m...@tessel.pl]
 Subject: mod_jk problem related to multiple hosts on Apache and Tomcat
 
 Tomcat Host
 Host name=localhost debug=0 appBase=webapps unpackWARs=true 
 autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
   Context path= docBase=/var/lib/tomcat5/webapps/   
   Aliasalfresco.domain.com/Alias
 /Host

I can't advise you about the httpd-related stuff, but the above is clearly 
wrong.  The docBase attribute of a Context must not be the same as the Host 
appBase; docBase should point to some directory or .war file directly 
*underneath* the appBase directory.  (Your other Host element is correct.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: mod_jk problem related to multiple hosts on Apache and Tomcat

2009-10-07 Thread Tsirkin Evgeny
What Chuck means is that you need
docBase=/var/lib/tomcat5/webapps/alfresco

On Wed, Oct 7, 2009 at 8:51 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Maciej Zabielski [mailto:m...@tessel.pl]
  Subject: mod_jk problem related to multiple hosts on Apache and Tomcat
 
  Tomcat Host
  Host name=localhost debug=0 appBase=webapps unpackWARs=true
 autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Context path= docBase=/var/lib/tomcat5/webapps/
Aliasalfresco.domain.com/Alias
  /Host

 I can't advise you about the httpd-related stuff, but the above is clearly
 wrong.  The docBase attribute of a Context must not be the same as the
 Host appBase; docBase should point to some directory or .war file directly
 *underneath* the appBase directory.  (Your other Host element is correct.)

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you received
 this in error, please contact the sender and delete the e-mail and its
 attachments from all computers.


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




Re: mod_jk problem related to multiple hosts on Apache and Tomcat

2009-10-07 Thread Rainer Jung
On 07.10.2009 19:40, Maciej Zabielski wrote:
 Hello, 
 
 I have a mod_jk problem related to multiple hosts on Apache and Tomcat
 
 My setup is
 Centos 5.3 + Apache HTTPD 2.2.3 + Tomcat 5
 
 httpd.conf contains (Just before section 3) Basic mod_jk directives.
 At the end it contains two virtual hosts:
 (all sections are placed in proper files, but I have grouped them to make it 
 easier to read)
 
 
 VirtualHost *:80
   ServerName share.domain.com
   DocumentRoot /var/lib/tomcat5/ShareApp/share/
   Alias / /var/lib/tomcat5/ShareApp/share
   JkMount /* share_wrk
   Options FollowSymLinks
 /VirtualHost
 
 Worker file defined: 
 worker.list=share_wrk
 worker.share_wrk.port=8009
 worker.share_wrk.host=share.domain.com
 worker.share_wrk.type=ajp13
 worker.share_wrk.lbfactor=1
 
 Tomcat host:
   Host name=share.tessel.pl debug=0 
 appBase=/var/lib/tomcat5/ShareApp unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
   Context path= docBase=/var/lib/tomcat5/ShareApp/share/
   Aliasshare.domain.com/Alias
   /Host
 -
 
 VirtualHost *:80
   ServerName alfresco.domain.com  
   DocumentRoot /var/lib/tomcat5/webapps/alfresco
   Alias /alfresco /var/lib/tomcat5/webapps/alfresco/
JkMount /alfresco/* alfresco_wrk
   Options FollowSymLinks
 /VirtualHost
 
 Worker file:
 worker.list=alfresco_wrk
 worker.alfresco_wrk.port=8009
 worker.alfresco_wrk.host=localhost
 worker.alfresco_wrk.type=ajp13
 worker.alfresco_wrk.lbfactor=1
 
 Tomcat Host
   Host name=localhost debug=0 appBase=webapps unpackWARs=true 
 autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
   Context path= docBase=/var/lib/tomcat5/webapps/   
   Aliasalfresco.domain.com/Alias
   /Host
 -
 
 Problem description:
 Share site has dedicated host in Tomcat and is linked to dedicated host in 
 Apache - it works perfectly.
 By typing address like share.domain.com I get the proper index document 
 processed by Tomcat (from the root of the app: /index.jsp)
 
 Alfresco site on the other hand is located in the Tomcat Localhost 
 subdirectory /alfresco (webapps/alfresco/index.jsp)
 When I use this config:   JkMount /* alfresco_wrk
 I can access this site by typing alfresco.domain.com/alfresco but that is not 
 what I need :( (I want direct access without /alfresco)
 
 So when I change config to point directly into alfresco root:
 JkMount /alfresco/* alfresco_wrk
 And navigate to alfresco.domain.com I get unprocessed JSP file (displayed as 
 text) so it looks like it was not passed to Tomcat?
 (But I ended in a proper place, because index.html is displayed properly by 
 Apache itself)
 
 I can’t move alfresco to separate site as I need acees to it locally via 
 localhost:8080/alfresco address.
 
 I would greatly appretiate any suggestions!
 Thank you!

You might want to have a look at:

http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html

Regards,

Rainer

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



RE: mod_jk problem related to multiple hosts on Apache and Tomcat

2009-10-07 Thread Maciej Zabielski
Thank you both for your support!
You are absolutely right.

My thinking (rather unexperienced, because this is my first month with linux / 
tomcat)
was that by setting:
docBase=/var/lib/tomcat5/webapps/alfresco
alfresco would become root of localhost (as it actually does?)
and therefore would be not accessible via http://localhost:8080/alfresco (but 
it still is!)
As I have said, this address is needed for Share site as changing endpoints 
does not always work

I beleive this solves my problem for now - I will have to do some test 
tomorrow, but looks promising!

What I still don't know, how to achieve that sort of functionality for many 
hosts using only localhost.
Example:
a_domain.com - localhost:8080/app1
b_domain.com - localhost:8080/app2

As opposed to the solution that I have now:
a_domain.com - localhost:8080/app1
b_domain.com - host2:8080/app2

Well, I would have to think it over tommorow as its almost midnight in country! 
:)
Once more, thank you very much for pointing out my mistake!
___
From: Tsirkin Evgeny [tsir...@gmail.com]
Sent: Wednesday, October 07, 2009 8:50 PM
To: Tomcat Users List
Subject: Re: mod_jk problem related to multiple hosts on Apache and Tomcat

What Chuck means is that you need
docBase=/var/lib/tomcat5/webapps/alfresco

On Wed, Oct 7, 2009 at 8:51 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Maciej Zabielski [mailto:m...@tessel.pl]
  Subject: mod_jk problem related to multiple hosts on Apache and Tomcat
 
  Tomcat Host
  Host name=localhost debug=0 appBase=webapps unpackWARs=true
 autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Context path= docBase=/var/lib/tomcat5/webapps/
Aliasalfresco.domain.com/Alias
  /Host

 I can't advise you about the httpd-related stuff, but the above is clearly
 wrong.  The docBase attribute of a Context must not be the same as the
 Host appBase; docBase should point to some directory or .war file directly
 *underneath* the appBase directory.  (Your other Host element is correct.)

  - Chuck


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



Re: mod_jk problem related to multiple hosts on Apache and Tomcat

2009-10-07 Thread André Warnier
One real question is why you are bothering with an Apache httpd in 
front, since unless I saw this wrong, you are proxying absolutely 
everything to Tomcat, in both virtual hosts.

JkMount /* etc..

Why not just turn off Apache, and have Tomcat listen on port 80 ?
You would save yourself some complication and some overhead.


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