Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)

« Doc/Odysseo » : différence entre les versions

De AJLSM
Aller à la navigation Aller à la recherche
+section: ports d'écoutes
→Serveur : confiuration
Ligne 1 : Ligne 1 :
== Serveur ==
== Serveur ==
=== Serveur #1 ===
 
{| class="wikitable sortable"
|-
! Description !! Valeur !! Commentaire
|-
| Adresse IP || [176.31.229.74] || -
|-
| Tomcat production || {{value|8080}} || -
|-
| Tomcat recette || {{value|9090}} || -
|-
| SSH || {{value|22}} || -
|-
|}
 
* Debian 6.0 (Squeeze) .
* Debian 6.0 (Squeeze) .
* système 64 bits.
* système 64 bits.
Ligne 12 : Ligne 26 :
* Le nom du serveur est : ks200294.kimsufi.com
* Le nom du serveur est : ks200294.kimsufi.com
=== Logiciels ===
=== Logiciels ===
{| class="wikitable sortable"
|-
! Description !! Valeur !! Commentaire
|-
| OS || debian 6.0.6 ||
* tous les logiciels proviennent du dépot debian.
* sauvegarde ?
<!--* Sauvegardé intégralement tous les soirs//-->
|-
| Java  || 1.6.0_30 || -
|-
| Tomcat || 6.0.35-1+squeeze2 ||
* issu des dépôts
* 2 instances ont été créée
|-
| Apache || 2.2.16-6+squeeze4 || issu des dépôts
|-
| Imagemagick || 6.6.0.4-3 || issu des dépôts
|-
| Postgresql || 8.4.9-0squeeze1 || issu des dépôts
|}


