Comment optimiser wordpress avec une replication Mysql
Révision datée du 29 septembre 2015 à 17:01 par Ikbot (discussion | contributions)
pt:Como otimizar wordpress com uma replicação do Mysql es:Cómo optimizar wordpress con una replicación Mysql en:How to optimize wordpress with a Mysql replication
L'installation sera fait en ligne de commande ssh mais très bien se faire depuis votre pc local et être envoyé en FTP.
1. Depuis le dossier home, téléchargez puis décompressez ce fichier :
cd ~; wget http://downloads.wordpress.org/plugin/hyperdb.zip
sudo apt-get install zip
unzip hyperdb.zip
2. Copiez le fichier de config par défaut à la racine du site et éditez le :
cp ~/hyperdb/db-config.php /var/www/
vi /var/www/db-config.php
3. Recherchez dans le fichier, le passage suivant et remplacez DB_HOST par DB_SLAVE_1
$wpdb->add_database(array(
'host' => DB_HOST, // If port is other than 3306, use host:port.
'user' => DB_USER,
'password' => DB_PASSWORD,
'name' => DB_NAME,
'write' => 0,
'read' => 1,
'dataset' => 'global',
'timeout' => 0.2,
));
4. Ajoutez cette ligne dans le fichier wp-config.php
define('DB_SLAVE_1', 'IP_du_serveur_mysql_slave');
5. Enfin copiez ce fichier pour activer le tout.
cp ~/hyperdb/db.php /var/www/wp-content/
chmod a-w /var/www/wp-content/db.php
chown -R www-data:www-data /var/www/wp-content/db.php
chown -R www-data:www-data /var/www/db-config.php
Activer l'actualisation automatique des commentaires