Skip to content

Wordpress on Linux

Guide to Installing WordPress on Linux

Instructions

1. Download the files

bash
git clone https://github.com/ArduinoDenis/wordpress_linux.git

2. Run the installation script

bash
cd wordpress_linux/ && sudo chmod 700 installer.sh && ./installer.sh

3. Wait for the completion of the installation of various programs.

4. Post-installation manual procedure

  1. Securely install MySQL
bash
sudo mysql_secure_installation
  1. Press enter and input the current password for the root user.
  2. If prompted to Set root password, type Y and press enter.
  3. Input a new password when prompted and press enter. Important: Remember this password as it's required to configure WordPress later.
  4. Type Y for "Remove anonymous users" to remove anonymous users.
  5. Type Y for "Disallow root login remotely" to prevent root login remotely.
  6. Type Y for "Remove test database and access to it" to remove the test database.
  7. Type Y for "Reload privilege tables now" to reload privilege tables.
  8. Once done, you will see "All done!" and "Thanks for using MariaDB!".
  9. Access MySQL with root user and the password chosen earlier
bash
sudo mysql -uroot -p
  1. Create the database named wordpress
bash
create database wordpress;
  1. You should receive the response: "Query OK, 1 row affected (0.00 sec)" if there are no issues.
  2. Grant all privileges to the WordPress database
bash
GRANT ALL PRIVILEGES ON wordpress.* TO 'root'@'localhost' IDENTIFIED BY 'insert your password';
  1. Reload privileges
bash
FLUSH PRIVILEGES;
  1. Exit from MariaDB with Ctrl + D
  2. Enable Apache rewrite module
bash
sudo a2enmod rewrite
  1. Configure Apache by adding the following lines at the beginning of the 000-default.conf file
bash
sudo nano /etc/apache2/sites-available/000-default.conf
apache
<Directory "/var/www/html">
    AllowOverride All
</Directory>

Save and exit with Ctrl+O and Ctrl+X.

  1. Restart Apache
bash
sudo service apache2 restart
  1. Open a browser (e.g., Google Chrome, Edge, Firefox) and visit the following link: http://server_ip/wp-admin/setup-config.php to continue with the WordPress setup wizard.

Fill in the basic site information following the screenshot


screenshot