Difference between revisions of "How to optimize wordpress with a Mysql replication"

From EN Ikoula wiki
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽
Line 1: Line 1:
 +
<span data-link_translate_fr_title="Comment optimiser wordpress avec une replication Mysql"  data-link_translate_fr_url="Comment_optimiser_wordpress_avec_une_replication_Mysql"></span>[[:fr:Comment optimiser wordpress avec une replication Mysql]][[fr:Comment optimiser wordpress avec une replication Mysql]]
  
  

Revision as of 16:19, 23 September 2015

fr:Comment optimiser wordpress avec une replication Mysql


This article has been created by an automatic translation software. You can view the article source here.



The installation will be done command-line ssh but very well be from your local pc and FTP are sent.


1. Since the home folder, download then unzip this file :

cd ~; wget http://downloads.wordpress.org/plugin/hyperdb.zip
sudo apt-get install zip
unzip hyperdb.zip


2. Copy the default config in the root of the site file and edit :

cp ~/hyperdb/db-config.php /var/www/
vi /var/www/db-config.php


3. Locate the following passage in the file, and replace DB_HOST by 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. Add this line in the file wp - config.php

define('DB_SLAVE_1', 'IP_du_serveur_mysql_slave');


5. Finally copy this file to enable all.

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



[[:fr:category:Serveur dédi��]]


You are not allowed to post comments.