Rédiger « OVH/VPC02/idneuf/Drupal » ici.
Installation des paquets
apt-get install apache2 haproxy php5 php5-gd php5-durl libssh2-php
Configuration HAProxy
Contenu du fichier : /etc/haproxy/haproxy.cfg :
global log /dev/log local0 log /dev/log local1 notice chroot /var/lib/haproxy stats socket /run/haproxy/admin.sock mode 660 level admin stats timeout 30s user haproxy group haproxy daemon defaults log global mode tcp option dontlognull timeout connect 5000 timeout client 50000 timeout server 50000 listen mysql-cluster bind 127.0.0.1:3306 mode tcp option mysql-check user haproxy balance roundrobin server prod-db02-idneuf database_server01:3306 check server prod-db03-idneuf database_server02:3306 check
Utilisation de HAProxy avec Drupal
Dans le fichier sites/default/settings.php, insérer les lignes suivantes :
$databases = array ( 'default' => array ( 'default' => array ( 'database' => 'drupal', 'username' => 'haproxy_auf', 'password' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'host' => '127.0.0.1', 'port' => '', 'driver' => 'mysql', 'prefix' => '', 'readonly' => TRUE , ), ), );
Le host ne doit pas être "localhost" sinon la connexion ne se fera pas.
Installation de memcache
apt-get -y install php5-memcache memcached
Dans le fichier /etc/memcache.conf, configurer la quantité de RAM a allouer :
# Start with a cap of 64 megs of memory. It's reasonable, and the daemon default # Note that the daemon will grow to this size, but does not start out holding this much # memory -m 1024
Configuration de Drupal
Installer le module suivant depuis l'interface d'administration :
https://ftp.drupal.org/files/projects/memcache-7.x-1.5.tar.gz
Dans le fichier sites/default/settings.php, insérer les lignes suivantes :
//Use memcache $conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc'; $conf['cache_default_class'] = 'MemCacheDrupal'; $conf['cache_inc'] = 'sites/all/modules/contrib/memcache/memcache.inc'; //Memcache session $conf['session_inc'] = 'sites/all/modules/memcache/unstable/memcache-session.inc'; //Memcache lock $conf['lock_inc'] = 'sites/all/modules/memcache/memcache-lock.inc'; //Add in stampede protection $conf['memcache_stampede_protection'] = TRUE; //Don't bootstrap the database when serving pages from the cache. $conf['page_cache_without_database'] = TRUE; $conf['page_cache_invoke_hooks'] = FALSE;
Lien avec ORI-OAI
Fichiers a modifier afin de faire le lien vers ORI-OAI :
ori-oai-search-idneuf.css
http_header/index.php
sites/default/files/xmlsitemap/NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM/1.xml
sites/all/themes/theme1005/templates/views-view—block₁--block.tpl.php
sites/all/themes/theme1005/css/style-header-footer.css
sites/all/themes/theme1005/css/custom.css
Utilisation de NginX comme ReverseProxy
Config pour recuperer le X-Forward-For
Modifier le fichier sites/default/settings.php :
$conf['reverse_proxy'] = TRUE; $conf['reverse_proxy_addresses'] = array('10.242.1.194','10.242.1.195');