ETAPES INSTALLATION WORDPRESS SUR LE VPS V2
------------------------------------------
apt-get update
apt-get upgrade
INSTALLATION DE APACHE:
apt-get install apache2
chown www-data:www-data /var/www/html -R
INSTALLATION DE MYSQL:
apt-get install default-mysql-server
apt-get install default-mysql-client
systemctl status mysql
systemctl start mysql
mysql_secure_installation
Donner un mot de passe a l'utilisateur root pour mysql.
INSTALLATION DE PHP:
apt -y install lsb-release apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
apt update
apt -y install php7.4
apt-get install php7.4-{bcmath,bz2,intl,gd,mbstring,mysql,zip}
VÉRIFICATIONS:
mysql --version
php --version
Créer /var/www/html/info.php et y mettre: <?php phpinfo(); ?>
Vérifier PHP en ouvrant avec un navigateur http://51.79.84.144:10001/info.php
CONFIGURATION DE MYSQL POUR WORDPRESS: CREATION D'UN USAGER ET D'UNE BD:
mysql -u root -p
mysql> CREATE DATABASE wp1;
mysql> GRANT ALL PRIVILEGES ON wp1.* TO "adminwp"@"localhost" IDENTIFIED BY "V@2dJeN0D3";
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
MODIFICATION DE LA CONFIGURATION DE APACHE:
cd /var/www/
mkdir wordpress1
chown www-data:www-data wordpress1
Modifier /etc/apache2/ports.conf
Inclure la ligne suivante:
Listen 10002
Créer /etc/apache2/sites-available/wordpress1.conf
Inclure les lignes suivantes:
<VirtualHost *:10002>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/wordpress1/
<Directory /var/www/wordpress1/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted
</Directory>
ServerName wp1_VE2RVL
ServerAlias wp1_VE2RVL
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
cd /etc/apache2/sites-enabled/
ln -s ../sites-available/wordpress1.conf
service apache2 restart
INSTALLATION DE WORDPRESS:
cd/var/www
wget https://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
Le contenu du répertoire wordpress doit etre déplacé sous wordpress1.
Ensuite effacer latest.tar.gz et le répertoire vide wordpress.
Modification des droits de wordpress1:
chown -R www-data:www-data wordpress1
Modification du fichier de config de wordpress:
cd wordpress1/
cp -a wp-config-sample.php wp-config.php
Modifier wp-config.php comme suit:
/** The name of the database for WordPress */
define( 'DB_NAME', 'wp1' );
/** MySQL database username */
define( 'DB_USER', 'adminwp' );
/** MySQL database password */
define( 'DB_PASSWORD', 'V@2dJeN0D3' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
Générer des clés et les inclure dans les lignes suivantes:
(voir le site web pour la génération des clés)
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'wl*,Ut!J3xRtt|hF(*JjW6 +|EA|FP}YetSzw-+8t;]QD=T&GkRV6G~2^Egi}Z#C');
define('SECURE_AUTH_KEY', 'j)vmvG(7`4Vh`IfoZTMdgHm.}rNOtKq+~!_8-<0Tp%s)1el:bK|sT|z_P<qa@AV%');
define('LOGGED_IN_KEY', 'F5CH3~@ec2eBom.DSZX9Bs#;uJ]DhF`Sz0-Pya%H,MwhvyDz|25G&g5uM5-]8LZ9');
define('NONCE_KEY', 'U2-mWi>Hz2;p(kGS{6}_^G{TgM#cy=n{`Fy1UU,cVa@wLzo_^-K/NWoJ[*dGOr|`');
define('AUTH_SALT', 'oX#9Ltf+ dU,q[|lwpM,R0LTz.OR(l}X:<ndFmOv(E0fno+W3-Ax2ev2{G$GMWwx');
define('SECURE_AUTH_SALT', '#^4vbvS-HgCL8],,V6f{T8lY5!y= !I.2Z]RoWA|.C%E5-,]&rHq8hMX3e02>jM<');
define('LOGGED_IN_SALT', 'e1M;<|Y[1P(or/ba+e`/+%,:-i){n%Y0,Dx*GNEf/W@4qagj$)9ItcM<_4T}!no`');
define('NONCE_SALT', ')GW&8M6cK<Pb%Mf*[~Lq)MY+(vIZ5hOSVB!brbgS)zEmV%!1zvqis:T$A}%FYPc?');
et finalement, WordPress database table_prefix:
$table_prefix = 'wp1_';
Ensuite, accéder a la page de configuration initiale de WordPress en appelant
http://51.79.84.144:10002
et
- Donner un titre au site Web
- Donner un identifiant + mot de passe au premier administateur du site
- Ne pas activer l'indexation par Google
- Cliquer pour l'installation de WordPress.