Bonjour
voilà j'ai passé bcp du temps pour chercher/étudier comment faire mais malheureusement, je l'ai pas trouvé

voici mon scénario et pb

- Un serveur Debian dispose IP privé (IP1) et IP publique (IP2) (donc accessible par l'internet)
- 2 web applications (jsp) app1 et app2 se trouvent dans /var/lib/tomcat5.5/webapps qui écoute au 8180.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
<Host name="www.app1.fr" debug="0" appBase="/var/lib/tomcat5.5/webapps/" unpackWARs="true">
<Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="app1." suffix=".txt" timestamp="true"/>
<Context path="" docBase="app1" debug="0" reloadable="true"/>
<Alias>www.app1.com</Alias>
</Host>
 
<Host name="www.app2.fr" appBase="/var/lib/tomcat5.5/webapps/" debug="0" unpackWARs="true">
<Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="app2." suffix=".txt" timestamp="true"/>
<Context path="" docBase="app2" debug="0" reloadable="true"/>
<Alias>www.app2.com</Alias>
</Host>
tout est ok via Tomcat (l'accès via IP1 sont utilisé par les gens interne)
http://IP1:8180/app1 ou http://IP2:8180/app1
http://IP1:8180/app2 ou http://IP2:8180/app2

Maintenant, j'ai les domaines www.app1.fr(.com) et www.app2.fr(.com) se pointent à IP2
Apache2+jkmod installés sur ce serveur

le fichier apache2/sites-enabled/www.app1.fr
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	ServerName <a href="http://www.app1.fr" target="_blank">www.app1.fr</a>
	ServerAlias <a href="http://www.app1.com" target="_blank">www.app1.com</a>
 
	DocumentRoot /var/lib/tomcat5.5/webapps/app1
 
	JkMount / worker1
	JkMount /* worker1
	JkUnMount /*.gif worker1
	JkUnMount /*.jpg worker1
	JkUnMount /*.png worker1
	JkUnMount /*.pdf worker1
	JkUnMount /*.css worker1
	JkUnMount /*.js worker1
 
	DirectoryIndex index.jsp index.html
#	Globally deny access to the WEB-INF directory
	<LocationMatch ‘.*WEB-INF.*’>
		deny from all
	</LocationMatch>
</VirtualHost>
le fichier apache2/sites-enabled/www.app2.fr
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	ServerName www.app2.fr
	ServerAlias www.app2.com
 
	DocumentRoot /var/lib/tomcat5.5/webapps/app2
 
	JkMount / worker1
	JkMount /* worker1
	JkUnMount /*.gif worker1
	JkUnMount /*.jpg worker1
	JkUnMount /*.png worker1
	JkUnMount /*.pdf worker1
	JkUnMount /*.css worker1
	JkUnMount /*.js worker1
 
	DirectoryIndex index.jsp index.html
#	Globally deny access to the WEB-INF directory
	<LocationMatch ‘.*WEB-INF.*’>
		deny from all
	</LocationMatch>
</VirtualHost>
workers.properties
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
workers.tomcat_home=/usr/share/tomcat5.5
workers.java_home=/usr/lib/jvm/java-6-sun
 
ps=/
worker.list=worker1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1
il me semble que il fonctionne correctement

mais avec http://ip1/app2 => dans le log other_vhosts_access.log, cette requete est traité avec la 1ère host <VirtualHost *:80> (lisiblement, oui, car cette requete match bien avec la définition de Host)


qq'un qui pourrait m'aider pour cette configuration ?
merci pour votre aide
a+