17 septembre 2012

WebLogic et les virtuals hosts Apache



Le concept d’hôte virtuel permet à Apache de servir, sur une même machine, plusieurs sites, chaque site pouvant lui-même pointer sur un serveur WebLogic particulier.
Un virtual host référençant WebLogic sera déclaré de l’une des façons suivantes (proxy par chemin ou proxy par MIME) :

NameVirtualHost 163.107.158.79
ServerName monserveur.fxe.com
SetHandler weblogic-handler
WebLogicHost WLServer1
WebLogicPort 7101
NameVirtualHost 163.107.158.79
ServerName monserveur.fxe.com
MatchExpression *.jsp
MatchExpression *.do
WebLogicHost WLServer1
WebLogicPort 7101

Dans le couple d’ exemples ci-dessus, les requêtes de l’URL monserveur.fxe.com sont redirigées vers le serveur weblogic WLServer1 qui écoute sur le port 7101.
Voici un exemple complet de déclaration, dans Apache, d’une application WebLogic en load balancing sur deux instances WebLogic:

NameVirtualHost 192.168.0.12
ServerAdmin webmaster@fxe.com
DocumentRoot /appli/httpd
ServerName fxe01.fxe.com
Options Indexes FollowSymLinks
AllowOverride All
Order deny,allow
Allow from All
MatchExpression *jsp
MatchExpression *.do
WebLogicCluster 192.168.0.13:7101,192.168.0.11:7101

Autre forme d’écriture:

NameVirtualHost 192.168.0.12
ServerAdmin webmaster@fxe.com
DocumentRoot /appli/httpd
ServerName fxe01.fxe.com
Options Indexes FollowSymLinks
AllowOverride All
Order deny,allow
Allow from All
SetHandler weblogic-handler
WebLogicCluster 192.168.0.13:7101,192.168.0.11:7101

Les URL d’accès sont, respectivement :

http:// fxe01.fxe.com/pge01/index.jsp
http:// fxe01.fxe.com/pge01

Bibliographie

  • ASP.NET Data Web Controls(Scott Michell)
  • Building Custom PHP Extensions(Blake Schwendiman)
  • Développer avec CORBA en JAVA ET C++(David Acremann)
  • Java Native Interface(Sheng Liang)
  • Mastering WebLogic Server(Gregory Nyberg; Robert Patrick)
  • Oracle Database 10g RAC on Linux(Julian Dyke; Steve Shaw)
  • Test Process Improvement(Martin Pol)
Back to top