Stack LAMP
LAMP = Linux + Apache + MySQL + PHP. C'est la stack classique pour héberger WordPress.
1. Installer Apache
sudo apt update
sudo apt install apache2 -y
sudo systemctl enable apache2
2. Installer MySQL
sudo apt install mariadb-server -y
sudo mysql_secure_installation
Créez la base de données WordPress :
CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'MOT_DE_PASSE_SECURISE';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
3. Installer PHP
sudo apt install php php-mysql php-curl php-gd php-mbstring php-xml php-zip php-intl -y
4. Télécharger WordPress
cd /var/www/html
sudo wget https://fr.wordpress.org/latest-fr_FR.tar.gz
sudo tar -xzf latest-fr_FR.tar.gz
sudo mv wordpress monsite
sudo chown -R www-data:www-data /var/www/html/monsite
5. Configurer Apache
Créez /etc/apache2/sites-available/wordpress.conf :
<VirtualHost *:80>
ServerName monsite.fr
DocumentRoot /var/www/html/monsite
<Directory /var/www/html/monsite>
AllowOverride All
</Directory>
</VirtualHost>
sudo a2ensite wordpress.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
6. Terminer l'installation
Accédez à http://VOTRE_IP/ dans votre navigateur et suivez l'assistant WordPress.
Sécurité post-installation
- Ajoutez un certificat SSL avec Certbot
- Installez un plugin de sécurité (Wordfence, Sucuri)
- Désactivez l'éditeur de fichiers dans
wp-config.php:
define('DISALLOW_FILE_EDIT', true);