VK Cloud logo
Updated atNovember 10, 2023   10:48 AM

Installing WordPress on Linux

WordPress is a content management system (CMS) written in PHP and using a MySQL database. Allows you to create blogs, websites or web applications.

This instruction will help you deploy the latest version of the WordPress CMS in the Almalinux 9 operating system in VK Cloud, as well as configure a DNS record for domain name access. MySQL 8.0 Single configuration is used as a DBMS.

Preparatory steps

  1. Register at VK Cloud.

  2. Create network1 network with internet access and a subnet with the address 10.0.0.0/24.

  3. Create VM:

    • name: Almalinux_9_WP;
    • operating system Almalinux 9;
    • network: network1 with subnet 10.0.0.0/24;
    • assign a public IP address. The example will use 212.233.95.135;
    • security groups (firewall settings): default, ssh+www.
  4. Create DB instance:

    • name: MySQL-9341;
    • DBMS: MySQL 8.0;
    • configuration type: Single;
    • network: network1;
    • DB name: wordpress-db;
    • DB username: wordpress;
    • DB password: AN0r25e0ae4d626p;

    In the example, the internal IP of the created instance: 10.0.0.7.

  5. Create DNS zone.

  6. Create an record in the selected zone:

    • record type: A;
    • name: for example, site-wp.example.vk.cloud;
    • IP address: external VM address 212.233.95.135.
  7. (Optional) Check the name resolution to the IP address using the command nslookup site-wp.example.vk.cloud. Output upon successful operation:

    1Non-authoritative answer:
    2Name:   site-wp.example.vk.cloud
    3Address: 212.233.95.135

2. Install WordPress on VM

  1. Connect to the Almalinux_9_WP VM.

  2. Update the packages to the current version and reboot the VM using the commands:

    1sudo dnf update -y
    2sudo systemctl reboot
  3. Download the necessary repositories by sequentially executing the commands:

    1sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y
    2sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm -y
    3sudo dnf module enable php:remi-8.2 -y
    4sudo dnf install wget httpd php php-mysqlnd php-gd php-intl php-bcmath php-pecl-zip -y
  4. Launch the httpd daemon:

    sudo systemctl enable httpd.service --now
  5. Download the WordPress CMS repository and deploy it on a running web server:

    1sudo wget https://wordpress.org/latest.tar.gz
    2sudo tar xzf latest.tar.gz -C /var/www/html/
    3sudo chown -R apache:apache /var/www/html/wordpress/
  6. Set the SELinux parameters for the correct operation of the web server:

    1sudo setsebool -P httpd_can_network_connect on
    2sudo setsebool -P httpd_unified on
    3sudo setsebool -P httpd_enable_cgi on
    4sudo setsebool -P httpd_builtin_scripting on
  7. In the browser, enter the VM's public IP address with /wordpress. In the current instruction it is site-wp.example.vk.cloud/wordpress.

  8. In the installation wizard, specify the English language and read the information about installing the CMS.

  9. Specify the parameters MySQL-9341:

    • Database name: wordpress-db.
    • Username: wordpress.
    • Password: AN0r25e0ae4d626p.
    • Database Host: 10.0.0.7.
    • Table Prefix: wp_
  10. Specify the CMS credentials:

    • Site Title: site-wp.example.vk.cloud.
    • Username: admin.
    • Password: come up with an administrator password.
    • Your Email: specify the email address of the CMS administrator.
  11. Click the Install WordPress button.

3. Check the functionality of WordPress

  1. In the browser, go to http://site-wp.example.vk.cloud/wordpress/.
  2. In the authorization window, enter the username and password of the CMS administrator.

The WordPress CMS admin panel opens.

Delete unused resources

Deployed virtual resources are charged. If you don't need them anymore:

  • Delete Almalinux_9_WP VM.
  • Delete MySQL-9341 instance.
  • If necessary, delete 212.233.95.135 floating IP address.
  • Delete site-wp.example.vk.cloud DNS record.