If you're interested in exploring website design with WordPress, this guide will help you set up a WordPress instance on your local machine with VMware. The technology stack used consists of RHEL, Apache, MySQL, and PHP, although it is not based on a typical LAMP installation.
RHEL 8.5
1. Select Minimal Installation
2. Turn off SELinux
# vi /etc/selinux/config
SELINUX=disabled
3. Set Hostname
# hostnamectl set-hostname <hostname> --static
4. Set local domain name
# vi /etc/hosts
<local.ip> <local.dns.name> <local.hostname>
5. Register Red Hat subscription
# subscription-manager register --username <username> --password <password>
/* subscription-manager attach --auto */
/* To check https://access.redhat.com/management/subscriptions/product/RH00798/systems */
6. Install Packages as required
# yum install -y net-tools-2.0-0.52.20160912git.el8.x86_64
# yum install -y telnet
# yum install -y wget
# yum install -y unzip
# yum install -y perl
7. Update System as required
# yum -y update
Apache
1. Install Apache webserver
# yum install -y httpd
2. Start and Enable Apache service
# systemctl start httpd
# systemctl enable httpd
3. Open HTTP port
# firewall-cmd --permanent --add-port=80/tcp
# firewall-cmd --reload
# firewall-cmd --list-all
PHP
1. Switch PHP version to 8.2 to support latest Wordpress
# yum module list php
/* yum module switch-to php:8.2 */
# yum module install --all php:8.2
# php -v
# yum install -y php php-mysqlnd php-pdo php-gd
# php -m
2. Tweak PHP parameters as required by Wordpress
# vi /etc/php.ini
max_input_vars = 3000
post_max_size = 36M
3. Reload PHP-FPM service post php configuration
# systemctl restart php-fpm
4. Verify PHP configurations
# echo "<?php phpinfo() ?>" > /var/www/html/phpinfo.php
WordPress
1. Download latest Wordpress
# wget https://wordpress.org/latest.tar.gz
# tar -xvf latest.tar.gz
# cp -rp wordpress /var/www/html/
2. Assign ownership
# cd /var/www/html
# chown -R apache:apache wordpress/
3. Create Apache WordPress VirtualHost file
# vi /etc/httpd/conf.d/wordpress.conf
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot /var/www/html/wordpress
<Directory "/var/www/html/wordpress">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
ErrorLog /var/log/httpd/wordpress_error.log
CustomLog /var/log/httpd/wordpress_access.log common
</VirtualHost>
4. Restart Apache service
# systemctl restart httpd
MySQL
1. Download and Install MySQL
# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-server-8.0.37-1.el8.x86_64.rpm
# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-client-8.0.37-1.el8.x86_64.rpm
# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-common-8.0.37-1.el8.x86_64.rpm
# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-client-plugins-8.0.37-1.el8.x86_64.rpm
# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-libs-8.0.37-1.el8.x86_64.rpm
# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-icu-data-files-8.0.37-1.el8.x86_64.rpm
# rpm -ivh mysql-community-client-plugins-8.0.37-1.el8.x86_64.rpm
# rpm -ivh mysql-community-common-8.0.37-1.el8.x86_64.rpm
# rpm -ivh mysql-community-libs-8.0.37-1.el8.x86_64.rpm
# rpm -ivh mysql-community-client-8.0.37-1.el8.x86_64.rpm
# rpm -ivh mysql-community-icu-data-files-8.0.37-1.el8.x86_64.rpm
# rpm -ivh mysql-community-server-8.0.37-1.el8.x86_64.rpm
2. Secure MySQL installation
# grep 'temporary password' /var/log/mysqld.log
# mysql_secure_installation
> Enter temporary password
> Enter New password = P@ssw0rd123
> Change the password for root ? ((Press y|Y for Yes, any other key for No) : Y
> Enter New password = P@ssw0rd123
> Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
> Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y
> Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
3. MySQL version
# mysql --version
4. Start and Enable MySQL service
# systemctl start mysqld
# systemctl enable mysqld
5. Create Wordpress database
# mysql -u root -p
mysql> create database wordpress;
mysql> CREATE USER 'wpadmin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'P@ssw0rd123';
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wpadmin'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> SELECT * FROM mysql.user;
mysql> exit
6. Verify access via localhost
# mysql -h localhost -u root -p
7. Tweak MySQL parameters as required by Wordpress
# vi /etc/my.cnf
transaction-isolation=READ-COMMITTED
init_connect = "set session autocommit=0"
character-set-server = utf8
8. Restart MySQL service post configuration change
# systemctl restart mysqld
Complete Wordpress installation
Browse http://<local.dns.name>
Follow the installation guide
Create and update wp-config.php as per the instructions