Installation de Wordpress
On met d'abord l'OS à jour puis on télécharge LAMP.
apt update && apt upgrade -y && apt dist-upgrade -y
apt install apache2 mariadb-server php7.3 php7.3-mysql php7.3-xml php7.3-curl php7.3-imap php7.3-ldap php7.3-zip php7.3-mbstring php7.3-gd unzip ntp -y
On crée l'utilisateur Wordpress et on lui donne les droits.
mariadb -u root
CREATE DATABASE wpdb;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wpdb.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
exit
On modifie la configuration de PHP.
nano /etc/php/7.3/apache2/php.ini
Max_execution_time = 480
Memory_limit = 512M
upload_max_filesize = 32M
post_max_size = 64M
Date.timezone = Europe/Paris
On crée ensuite le répertoire.
cd /var/www
mkdir wordpress
chown -R www-data:www-data /var/www/wordpress
On crée ensuite le vhost.
cd /etc/apache2/sites-available
nano wordpress.home.khroners.fr.conf
<VirtualHost *:80>
ServerName wordpress.home.khroners.fr
ServerAlias www.wordpress.home.khroners.fr
ServerAdmin alexisbonnet@khroners.fr
DocumentRoot /var/www/wordpress.home.khroners.fr
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName wordpress.home.khroners.fr
ServerAlias www.wordpress.home.khroners.fr
ServerAdmin alexisbonnet@khroners.fr
DocumentRoot /var/www/wordpress.home.khroners.fr
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile "/etc/apache2/ssl/fullchain.pem"
SSLCertificateKeyFile "/etc/apache2/ssl/private/privkey.pem"
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
On active le site.
a2ensite wordpress.home.khroners.fr
systemctl restart apache2
On télécharge ensuite Wordpress.
cd /var/www
wget https://wordpress.org/latest.tar.gz
tar -xvzf latest.tar.gz