Wordpress 2023

Uit MakerSpace Leiden
Ga naar: navigatie, zoeken

New setup for Wordpress 2023.

Standard Hetzner setup. Enable firewall. Move SSH to port 2222.

     apt update
     apt upgrade
     apt install apache2 php php-mysql
     apt install mariadb-server mariadb-client

Then disable external access, remove anon users, etc, etc:

     mysql_secure_installation

Create baseline setup with:

     mysql -u root -p

And give the SQL commands:

     CREATE DATABASE wordpress_db;
     CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'XXXX';
     GRANT ALL ON wordpress_db.* TO 'wp_user'@'localhost' IDENTIFIED BY 'password';
     FLUSH PRIVILEGES;
     Exit;

Fetch the latest Wordpress and check:

  cd /tmp && wget https://wordpress.org/latest.tar.gz
  openssl sha256 https://wordpress.org/latest.tar.gz 
  1. Check sha256 against the Wordpress website.
  cd /var/www/html
  tar zxf /tmp/latest.tar.gz
  cp -R wordpress /var/www/html
  rm /tmp/latest.tar.gz
  chown -R www-data:www-data /var/www/html/wordpress/
  chmod -R 755 /var/www/html/wordpress/
  mkdir /var/www/html/wordpress/wp-content/uploads
  chown -R www-data:www-data /var/www/html/wordpress/wp-content/uploads/

Updated the docroot to Wordpress:

  vi sites-enabled/000-default.conf 

Add settings to /etc/php/*/php.ini:

   upload_max_filesize=128M 
   post_max_size=128M 
   memory_limit=256M