Install wordpress

Hello I’m french and I installed wordpress on my freedombox this way because I already know a little and there are a lot of tutorials. If there is a problem because dangerous, I delete the post.
prepare apache2
sudo apt install php libapache2-mod-php mariadb-server php-mysql
restart
sudo systemctl restart apache2
prepare mariadb
sudo mysql_secure_installation

  • enter Enter
  • enter Yes
  • enter NEW PASSWORD
  • confirm NEW PASSWORD
  • enter Yes
  • enter Yes
  • enter Yes
  • enter Yes

create database wordpress
sudo mysql
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO 'USER'@'localhost' IDENTIFIED BY 'PASSWORD';
adapt USER and PASSWORD
FLUSH PRIVILEGES;
QUIT;
prepare wordpress
sudo apt install unzip
wget https://fr.wordpress.org/wordpress-latest.zip
sudo unzip wordpress-latest.zip -d /var/www/html
sudo chown www-data:www-data /var/www/html/wordpress -R
sudo chmod -R -wx,u+rwX,g+rX,o+rX /var/www/html/wordpress
set up apache2
sudo nano /etc/apache2/sites-available/010-wordpress.conf

<VirtualHost *:80>

        ServerName wordpress
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/wordpress
        <Directory /var/www/html/wordpress>
            Options FollowSymLinks
            AllowOverride all
            Require all granted
        </Directory>

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

sudo nano /etc/apache2/apache2.conf

add at the end

<Directory /var/www/html/wordpress>
       AllowOverride All 
</Directory>

sudo a2dissite 000-default.conf
sudo a2ensite 010-wordpress.conf
sudo systemctl reload apache2

cordially