RE: Tomcat, Apache and mod_jk configuration

2006-10-20 Thread Gormley, Josh
I'm trying to do a similar setup as well and I'm using just about the same 
configuration as shown below (I've attached my configs).  But I'm having one 
big issue:  when I try to do a hot redeploy of my webapp, I do not see the 
changes at http://rtv.myhost.com unless I restart Tomcat.  BUT, I do see the 
changes immediately, if I go to http://10.2.1.100:8080/rtv.

Any advice as to what I'm doing wrong would be very much appreciated as I've 
been banging my head on the desk for some time about this issue.

The only big difference I see in the configs is that I'm pointing my apache 
virtual host's documentRoot to the same path as the webapp.  If I don't do 
that, none of my static pages (.css, .js) get served properly, so I don't think 
that it's the problem.

Thanks,
Josh


Apache config:

VirtualHost *:80
ServerName rtv.myhost.com
ServerAlias www.rtv.myhost.com
DocumentRoot /usr/local/tomcat/webapps/rtv
DirectoryIndex index.jsp index.html
ErrorLog logs/rtv. myhost.com-errorlog
CustomLog logs/rtv. myhost.com-accesslog common
 
Directory /usr/local/tomcat/webapps/rtv
Options +FollowSymLinks
Order allow,deny
Allow from all
/Directory

#DENY ACCESS TO WEB-INF and META-INF
Location /WEB-INF/*
AllowOverride None
deny from all
/Location

Location /META-INF/*
AllowOverride None
deny from all
/Location

#ROUTE ALL JSP AND SERVLETS TO THE mod_jk WORKER
#These extensions are specified in /etc/httpd/conf.d/jk.conf file
JkMount /*.do router
JkMount /*.jsp router
/VirtualHost

Tomcat config:

Host 
name=rtv.myhost.com 
appBase=/usr/local/tomcat/webapps/rtv 
unpackWARs=true
autoDeploy=true 
xmlValidation=false 
xmlNamespaceAware=false

Context path= docBase= debug= / 

Logger 
className=org.apache.catalina.logger.FileLogger
directory=logs 
prefix=rtv.myhost.com_log / 

/Host

-Original Message-
From: Michael Courcy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 19, 2006 3:07 PM
To: Tomcat Users List
Subject: Re: Tomcat, Apache and mod_jk configuration

Yes it's what I mean,

in your JkMount declaration change

jkMount /struts-dev-1/*.do ajp13
jkMount /struts-dev-1/*.jsp ajp13

By 

jkMount /*.do ajp13
jkMount /*.jsp ajp13

And your server.xml fragment should look this way

Host name=preprod.skyce.net appBase=
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

   Context path= docBase=/var/tomcat/webapps/struts-dev-1/ debug=0 /

/Host

It should works.

 



DE VINZELLES, Guillaume (ext.) a écrit :
 In fact, I've already put the jkMount directive in the VirtualHost conf.
 It looks like:

 VirtualHost 88.191.24.6:80
 DocumentRoot /var/www/preprod.skyce.net/htdocs
 Directory /var/www/preprod.skyce.net/htdocs
 Options Indexes FollowSymLinks
 AllowOverride None
 Order allow,deny
 Allow from all
 /Directory
 ServerName preprod.skyce.net
 ErrorLog /var/www/preprod.skyce.net/log/error_log
 CustomLog /var/www/preprod.skyce.net/log/access_log common
 jkMount /struts-dev-1/*.do ajp13
 jkMount /struts-dev-1/*.jsp ajp13
 /VirtualHost

 And I'd like to have my webapp accessible through http://preprod.skyce.net/ 
 instead of http://preprod.skyce.net/struts-dev-1/.

 The pertinent fragment of my server.xml is:

 Host name=preprod.skyce.net appBase=webapps
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false

 My webapps are located in /var/tomcat/webapps, and I got:
 CATALINA_BASE: /var/tomcat and CATALINA_HOME: /opt/tomcat5

 Thanks !

 Guillaume de Vinzelles
 DSI/PFS Neuf Cegetel
 Altran Technologies
  
 [EMAIL PROTECTED]
  
 01 70 18 21 64

 -Message d'origine-
 De : Michael Courcy [mailto:[EMAIL PROTECTED] 
 Envoyé : jeudi 19 octobre 2006 14:51
 À : Tomcat Users List
 Objet : Re: Tomcat, Apache and mod_jk configuration

 Hello

 Here is a fragment of my server.xml

 Host name=www.verlina.com appBase=
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

  Aliasverlina.com/Alias
  Aliastique-et-puce.fr/Alias
  Aliaswww.tique-et-puce.fr/Alias
  Aliasshampooing-chien.fr/Alias
  Aliaswww.shampooing-chien.fr/Alias
 

 Valve className=org.apache.catalina.valves.AccessLogValve
  directory=logs  prefix=verlina.com_access_log. 
 suffix=.txt
  pattern=common resolveHosts=false/

 Valve 
 className=org.apache.catalina.valves.FastCommonAccessLogValve
  directory=logs  prefix=verlina.com_access_log. 
 suffix=.txt
  pattern=common resolveHosts=false/

 Context path= docBase=/home/verlina/www/ debug=0 
 Resource name=jdbc/verlina auth=Container 
 type

Tomcat, Apache and mod_jk configuration

2006-10-19 Thread DE VINZELLES, Guillaume \(ext.\)
Hi there,

Here is my problem. I got a working Tomcat 5.5.20 handling 4 webapps in 
/var/tomcat/webapps. I got a working Apache 2, configured with several 
virtualhosts.
I managed to connect the Apache to the Tomcat using an AJP13 connector, and 
everything is working fine.
Now, I'd like to map each one of my webapps to a different virtualhost.
For instance, I'd like that my webapp example1, which is in 
/var/tomcat/webapps/example1, should be accessible through www.example1.com 
(and NOT www.example1.com/example1 - I've already that working).
How do you achieve this using the jkMount directives?
I've tried with jkMount /example1/* ajp13 and my webapp is accessible only 
through www.example1.com/example1.

Thanks in advance for your answers!

Guillaume de Vinzelles
DSI/PFS Neuf Cegetel
Altran Technologies
 
[EMAIL PROTECTED]
 
01 70 18 21 64


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat, Apache and mod_jk configuration

2006-10-19 Thread Michael Courcy

Hello

Here is a fragment of my server.xml

Host name=www.verlina.com appBase=
  unpackWARs=true autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false

Aliasverlina.com/Alias
Aliastique-et-puce.fr/Alias
Aliaswww.tique-et-puce.fr/Alias
Aliasshampooing-chien.fr/Alias
Aliaswww.shampooing-chien.fr/Alias
   


   Valve className=org.apache.catalina.valves.AccessLogValve
directory=logs  prefix=verlina.com_access_log. 
suffix=.txt

pattern=common resolveHosts=false/

   Valve 
className=org.apache.catalina.valves.FastCommonAccessLogValve
directory=logs  prefix=verlina.com_access_log. 
suffix=.txt

pattern=common resolveHosts=false/

   Context path= docBase=/home/verlina/www/ debug=0 
   Resource name=jdbc/verlina auth=Container 
type=javax.sql.DataSource

maxActive=100 maxIdle=30 maxWait=1
 removeAbandoned=true removeAbandonedTimeout=60 
logAbandoned=true

username=*** password=
   driverClassName=com.mysql.jdbc.Driver
   
url=jdbc:mysql://localhost:3306/verlina_com?autoReconnect=true/

/Context

/Host

And here is a fragment of my httpd.conf

VirtualHost 87.98.218.193
ServerName www.verlina.com
ServerAlias verlina.com
ServerAlias tique-et-puce.fr
ServerAlias www.tique-et-puce.fr
ServerAlias shampooing-chien.fr
ServerAlias www.shampooing-chien.fr

JkMount /* ajp13

ServerAdmin [EMAIL PROTECTED]
#DocumentRoot /home/verlina/www
User verlina
Group users

CustomLog logs/verlina-access_log combined
ScriptAlias /cgi-bin/ /home/verlina/cgi-bin/
/VirtualHost

The idea is to put the JkMount inside the virtualHost of Apache.

But discussing with Mr Caldarale, this layout is weak, even if it works.

Because if you make any change to the context, you're forced to restart 
tomcat instead of just redeploying your context.


There should be a way for your app to programatticly communicate to 
tomcat  the list of domain the app should handle, but I don't know how 
to do that.


Cheers.




DE VINZELLES, Guillaume (ext.) a écrit :

Hi there,

Here is my problem. I got a working Tomcat 5.5.20 handling 4 webapps in 
/var/tomcat/webapps. I got a working Apache 2, configured with several 
virtualhosts.
I managed to connect the Apache to the Tomcat using an AJP13 connector, and 
everything is working fine.
Now, I'd like to map each one of my webapps to a different virtualhost.
For instance, I'd like that my webapp example1, which is in 
/var/tomcat/webapps/example1, should be accessible through www.example1.com 
(and NOT www.example1.com/example1 - I've already that working).
How do you achieve this using the jkMount directives?
I've tried with jkMount /example1/* ajp13 and my webapp is accessible only 
through www.example1.com/example1.

Thanks in advance for your answers!

Guillaume de Vinzelles
DSI/PFS Neuf Cegetel
Altran Technologies
 
[EMAIL PROTECTED]
 
01 70 18 21 64



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat, Apache and mod_jk configuration

2006-10-19 Thread DE VINZELLES, Guillaume \(ext.\)
In fact, I've already put the jkMount directive in the VirtualHost conf.
It looks like:

VirtualHost 88.191.24.6:80
DocumentRoot /var/www/preprod.skyce.net/htdocs
Directory /var/www/preprod.skyce.net/htdocs
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
/Directory
ServerName preprod.skyce.net
ErrorLog /var/www/preprod.skyce.net/log/error_log
CustomLog /var/www/preprod.skyce.net/log/access_log common
jkMount /struts-dev-1/*.do ajp13
jkMount /struts-dev-1/*.jsp ajp13
/VirtualHost

And I'd like to have my webapp accessible through http://preprod.skyce.net/ 
instead of http://preprod.skyce.net/struts-dev-1/.

The pertinent fragment of my server.xml is:

Host name=preprod.skyce.net appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

My webapps are located in /var/tomcat/webapps, and I got:
CATALINA_BASE: /var/tomcat and CATALINA_HOME: /opt/tomcat5

Thanks !

Guillaume de Vinzelles
DSI/PFS Neuf Cegetel
Altran Technologies
 
[EMAIL PROTECTED]
 
01 70 18 21 64

-Message d'origine-
De : Michael Courcy [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 19 octobre 2006 14:51
À : Tomcat Users List
Objet : Re: Tomcat, Apache and mod_jk configuration

Hello

Here is a fragment of my server.xml

Host name=www.verlina.com appBase=
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false

 Aliasverlina.com/Alias
 Aliastique-et-puce.fr/Alias
 Aliaswww.tique-et-puce.fr/Alias
 Aliasshampooing-chien.fr/Alias
 Aliaswww.shampooing-chien.fr/Alias


Valve className=org.apache.catalina.valves.AccessLogValve
 directory=logs  prefix=verlina.com_access_log. 
suffix=.txt
 pattern=common resolveHosts=false/

Valve 
className=org.apache.catalina.valves.FastCommonAccessLogValve
 directory=logs  prefix=verlina.com_access_log. 
suffix=.txt
 pattern=common resolveHosts=false/

Context path= docBase=/home/verlina/www/ debug=0 
Resource name=jdbc/verlina auth=Container 
type=javax.sql.DataSource
 maxActive=100 maxIdle=30 maxWait=1
  removeAbandoned=true removeAbandonedTimeout=60 
logAbandoned=true
 username=*** password=
driverClassName=com.mysql.jdbc.Driver

url=jdbc:mysql://localhost:3306/verlina_com?autoReconnect=true/
 /Context

 /Host

And here is a fragment of my httpd.conf

VirtualHost 87.98.218.193
ServerName www.verlina.com
ServerAlias verlina.com
ServerAlias tique-et-puce.fr
ServerAlias www.tique-et-puce.fr
ServerAlias shampooing-chien.fr
ServerAlias www.shampooing-chien.fr

JkMount /* ajp13

ServerAdmin [EMAIL PROTECTED]
#DocumentRoot /home/verlina/www
User verlina
Group users

CustomLog logs/verlina-access_log combined
ScriptAlias /cgi-bin/ /home/verlina/cgi-bin/
/VirtualHost

The idea is to put the JkMount inside the virtualHost of Apache.

But discussing with Mr Caldarale, this layout is weak, even if it works.

Because if you make any change to the context, you're forced to restart 
tomcat instead of just redeploying your context.

There should be a way for your app to programatticly communicate to 
tomcat  the list of domain the app should handle, but I don't know how 
to do that.

Cheers.




DE VINZELLES, Guillaume (ext.) a écrit :
 Hi there,

 Here is my problem. I got a working Tomcat 5.5.20 handling 4 webapps in 
 /var/tomcat/webapps. I got a working Apache 2, configured with several 
 virtualhosts.
 I managed to connect the Apache to the Tomcat using an AJP13 connector, and 
 everything is working fine.
 Now, I'd like to map each one of my webapps to a different virtualhost.
 For instance, I'd like that my webapp example1, which is in 
 /var/tomcat/webapps/example1, should be accessible through www.example1.com 
 (and NOT www.example1.com/example1 - I've already that working).
 How do you achieve this using the jkMount directives?
 I've tried with jkMount /example1/* ajp13 and my webapp is accessible only 
 through www.example1.com/example1.

 Thanks in advance for your answers!

 Guillaume de Vinzelles
 DSI/PFS Neuf Cegetel
 Altran Technologies
  
 [EMAIL PROTECTED]
  
 01 70 18 21 64


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


   


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users

Re: Tomcat, Apache and mod_jk configuration

2006-10-19 Thread Michael Courcy

Yes it's what I mean,

in your JkMount declaration change

jkMount /struts-dev-1/*.do ajp13
jkMount /struts-dev-1/*.jsp ajp13

By 


jkMount /*.do ajp13
jkMount /*.jsp ajp13

And your server.xml fragment should look this way

Host name=preprod.skyce.net appBase=
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

  Context path= docBase=/var/tomcat/webapps/struts-dev-1/ debug=0 /

/Host

It should works.





DE VINZELLES, Guillaume (ext.) a écrit :

In fact, I've already put the jkMount directive in the VirtualHost conf.
It looks like:

VirtualHost 88.191.24.6:80
DocumentRoot /var/www/preprod.skyce.net/htdocs
Directory /var/www/preprod.skyce.net/htdocs
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
/Directory
ServerName preprod.skyce.net
ErrorLog /var/www/preprod.skyce.net/log/error_log
CustomLog /var/www/preprod.skyce.net/log/access_log common
jkMount /struts-dev-1/*.do ajp13
jkMount /struts-dev-1/*.jsp ajp13
/VirtualHost

And I'd like to have my webapp accessible through http://preprod.skyce.net/ 
instead of http://preprod.skyce.net/struts-dev-1/.

The pertinent fragment of my server.xml is:

Host name=preprod.skyce.net appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

My webapps are located in /var/tomcat/webapps, and I got:
CATALINA_BASE: /var/tomcat and CATALINA_HOME: /opt/tomcat5

Thanks !

Guillaume de Vinzelles
DSI/PFS Neuf Cegetel
Altran Technologies
 
[EMAIL PROTECTED]
 
01 70 18 21 64


-Message d'origine-
De : Michael Courcy [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 19 octobre 2006 14:51

À : Tomcat Users List
Objet : Re: Tomcat, Apache and mod_jk configuration

Hello

Here is a fragment of my server.xml

Host name=www.verlina.com appBase=
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false

 Aliasverlina.com/Alias
 Aliastique-et-puce.fr/Alias
 Aliaswww.tique-et-puce.fr/Alias
 Aliasshampooing-chien.fr/Alias
 Aliaswww.shampooing-chien.fr/Alias



Valve className=org.apache.catalina.valves.AccessLogValve
 directory=logs  prefix=verlina.com_access_log. 
suffix=.txt

 pattern=common resolveHosts=false/

Valve 
className=org.apache.catalina.valves.FastCommonAccessLogValve
 directory=logs  prefix=verlina.com_access_log. 
suffix=.txt

 pattern=common resolveHosts=false/

Context path= docBase=/home/verlina/www/ debug=0 
Resource name=jdbc/verlina auth=Container 
type=javax.sql.DataSource

 maxActive=100 maxIdle=30 maxWait=1
  removeAbandoned=true removeAbandonedTimeout=60 
logAbandoned=true

 username=*** password=
driverClassName=com.mysql.jdbc.Driver

url=jdbc:mysql://localhost:3306/verlina_com?autoReconnect=true/

 /Context

 /Host

And here is a fragment of my httpd.conf

VirtualHost 87.98.218.193
ServerName www.verlina.com
ServerAlias verlina.com
ServerAlias tique-et-puce.fr
ServerAlias www.tique-et-puce.fr
ServerAlias shampooing-chien.fr
ServerAlias www.shampooing-chien.fr

JkMount /* ajp13

ServerAdmin [EMAIL PROTECTED]
#DocumentRoot /home/verlina/www
User verlina
Group users

CustomLog logs/verlina-access_log combined
ScriptAlias /cgi-bin/ /home/verlina/cgi-bin/
/VirtualHost

The idea is to put the JkMount inside the virtualHost of Apache.

But discussing with Mr Caldarale, this layout is weak, even if it works.

Because if you make any change to the context, you're forced to restart 
tomcat instead of just redeploying your context.


There should be a way for your app to programatticly communicate to 
tomcat  the list of domain the app should handle, but I don't know how 
to do that.


Cheers.




DE VINZELLES, Guillaume (ext.) a écrit :
  

Hi there,

Here is my problem. I got a working Tomcat 5.5.20 handling 4 webapps in 
/var/tomcat/webapps. I got a working Apache 2, configured with several 
virtualhosts.
I managed to connect the Apache to the Tomcat using an AJP13 connector, and 
everything is working fine.
Now, I'd like to map each one of my webapps to a different virtualhost.
For instance, I'd like that my webapp example1, which is in 
/var/tomcat/webapps/example1, should be accessible through www.example1.com 
(and NOT www.example1.com/example1 - I've already that working).
How do you achieve this using the jkMount directives?
I've tried with jkMount /example1/* ajp13 and my webapp is accessible only 
through www.example1.com/example1.

Thanks in advance for your answers!

Guillaume de Vinzelles
DSI/PFS Neuf Cegetel
Altran Technologies
 
[EMAIL PROTECTED]
 
01 70 18 21 64

Re: Tomcat, Apache and mod_jk configuration

2006-10-19 Thread Christopher Schultz
Guillaume,

 In fact, I've already put the jkMount directive in the VirtualHost 
 conf.

[snip]

 And I'd like to have my webapp accessible through 
 http://preprod.skyce.net/ instead of 
 http://preprod.skyce.net/struts-dev-1/.

It looks like what to have more than one webapp as the root webapp.

My suggestion would be to run each webapp in a different instance of
Tomcat. It's much easier than you think is it to do this. I use Tomcat
4.1.x, but I'm sure the same is possible with very few changes on 5.5.x:

1. Create a directory structure for each webapp (outside of Tomcat's
installation directory) like this:

struts-dev-1/
struts-dev-1/conf
struts-dev-1/conf/server.xml
struts-dev-1/conf/web.xml
struts-dev-1/webapps
struts-dev-1/logs
struts-dev-1/temp

** Make sure to set your port numbers for your shutdown and connector
ports to something unique among your webapps. I usually use 8x85 for the
ajp13 connector port and 8x86 for the shutdown port.

2. Install your webapp to the directory struts-dev-1/webapps/struts-dev-1

3. Configure Tomcat to use struts-dev-1 as your root webapp (usually
by specifying that the path is  instead of /struts-dev-1).

4. Start each Tomcat instance like this:

$ export JAVA_HOME=...
$ export CATALINA_HOME=/path/to/full/tomcat/install
$ export CATALINA_BASE=/path/to/struts-dev-1
$ export CATALINA_TMPDIR=/path/th/struts-dev-1/temp
$ /path/to/full/tomcat/install/bin/startup.sh

This setup allows you to have separate root webapps (or any other kind
of setup). You also have the benefit (I choose to see it as a benefit)
of separate JVMs and Tomcat instances. You can take one down without
bothering the others.

Hope that helps,
-chris




signature.asc
Description: OpenPGP digital signature


RE: Tomcat, Apache and mod_jk configuration

2006-10-19 Thread DE VINZELLES, Guillaume \(ext.\)
Michael and Chris, thanks a lot for your valuable help.
I'm going to try this ASAP.
The multi instance Tomcat seems really interesting.
Thanks again!

Regards

Guillaume de Vinzelles
DSI/PFS Neuf Cegetel
Altran Technologies
 
[EMAIL PROTECTED]
 
01 70 18 21 64
-Message d'origine-
De : Christopher Schultz [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 19 octobre 2006 15:39
À : Tomcat Users List
Objet : Re: Tomcat, Apache and mod_jk configuration

Guillaume,

 In fact, I've already put the jkMount directive in the VirtualHost 
 conf.

[snip]

 And I'd like to have my webapp accessible through 
 http://preprod.skyce.net/ instead of 
 http://preprod.skyce.net/struts-dev-1/.

It looks like what to have more than one webapp as the root webapp.

My suggestion would be to run each webapp in a different instance of
Tomcat. It's much easier than you think is it to do this. I use Tomcat
4.1.x, but I'm sure the same is possible with very few changes on 5.5.x:

1. Create a directory structure for each webapp (outside of Tomcat's
installation directory) like this:

struts-dev-1/
struts-dev-1/conf
struts-dev-1/conf/server.xml
struts-dev-1/conf/web.xml
struts-dev-1/webapps
struts-dev-1/logs
struts-dev-1/temp

** Make sure to set your port numbers for your shutdown and connector
ports to something unique among your webapps. I usually use 8x85 for the
ajp13 connector port and 8x86 for the shutdown port.

2. Install your webapp to the directory struts-dev-1/webapps/struts-dev-1

3. Configure Tomcat to use struts-dev-1 as your root webapp (usually
by specifying that the path is  instead of /struts-dev-1).

4. Start each Tomcat instance like this:

$ export JAVA_HOME=...
$ export CATALINA_HOME=/path/to/full/tomcat/install
$ export CATALINA_BASE=/path/to/struts-dev-1
$ export CATALINA_TMPDIR=/path/th/struts-dev-1/temp
$ /path/to/full/tomcat/install/bin/startup.sh

This setup allows you to have separate root webapps (or any other kind
of setup). You also have the benefit (I choose to see it as a benefit)
of separate JVMs and Tomcat instances. You can take one down without
bothering the others.

Hope that helps,
-chris



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat, Apache and mod_jk configuration

2006-10-19 Thread Michael Courcy

Yes it's what I mean,

in your JkMount declaration change

jkMount /struts-dev-1/*.do ajp13
jkMount /struts-dev-1/*.jsp ajp13

By 


jkMount /*.do ajp13
jkMount /*.jsp ajp13

And your server.xml fragment should look this way

Host name=preprod.skyce.net appBase=
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

  Context path= docBase=/var/tomcat/webapps/struts-dev-1/ debug=0 /

/Host

It should works.





DE VINZELLES, Guillaume (ext.) a écrit :

In fact, I've already put the jkMount directive in the VirtualHost conf.
It looks like:

VirtualHost 88.191.24.6:80
DocumentRoot /var/www/preprod.skyce.net/htdocs
Directory /var/www/preprod.skyce.net/htdocs
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
/Directory
ServerName preprod.skyce.net
ErrorLog /var/www/preprod.skyce.net/log/error_log
CustomLog /var/www/preprod.skyce.net/log/access_log common
jkMount /struts-dev-1/*.do ajp13
jkMount /struts-dev-1/*.jsp ajp13
/VirtualHost

And I'd like to have my webapp accessible through http://preprod.skyce.net/ 
instead of http://preprod.skyce.net/struts-dev-1/.

The pertinent fragment of my server.xml is:

Host name=preprod.skyce.net appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

My webapps are located in /var/tomcat/webapps, and I got:
CATALINA_BASE: /var/tomcat and CATALINA_HOME: /opt/tomcat5

Thanks !

Guillaume de Vinzelles
DSI/PFS Neuf Cegetel
Altran Technologies
 
[EMAIL PROTECTED]
 
01 70 18 21 64


-Message d'origine-
De : Michael Courcy [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 19 octobre 2006 14:51

À : Tomcat Users List
Objet : Re: Tomcat, Apache and mod_jk configuration

Hello

Here is a fragment of my server.xml

Host name=www.verlina.com appBase=
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false

 Aliasverlina.com/Alias
 Aliastique-et-puce.fr/Alias
 Aliaswww.tique-et-puce.fr/Alias
 Aliasshampooing-chien.fr/Alias
 Aliaswww.shampooing-chien.fr/Alias



Valve className=org.apache.catalina.valves.AccessLogValve
 directory=logs  prefix=verlina.com_access_log. 
suffix=.txt

 pattern=common resolveHosts=false/

Valve 
className=org.apache.catalina.valves.FastCommonAccessLogValve
 directory=logs  prefix=verlina.com_access_log. 
suffix=.txt

 pattern=common resolveHosts=false/

Context path= docBase=/home/verlina/www/ debug=0 
Resource name=jdbc/verlina auth=Container 
type=javax.sql.DataSource

 maxActive=100 maxIdle=30 maxWait=1
  removeAbandoned=true removeAbandonedTimeout=60 
logAbandoned=true

 username=*** password=
driverClassName=com.mysql.jdbc.Driver

url=jdbc:mysql://localhost:3306/verlina_com?autoReconnect=true/

 /Context

 /Host

And here is a fragment of my httpd.conf

VirtualHost 87.98.218.193
ServerName www.verlina.com
ServerAlias verlina.com
ServerAlias tique-et-puce.fr
ServerAlias www.tique-et-puce.fr
ServerAlias shampooing-chien.fr
ServerAlias www.shampooing-chien.fr

JkMount /* ajp13

ServerAdmin [EMAIL PROTECTED]
#DocumentRoot /home/verlina/www
User verlina
Group users

CustomLog logs/verlina-access_log combined
ScriptAlias /cgi-bin/ /home/verlina/cgi-bin/
/VirtualHost

The idea is to put the JkMount inside the virtualHost of Apache.

But discussing with Mr Caldarale, this layout is weak, even if it works.

Because if you make any change to the context, you're forced to restart 
tomcat instead of just redeploying your context.


There should be a way for your app to programatticly communicate to 
tomcat  the list of domain the app should handle, but I don't know how 
to do that.


Cheers.




DE VINZELLES, Guillaume (ext.) a écrit :
  

Hi there,

Here is my problem. I got a working Tomcat 5.5.20 handling 4 webapps in 
/var/tomcat/webapps. I got a working Apache 2, configured with several 
virtualhosts.
I managed to connect the Apache to the Tomcat using an AJP13 connector, and 
everything is working fine.
Now, I'd like to map each one of my webapps to a different virtualhost.
For instance, I'd like that my webapp example1, which is in 
/var/tomcat/webapps/example1, should be accessible through www.example1.com 
(and NOT www.example1.com/example1 - I've already that working).
How do you achieve this using the jkMount directives?
I've tried with jkMount /example1/* ajp13 and my webapp is accessible only 
through www.example1.com/example1.

Thanks in advance for your answers!

Guillaume de Vinzelles
DSI/PFS Neuf Cegetel
Altran Technologies
 
[EMAIL PROTECTED]
 
01 70 18 21 64

Re: Tomcat, Apache and mod_jk configuration

2006-10-19 Thread Michael Courcy
Yes it looks much more powerful than my solution. Especially if you want 
to guarantee a minimum JVM heap size for each app.


Thanks a lot.

JVM
It looks like what to have more than one webapp as the root webapp.

My suggestion would be to run each webapp in a different instance of
Tomcat. It's much easier than you think is it to do this. I use Tomcat
4.1.x, but I'm sure the same is possible with very few changes on 5.5.x:

1. Create a directory structure for each webapp (outside of Tomcat's
installation directory) like this:

struts-dev-1/
struts-dev-1/conf
struts-dev-1/conf/server.xml
struts-dev-1/conf/web.xml
struts-dev-1/webapps
struts-dev-1/logs
struts-dev-1/temp

** Make sure to set your port numbers for your shutdown and connector
ports to something unique among your webapps. I usually use 8x85 for the
ajp13 connector port and 8x86 for the shutdown port.

2. Install your webapp to the directory struts-dev-1/webapps/struts-dev-1

3. Configure Tomcat to use struts-dev-1 as your root webapp (usually
by specifying that the path is  instead of /struts-dev-1).

4. Start each Tomcat instance like this:

$ export JAVA_HOME=...
$ export CATALINA_HOME=/path/to/full/tomcat/install
$ export CATALINA_BASE=/path/to/struts-dev-1
$ export CATALINA_TMPDIR=/path/th/struts-dev-1/temp
$ /path/to/full/tomcat/install/bin/startup.sh

This setup allows you to have separate root webapps (or any other kind
of setup). You also have the benefit (I choose to see it as a benefit)
of separate JVMs and Tomcat instances. You can take one down without
bothering the others.

Hope that helps,
-chris