<\/span><\/h2>\n\n\n\nFirst, log in to your AlmaLinux 8 server via SSH as the root user:<\/p>\n\n\n\n
ssh root@IP_Address -p Port_number<\/pre>\n\n\n\nYou will need to replace ‘IP_Address’ and ‘Port_number’ with your server\u2019s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.<\/p>\n\n\n\n
Before starting, you have to make sure that all AlmaLinux OS packages installed on the server are up to date. You can do this by running the following commands:<\/p>\n\n\n\n
dnf update -y<\/pre>\n\n\n\nNext, verify the current version of your operating system using the following command:<\/p>\n\n\n\n
cat \/etc\/os-release<\/pre>\n\n\n\nYou should get the following output:<\/p>\n\n\n\n
NAME=\"AlmaLinux\"\nVERSION=\"8.4 (Electric Cheetah)\"\nID=\"almalinux\"\nID_LIKE=\"rhel centos fedora\"\nVERSION_ID=\"8.4\"\nPLATFORM_ID=\"platform:el8\"\nPRETTY_NAME=\"AlmaLinux 8.4 (Electric Cheetah)\"\nANSI_COLOR=\"0;34\"\nCPE_NAME=\"cpe:\/o:almalinux:almalinux:8.4:GA\"\nHOME_URL=\"https:\/\/almalinux.org\/\"\nDOCUMENTATION_URL=\"https:\/\/wiki.almalinux.org\/\"\nBUG_REPORT_URL=\"https:\/\/bugs.almalinux.org\/\"\nALMALINUX_MANTISBT_PROJECT=\"AlmaLinux-8\"\nALMALINUX_MANTISBT_PROJECT_VERSION=\"8.4\"\n<\/pre>\n\n\n\n<\/span>Install LAMP Server<\/span><\/h2>\n\n\n\nFirst, install the Apache web server, MariaDB server, PHP and other packages using the following command:<\/p>\n\n\n\n
dnf install httpd httpd-tools mariadb-server php php-json php-mysqlnd php-json php-curl unzip -y<\/pre>\n\n\n\nAfter installing all packages, start the Apache and MariaDB service and enable them to start at system reboot:<\/p>\n\n\n\n
systemctl start httpd\nsystemctl enable httpd\nsystemctl start mariadb\nsystemctl enable mariadb<\/pre>\n\n\n\n<\/span>Create a WordPress Database<\/span><\/h2>\n\n\n\nNext, you will need to create a database and user for WordPress.<\/p>\n\n\n\n
First, log in to MariaDB with the following command:<\/p>\n\n\n\n
mysql<\/pre>\n\n\n\nOnce you log in, create a database and user with the following command:<\/p>\n\n\n\n
MariaDB [(none)]> CREATE DATABASE wpdb;\nMariaDB [(none)]> CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'password';<\/pre>\n\n\n\nNext, grant all the privileges to WordPress database with the following command:<\/p>\n\n\n\n
MariaDB [(none)]> GRANT ALL ON wpdb.* TO 'wpuser'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;<\/pre>\n\n\n\nNext, flush the privileges and exit from the MariaDB with the following command:<\/p>\n\n\n\n
MariaDB [(none)]> FLUSH PRIVILEGES;\nMariaDB [(none)]> EXIT;<\/pre>\n\n\n\n<\/span>Install WordPress<\/span><\/h2>\n\n\n\nFirst, change the directory to the Apache web root and download the latest version of WordPress with the following command:<\/p>\n\n\n\n
cd \/var\/www\/html\nwget https:\/\/wordpress.org\/latest.tar.gz<\/pre>\n\n\n\nAfter downloading WordPress, extract the downloaded file with the following command:<\/p>\n\n\n\n
tar -xvzf latest.tar.gz<\/pre>\n\n\n\nNext, change the directory to WordPress and rename the sample config file:<\/p>\n\n\n\n
cd wordpress\nmv wp-config-sample.php wp-config.php<\/pre>\n\n\n\nNext, edit the sample config file and define your database settings:<\/p>\n\n\n\n
nano wp-config.php<\/pre>\n\n\n\nChange the following values:<\/p>\n\n\n\n
define( 'DB_NAME', 'wpdb' );\n\n\/** MySQL database username *\/\ndefine( 'DB_USER', 'wpuser' );\n\n\/** MySQL database password *\/\ndefine( 'DB_PASSWORD', 'password' );\n\n\/** MySQL hostname *\/\ndefine( 'DB_HOST', 'localhost' );\n<\/pre>\n\n\n\nSave the file then set proper ownership to the WordPress directory:<\/p>\n\n\n\n
chown -R apache:apache \/var\/www\/html\/wordpress<\/pre>\n\n\n\n