=== Résolutions de problèmes courants ===
=== Résolutions de problèmes courants ===
Le serveur {{tomcat}} à parfois du mal à redémarrer, il suffit de le relancer :
Le serveur {{tomcat}} à parfois du mal à redémarrer, il suffit de le relancer :
{{notice|
'''Hypothèse:''' mauvaise compréhension/utilisation des opérateurs Bash {{value|&&}}. En effet le {{cmd|cron}} actuel est le suivant :
<syntaxhighlight lang="bash">
0 6 * * * /bin/sh /opt/tomcat6/bin/shutdown.sh && /bin/rm -rf /opt/tomcat6/temp/* /opt/tomcat6/work/* && /bin/sh /opt/tomcat6/bin/startup.sh
</syntaxhighlight>
Ce qui peut amener à des cas où le redémarrage ne se fait pas: si une des commandes avant '/opt/tomcat6/bin/startup.sh' a un code retour différent de {{value|0}} :
* pour des explications, voir : [http://mywiki.wooledge.org/BashPitfalls#cmd1_.26.26_cmd2_.7C.7C_cmd3 Bash Pitfalls#22]
* pour une solutions on utilisera l'approche décrite dans [[Tomcat#Tâche cron journalière de redémarrage]]}}
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
/opt/tomcat6/bin/catalina.sh start
# Production
0 6 * * * /bin/bash /home/ajlsm/restartProd.sh
# Recette
0 6 * * * /bin/bash /home/ajlsm/restartPreProd.sh
</syntaxhighlight>
</syntaxhighlight>


=== Points de montage ===
=== Points de montage ===
Aucun.
==== Liens symboliques ====
==== Liens symboliques ====



Version du 16 octobre 2012 à 10:20

Serveur

Description Valeur Commentaire
Adresse IP [176.31.229.74] -
Tomcat production 8080 -
Tomcat recette 9090 -
SSH 22 -
  • Debian 6.0 (Squeeze) .
  • système 64 bits.
  • L'adresse IP du serveur est : 176.31.229.74
  • Le nom du serveur est : ns226259.ovh.net

Serveur #2

  • Debian 6.0 (Squeeze) .
  • système 64 bits.
  • L'adresse IP du serveur est : 91.121.108.165
  • Le nom du serveur est : ks200294.kimsufi.com

Logiciels

Description Valeur Commentaire
OS debian 6.0.6
  • tous les logiciels proviennent du dépot debian.
  • sauvegarde ?
Java 1.6.0_30 -
Tomcat 6.0.35-1+squeeze2
  • issu des dépôts
  • 2 instances ont été créée
Apache 2.2.16-6+squeeze4 issu des dépôts
Imagemagick 6.6.0.4-3 issu des dépôts
Postgresql 8.4.9-0squeeze1 issu des dépôts


Résolutions de problèmes courants

Le serveur Apache Tomcat à parfois du mal à redémarrer, il suffit de le relancer :

# Production
0 6 * * * /bin/bash /home/ajlsm/restartProd.sh
# Recette
0 6 * * * /bin/bash /home/ajlsm/restartPreProd.sh

Points de montage

Aucun.

Liens symboliques

Sauvegardes

Crontab

Expiration des sauvegardes

Tomcat

Suite à des problèmes avec le tomcat (et le serveur étends du Debian), nous décidons de mettre en place plusieurs instance de tomcat pour servir les deux applications (prod et pre-prod

Localisation des serveur

Description Production Recettage
Emplacement "$AJLSM_HOME"/server/tomcat6-prod "$AJLSM_HOME"/server/tomcat6-pre-prod
Commande
tomcat6-instance-create /home/ajlsm/server/tomcat6-prod
tomcat6-instance-create -p 9090 -c 9005 /home/ajlsm/server/tomcat6-pre-prod

Ports d'écoutes

Type de Port Production Recettage
arrêt 8005 9005
écoute (connecteur HTTP) 8080 9090
redirection (connecteur HTTP) 8443 9443
écoute (connecteur AJP/1.3) 8009 9009
redirection (connecteur AJP/1.3) 8443 9443

Liens vers l'application

Production Recettage
ln -s webapps/current-pleade server/tomcat6-prod/webapps/odysseo
ln -s webapps/current-pleade-pprod server/tomcat6-pre-prod/webapps/odysseo_pprod

Configuration du serveur : server.xml

Production Recettage
    <Connector port="8009" protocol="AJP/1.3"
        redirectPort="8443"
        emptySessionPath="true"
    />
    <Connector port="9009" protocol="AJP/1.3"
        redirectPort="9443"
        emptySessionPath="true"
    />

Virtual Host Httpd

Production Recettage
    ProxyPass /pprod/ ajp://localhost:8009/odysseo_pprod/
    ProxyPassReverse /pprod/ ajp://localhost:8009/odysseo_pprod/
    ProxyPass /pprod/ ajp://localhost:9009/odysseo_pprod/
    ProxyPassReverse /pprod/ ajp://localhost:9009/odysseo_pprod/

Allocation de mémoire

Scripts et redémarrage automatique

Production Recettage
#!/bin/bash
"$AJLSM_HOME"/server/tomcat6-prod/bin/shutdown.sh
rm -rf "$AJLSM_HOME"/server/tomcat6-prod/temp/* "$AJLSM_HOME"/server/tomcat6-prod/work/*
"$AJLSM_HOME"/server/tomcat6-prod/bin/startup.sh
#!/bin/bash
"$AJLSM_HOME"/server/tomcat6-pre-prod/bin/shutdown.sh
rm -rf "$AJLSM_HOME"/server/tomcat6-pre-prod/temp/* "$AJLSM_HOME"/server/tomcat6-pre-prod/work/*
"$AJLSM_HOME"/server/tomcat6-pre-prod/bin/startup.sh
cp restartProd.sh restartPreProd.sh
perl -i -p -e 's/-prod/-pre-prod/g' restartPreProd.sh
chmod u+x ./restartPr*

Arrêt

Apache

De façon à séparer autant que possible les deux applications, on va configurer les deux applications sur des ports différents.

Description Production Recettage
Port d'écoute 80 90

Port d'écoute

L'application de pré-prod étant configurer pour travailler avec le port 90, il faut préciser à httpd d'écouter celui-ci. Pour cela, on va éditer le fichier /etc/apache2/ports.conf :

NameVirtualHost *:90
Listen 90

Production

<VirtualHost *:80>
    Servername odysseo.generiques.org
    ServerAlias odysseo.ajlsm.com odysseo.org odysseo.net odysseo.com

    Alias /robots.txt /home/odysseo/pleade/robots.txt
    Alias /aj_ap/ /home/odysseo/php/
    Alias /aj_ap_pprod/ /home/odysseo/php_pprod/

    Proxypass /pprod/ !
    ProxyPass /awstats/ !
    ProxyPass /awstatsclasses !
    ProxyPass /awstatsicons !
    ProxyPass /awstatscss !
    ProxyPass /robots.txt !
    ProxyPass /munin !
    ProxyPass /cacti !
    ProxyPass /aj_ap/ !
    ProxyPass /aj_ap_pprod/ !

    #ProxyPass /tzav/ ajp://localhost:8009/odysseo_tzav/
    #ProxyPassReverse /tzav/ ajp://localhost:8009/odysseo_tzav/

    # Redirection vers l'application de recette/pré-prod
    RedirectPermanent /pprod/ http://odysseo.org:90/pprod/

    ProxyPass / ajp://localhost:8009/odysseo/
    ProxyPassReverse / ajp://localhost:8009/odysseo/

    ErrorLog ${APACHE_LOG_DIR}/error-prod.log
    # Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/access-prod.log combined
</VirtualHost>

Pré-production

<VirtualHost *:90>
    Servername odysseo.generiques.org
    ServerAlias odysseo.ajlsm.com odysseo.org odysseo.net odysseo.com

    Alias /robots.txt /home/odysseo/pleade/robots.txt
    Alias /aj_ap/ /home/odysseo/php/
    Alias /aj_ap_pprod/ /home/odysseo/php_pprod/

    ProxyPass /awstats/ !
    ProxyPass /awstatsclasses !
    ProxyPass /awstatsicons !
    ProxyPass /awstatscss !
    ProxyPass /robots.txt !
    ProxyPass /munin !
    ProxyPass /cacti !
    ProxyPass /aj_ap/ !
    ProxyPass /aj_ap_pprod/ !

    #ProxyPass /tzav/ ajp://localhost:9009/odysseo_tzav/
    #ProxyPassReverse /tzav/ ajp://localhost:9009/odysseo_tzav/

    <Location /pprod>
        AuthType Basic
        AuthName "Entrez vos identifiants"
        AuthUserFile /home/odysseo/.htpasswd_pprod
        AuthGroupFile /dev/null
        Require valid-user
    </Location>

    ProxyPass /pprod/ ajp://localhost:9009/odysseo_pprod/
    ProxyPassReverse /pprod/ ajp://localhost:9009/odysseo_pprod/

    ErrorLog ${APACHE_LOG_DIR}/error-pre-prod.log
    # Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/access-pre-prod.log combined
</VirtualHost>

Application Pleade

Emplacement

Utilisateurs

Paramètres spéciaux

pleade-test : pleade-admin.properties

Lien PDF dans l'entête

Explication