Pages enfant
  • 1. Environnement technique

Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

Volet
borderColor#4080a4
bgColor#FFFFFF
titleColor#f9fafa
borderWidth1
titleBGColor#628DB6
titleSocle technique

État
colourGreen
titleapache
 2.4  ou
État
colourGreen
titleHAProxy
1.5.18

État
colourGreen
titletomcat
7 minimum (8.5 conseillée) et inférieure à 9

État
colourGreen
titlemysql
5 minimum (5.1.73 ou 5.5.34 conseillées)

État
colourGreen
titleJava
11 minimum (depuis la 1.6.0)

Configuration Apache

  • Proxy PUSH
  • Proxy AJP
  • Module à charger : proxy_wstunnel_module
Bloc de code
languagebash
themeEclipse
titleRègles de réécriture concernant le PUSH (httpd.conf) : v2 (nouvelle configuration)
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^websocket$ [NC,OR]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule .* ws://<nom>.univ.fr:20130%{REQUEST_URI} [P,L]
 
# AJP vers Tomcat
ProxyPass / ajp://<nom>.univ.fr:20139/
 
#Toujours adapter le numero de port avec la conf tomcat du server.xml. Ici : 20130 pour le connecteur HTTP et 20139 pour le connecteur AJP


Bloc de code
languagebash
themeEclipse
titleEn cas d'erreur "UnsupportedOperationException: La promotion (upgrade) HTTP n'est pas supporté par ce protocole"
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteRule /(.*) ws://<nom>.univ.fr:20130/$1 [P,L]


Bloc de code
languagebash
themeEclipse
titleRègles de réécriture concernant le PUSH (httpd.conf) : v1 (ancienne configuration)
RewriteEngine on
RewriteCond %{QUERY_STRING} ^((?!X-Atmosphere-Transport=websocket).)*$
RewriteRule ^/PUSH(.*)$ http://<nom>.univ.fr:20130/PUSH$1 [P]
# PUSH
ProxyPass /PUSH ws://<nom>.univ.fr:20130/PUSH
ProxyPassReverse /PUSH ws://<nom>.univ-.fr:20130/PUSH
# AJP vers Tomcat
ProxyPass / ajp://<nom>.univ.fr:20139/
#Toujours adapter le numero de port avec la conf tomcat du server.xml. Ici : 20130 pour le connecteur HTTP et 20139 pour le connecteur AJP



Configuration MySQLCréer une base vide dédiée à monDossierWeb


Exemple de configuration HAProxy

load-balancé sur 4 serveurs

(avec gestion des ACLs via le fichier /etc/haproxy/acl/mdw)

######
# Partie frontend
######
  # Site mondossierweb
        acl url_mdw hdr_end(host) -i mondossierweb.univ.fr
        acl acl_mdw src -i -f /etc/haproxy/acl/mdw

        acl ws_mdw hdr(Upgrade) -i WebSocket
        use_backend ws_mdw if ws_mdw url_mdw acl_mdw

        tcp-request inspect-delay 500ms
        tcp-request content accept if HTTP

        use_backend www_mdw if url_mdw acl_mdw

#####
# Partie Backend
######

backend ws_mdw

        mode http
        option forwardfor
        option http-server-close
        option forceclose
        no option httpclose
        # Cookie qui permet a chaque client de toujours utiliser le même backend
        cookie ULPWEBID insert nocache indirect

        # Algorythme de repartition de charge
        balance roundrobin

        acl hdr_connection_upgrade hdr(Connection)                 -i upgrade
        http-request deny if ! hdr_connection_upgrade

        # Liste des serveurs backend pour le type nodejs
        server back-lb1-mdw serveur1.univ.fr:20040 maxconn 3000 weight 10 cookie back-lb1-mdw check
        server back-lb2-mdw serveur2.univ.fr:20040 maxconn 3000 weight 10 cookie back-lb2-mdw check
        server back-lb3-mdw serveur3.univ.fr:20040 maxconn 3000 weight 10 cookie back-lb3-mdw check
        server back-lb4-mdw serveur4.univ.fr:20040 maxconn 3000 weight 10 cookie back-lb4-mdw check


backend www_mdw

        # Cookie qui permet a chaque client de toujours utiliser le même backend
        cookie ULPWEBID insert nocache indirect

        option forwardfor
        reqadd x-forwarded-proto:\ https

        # Algorythme de repartition de charge
        balance roundrobin

        # Liste des serveurs backend pour le type nodejs
        server back-lb1-mdw serveur1.univ.fr:20040 maxconn 1000 cookie back-lb1-mdw weight 10 check
        server back-lb2-mdw serveur2.univ.fr:20040 maxconn 1000 cookie back-lb2-mdw weight 10 check
        server back-lb3-mdw serveur3.univ.fr:20040 maxconn 1000 cookie back-lb3-mdw weight 10 check
        server back-lb4-mdw serveur4.univ.fr:20040 maxconn 1000 cookie back-lb4-mdw weight 10 check


...