La configuration, dans Apache, de la partie statique d’une application
WebLogic s’effectue soit, en utilisant la balise Location, soit en utilisant la
directive MatchExpression.
La partie statique (images, .css, HTML, js) de
l’application Weblogic va être placée dans un sous-répertoire du genre /appli/httpd, dont le nom doit correspondre au nom “ Context Root ” de
l’application déployée dans WebLogic. Exemple :
q pge01
q images
pge01.css
index.html
Extrait de configuration utilisant MatchExpression.
<VirtualHost
192.168.0.12>
ServerAdmin webmaster@cloud-test.com
DocumentRoot /appli/httpd
ServerName srvr01.com
<Directory
"appli/httpd">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from All
</Directory>
<IfModule mod_weblogic.c>
MatchExpression *.jsp
MatchExpression *.do
WebLogicHost 192.168.0.13
WebLogicPort 7101
</IfModule>
ErrorLog /var/apache/logs/pge01/error.log
CustomLog /var/apache/logs/pge01/access.log
combined
</VirtualHost>
Dans cet exemple, tous les documents seront servis
par Apache, à l’exception de ceux
comportant l’extension spécifiée dans la directive MatchExpression. Une URL d’appel pourra être la
suivante :
http://srvr01.com/pge01/index.jsp
Extrait de configuration utilisant la directive Location.
<VirtualHost
192.168.0.12>
ServerAdmin webmaster@cloud-test.com
DocumentRoot /appli/httpd
ServerName pge01.cloud-test.com
<Directory "appli/httpd">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from All
</Directory>
<IfModule mod_weblogic.c>
WLExcludePathOrMimeType *.html
WLExcludePathOrMimeType *.htm
WLExcludePathOrMimeType *.gif
WLExcludePathOrMimeType *.jpg
WLExcludePathOrMimeType *.css
WLExcludePathOrMimeType *.js
WLExcludePathOrMimeType *.php
WLExcludePathOrMimeType *.pdf
<Location /pge01>
SetHandler weblogic-handler
WebLogicHost 192.168.0.13
WebLogicPort 7101
</Location>
</IfModule>
ErrorLog
/var/apache/logs/pge01/pge01-error_log
CustomLog /var/apache/logs/pge01/pge01-access_log
combined
</VirtualHost>
Dans cet exemple, tous les documents comportant
l’extension spécifiée dans les directives WLExcludePathOrMimeType ne seront pas traités par WebLogic, mais par
Apache. Toutes les URL comportant
/pge01 seront routées vers WebLogic. Une URL d’appel pourra être la suivante :
http://pge01.cloud-test.com/pge01
Exemple de fichier log http de WebLogic lorsque ce
dernier est configuré pour servir exclusivement les pages dynamiques. On
observe que seules les pages jsp y apparaissent.
163.104.31.205 - - [02/Nov/2006:15:51:37
+0100] "GET /pge01/index.jsp HTTP/1.1" 200 192
163.104.31.205 - - [02/Nov/2006:15:51:38
+0100] "GET /pge01/main.jsp?displayJSP=home HTTP/1.1" 200 0
163.104.31.205 - - [02/Nov/2006:15:55:49
+0100] "GET /pge01/index.jsp HTTP/1.1" 200 192
163.104.31.205 - - [02/Nov/2006:15:55:49
+0100] "GET /pge01/main.jsp?displayJSP=home HTTP/1.1" 200 0
163.104.31.205 - - [02/Nov/2006:15:55:51
+0100] "GET /pge01/loginLink.do HTTP/1.1" 200 0
Dans le fichier log d’Apache, apparaissent les
éléments statiques: .gif, .css, …
163.104.29.152 - - [02/Nov/2006:15:55:48 +0100] "GET /pge01/index.jsp
HTTP/1.1" 200 192 "-" "Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; .NET CLR 1.1.4322)"
163.104.29.152 - - [02/Nov/2006:15:55:49 +0100] "GET /pge01/main.jsp?displayJSP=home
HTTP/1.1" 200 2271 "-" "Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; .NET CLR 1.1.4322)"
163.104.29.152 - - [02/Nov/2006:15:55:49 +0100] "GET /pge01/images/logo.gif
HTTP/1.1" 304 - "http://pge01.rte-france.com/pge01/main.jsp?displayJSP=home"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
163.104.29.152 - - [02/Nov/2006:15:55:49 +0100] "GET /pge01/rte_cct.css
HTTP/1.1" 304 - "http://pge01.rte-france.com/pge01/main.jsp?displayJSP=home"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
163.104.29.152 - - [02/Nov/2006:15:55:49 +0100] "GET /pge01/images/fond.jpg
HTTP/1.1" 304 - "http://pge01.rte-france.com/pge01/main.jsp?displayJSP=home"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
163.104.29.152 - - [02/Nov/2006:15:55:51 +0100] "GET /pge01/loginLink.do
HTTP/1.1" 200 2985 "http://pge01.rte-france.com/pge01/main.jsp?displayJSP=home"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
Exemples extraits de mes configurations
#
---------------------------------
#
#
# Configuration des
virtualhosts
# pour les applications
WebLogic
#
#
#
--------------------------------
#
# --- Application pge01
#
<VirtualHost
163.104.31.205>
ServerAdmin webmaster@fxe-free.com
DocumentRoot /appli/httpd
ServerName
pge01.fxe-free.com
<Directory "appli/httpd">
Options
Indexes FollowSymLinks
AllowOverride All
Order
allow,deny
Allow
from All
</Directory>
<IfModule mod_weblogic.c>
WLExcludePathOrMimeType
*.html
WLExcludePathOrMimeType
*.htm
WLExcludePathOrMimeType
*.gif
WLExcludePathOrMimeType
*.jpg
WLExcludePathOrMimeType
*.css
WLExcludePathOrMimeType
*.js
WLExcludePathOrMimeType
*.php
WLExcludePathOrMimeType
*.pdf
<Location
/pge01>
SetHandler
weblogic-handler
WebLogicCluster
163.104.115.232:7101,163.104.114.147:7101,163.104.115.239:7101
</Location>
</IfModule>
ErrorLog
/var/apache/logs/pge01/error.log
CustomLog /var/apache/logs/pge01/access.log
combined
</VirtualHost>
#
# --- Application pge10
#
<VirtualHost 163.104.31.205>
ServerAdmin webmaster@fxe-free.com
DocumentRoot /appli/httpd
ServerName
pge10.fxe-free.com
<Directory "appli/httpd">
Options
Indexes FollowSymLinks
AllowOverride All
Order
allow,deny
Allow
from All
</Directory>
<IfModule mod_weblogic.c>
WLExcludePathOrMimeType
*.html
WLExcludePathOrMimeType
*.htm
WLExcludePathOrMimeType
*.gif
WLExcludePathOrMimeType
*.jpg
WLExcludePathOrMimeType
*.css
WLExcludePathOrMimeType
*.js
WLExcludePathOrMimeType
*.php
WLExcludePathOrMimeType
*.pdf
<Location
/pge10>
SetHandler
weblogic-handler
WebLogicCluster
163.104.115.232:7101,163.104.114.147:7101,163.104.115.239:7101
</Location>
</IfModule>
ErrorLog
/var/apache/logs/pge10/error.log
CustomLog /var/apache/logs/pge10/access.log
combined
</VirtualHost>
#
# --- Application pge20
#
<VirtualHost 163.104.31.205>
ServerAdmin webmaster@fxe-free.com
DocumentRoot /appli/httpd
ServerName
pge20.fxe-free.com
<Directory "appli/httpd">
Options
Indexes FollowSymLinks
AllowOverride All
Order
allow,deny
Allow
from All
</Directory>
<IfModule mod_weblogic.c>
WLExcludePathOrMimeType
*.html
WLExcludePathOrMimeType
*.htm
WLExcludePathOrMimeType
*.gif
WLExcludePathOrMimeType
*.jpg
WLExcludePathOrMimeType
*.css
WLExcludePathOrMimeType
*.js
WLExcludePathOrMimeType
*.php
WLExcludePathOrMimeType
*.pdf
<Location
/pge20>
SetHandler
weblogic-handler
WebLogicCluster
163.104.115.232:7101,163.104.114.147:7101,163.104.115.239:7101
</Location>
</IfModule>
ErrorLog
/var/apache/logs/pge20/error.log
CustomLog /var/apache/logs/pge20/access.log
combined
</VirtualHost>
Aucun commentaire :
Enregistrer un commentaire