Although there are many control panels available today for 1-click WordPress installation, many people still prefer to install WordPress manually using a LAMP or LEMP stack. If you are looking for how to install WordPress on Alma Linux 10 with a LEMP stack without using a control panel, you can follow the tutorial on this page.
If you are using a different version of Alma Linux, there may be some things or paths that you need to adjust yourself. Additionally, for this tutorial, the domain has already been pointed to the server with the domain name tutorial.wpgan.com, so you can adjust it to your own domain name later.
How to Install WordPress on Alma Linux 10 with a LEMP Stack
Before starting, make sure you have root access to the VPS you will be using. If you do not have a VPS yet, you can try the service at Vultr from [This Page] to get a $300 trial credit when you link a credit card or PayPal.
If you already have a VPS with the Alma Linux 10 OS, you can proceed to the first step
1. Update System & Install Basic Tools
Make sure to update the system before performing the installation, and also install the basic tools that you will need for the WordPress installation process
dnf -y updatednf -y install epel-release dnf-plugins-core curl ca-certificates gnupg2 tar unzip2. Setup Firewall and Set SELinux
For security, you can enable the firewall, or if you are using a service like Google Console, there is usually a firewall already configured in the dashboard, so this option is optional
systemctl enable firewalldsystemctl start firewalld
firewall-cmd --permanent --add-service=httpfirewall-cmd --permanent --add-service=httpsfirewall-cmd --permanent --add-port=22/tcp ## untuk akses SSH, jika menggunakan port lain, pastikan allow juga port customnyafirewall-cmd --reloadAlso, make sure to set SELinux so it does not block the web server (required)
setsebool -P httpd_can_network_connect 1setsebool -P httpd_can_network_connect_db 13. Add Nginx, PHP, and MariaDB Repos
Since we are using LEMP here, it means we need to install Nginx, PHP, and MariaDB. However, before installing, you need to add the upstream repo so you can install the latest versions of Nginx, PHP 8.5, and MariaDB 11.8.
# Enable CRB repodnf config-manager --set-enabled crb
# Install Remi repo (untuk PHP 8.5)dnf -y install https://rpms.remirepo.net/enterprise/remi-release-10.rpm
# Tambah official Nginx stable repocat > /etc/yum.repos.d/nginx.repo << 'EOF'[nginx-stable]name=nginx stable repobaseurl=https://nginx.org/packages/rhel/$releasever/$basearch/gpgcheck=1enabled=1gpgkey=https://nginx.org/keys/nginx_signing.keymodule_hotfixes=trueEOF
# Tambah MariaDB 11.8 repocurl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash -s -- --mariadb-server-version=mariadb-11.84. Install Nginx, PHP 8.5, and MariaDB
Once you add the upstream repo, you can then install Nginx, PHP, and MariaDB
# Install Nginxdnf -y install nginx
# Enable PHP 8.5 dari Remidnf module reset php -ydnf -y install php85 php85-php-fpm php85-php-mysqlnd php85-php-gd \ php85-php-xml php85-php-mbstring php85-php-curl php85-php-zip \ php85-php-intl php85-php-json php85-php-opcache
# Install MariaDBdnf -y install mariadb-server mariadbMake sure to start all services (Nginx, PHP, MariaDB) after the installation is complete
systemctl enable --now nginxsystemctl enable --now php85-php-fpmsystemctl enable --now mariadbTo double-check, you can also verify the installed versions
nginx -vphp85 -vmariadb --version5. Create WordPress Database
Before creating the database, make sure you secure MariaDB first
mariadb-secure-installationJust complete the secure install prompts such as setting the root password, removing anonymous users, disallowing remote root login, and removing the test database. Answer Y to all of them to apply everything.
If you have already secured MariaDB or the database, you can then access the database
mariadb -u root -pOnce you have entered MariaDB, you can create a new database
CREATE DATABASE wpgan_wp_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE USER 'wpgan_wp_user'@'localhost' IDENTIFIED BY 'input_password_kamu_disini';GRANT ALL PRIVILEGES ON wpgan_wp_db.* TO 'wpgan_wp_user'@'localhost';FLUSH PRIVILEGES;EXIT;Make sure to change input_your_password_here with the database password you will be using.
6. Download and Extract WordPress
First, download the latest WordPress to the /tmp folder and extract the files
cd /tmpcurl -O https://wordpress.org/latest.tar.gztar -xzf latest.tar.gzcp wordpress/wp-config-sample.php wordpress/wp-config.phpMove the extracted files to your website installation folder
mkdir -p /var/www/html/tutorial.wpgan.comcp -r wordpress/* /var/www/html/tutorial.wpgan.com/Also, update the permissions on your website folder
chown -R nginx:nginx /var/www/html/tutorial.wpgan.comchmod -R 755 /var/www/html/tutorial.wpgan.com7. Configure WordPress Database
So that the database is connected and you can perform the WordPress installation, you need to set up the database and WordPress salts first
nano /var/www/html/tutorial.wpgan.com/wp-config.phpChange the DB_NAME, DB_USER, and DB_PASSWORD sections according to the database you created in step number 5.
8. Configure Nginx Server
So that the website can be accessed, you need to configure the Nginx virtual host server first
nano /etc/nginx/conf.d/wpgan-wp.confFill the file with this code
server { listen 80; server_name tutorial.wpgan.com www.tutorial.wpgan.com; root /var/www/html/tutorial.wpgan.com; index index.php index.html index.htm;
location / { try_files $uri $uri/ /index.php?$args; }
location ~ \.php$ { fastcgi_pass unix:/var/opt/remi/php85/run/php-fpm/www.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
location ~ /\.ht { deny all; }
client_max_body_size 64M;}adjust the server_name and root according to the domain name and document root of the WordPress files you created.
Save the changes by clicking CTRL + X > Y > Enter.
Note: the socket path for PHP 8.5 from Remi is at /var/opt/remi/php85/run/php-fpm/www.sock. Check it first if you are unsure:
find /var -name "www.sock" 2>/dev/nullAlso, do not forget to test the Nginx configuration and reload the Nginx service
nginx -tsystemctl reload nginx9. Update ACL Users
By default, the ACL Users in PHP FPM 8.5 are installed using Apache, but because we are using Nginx, it will automatically result in a 502 error when the website is accessed. Update the ACL Users first
nano /etc/opt/remi/php85/php-fpm.d/www.confPress CTRL + F to search, then look for listen.acl_users. Change the value listen.acl_users = apache to listen.acl_users = nginx, then save
10. Complete WordPress Configuration
Now you can access your website's IP address or domain name to perform the WordPress configuration, such as entering the website name, setting the admin username, email, and more.
Complete the process and your WordPress is ready to be used.
That is the quick step to install WordPress on Alma Linux 10 with a LEMP Stack that you can try.
COMMENTS
Loading...