Learn how to install the LEPP Stack (Linux, Nginx, PostgreSQL, PHP) on RHEL 8 with our detailed guide. Follow step-by-step instructions to set up and configure your LEPP Stack efficiently on your RHEL 8 system. #centlinux #linux #nginx #postgres #php
The LEPP Stack is a powerful and efficient software stack for building and deploying dynamic web applications. Each component of the LEPP Stack plays a crucial role:
The LEPP Stack is a reliable and powerful choice for developers looking to create dynamic and scalable web applications.
Recommended Online Training: Learn Bash Shell in Linux for Beginners
We have provisioned a RHEL 8 minimal installed virtual machine with following specifications.
A Local YUM repository is also configured, so we can install required packages without having an active Red Hat subscription.
Connect with rhel-8-lepp.example.com using ssh as root user.
PostgreSQL Database Server 10.6 is available in our local AppStream repository. Therefore, we can install it using dnf command.
# dnf install -y postgresql-server
Initialize PostgreSQL database instance with following command.
# postgresql-setup --initdb --unit postgresql * Initializing database in '/var/lib/pgsql/data' * Initialized, logs are in /var/lib/pgsql/initdb_postgresql.log
Enable and start PostgreSQL service.
# systemctl enable postgresql.service Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service â /usr/lib/systemd/system/postgresql.service. # systemctl start postgresql.service
Verify version of PostgreSQL database.
Due to security, the execution of PostgreSQL commands by root user is not permitted. Therefore, we have to switch user to postgres user to execute PostgreSQL commands.
# su - postgres $ postgres --version postgres (PostgreSQL) 10.6
PostgreSQL has been installed on Red Hat Enterprise Linux (RHEL) 8.
Nginx 1.14 is available in local AppStream repository. Therefore, we are installing it using dnf command.
# dnf install -y nginx
Enable and start Nginx service.
# systemctl enable nginx.service Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service â /usr/lib/systemd/system/nginx.service. # systemctl start nginx.service
Allow HTTP service in Linux firewall.
# firewall-cmd --permanent --add-service=http success # firewall-cmd --reload success
Browse URL http://rhel-8-lepp.example.com in a client’s browser.
Nginx web server has been installed on Red Hat Enterprise Linux (RHEL) 8.
PHP 7.2 is available in local AppStream repository. Therefore, we can install php and relevant packages using dnf command.
# dnf install -y php php-mysqlnd php-pdo php-gd php-mbstring php-fpm php-pgsql
Edit php-fpm configurations.
# vi /etc/php-fpm.d/www.conf
Find and set following directives therein.
user = nginx group = nginx listen.owner = nginx listen.group = nginx
Adjust permissions on PHP directories.
# chgrp nginx /var/lib/php/{opcache,session,wsdlcache}
Start and enable php-fpm service.
# systemctl enable php-fpm.service Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service â /usr/lib/systemd/system/php-fpm.service. # systemctl start php-fpm.service
Restart httpd.service to integrate PHP with Nginx web server.
# systemctl restart nginx.service
Create a PHP script to check PHP modules.
# echo "<?php phpinfo() ?>" > /usr/share/nginx/html/info.php
Browse URL http://rhel-8-lemp.example.com/info.php in a client’s browser.
PHP 7.2 has been installed and running on Red Hat Enterprise Linux (RHEL) 8.
If you are new to Linux and facing difficulty in working at Linux Bash prompt. We recommend that, you should read The Linux Command Line, 2nd Edition: A Complete Introduction by William Shotts.
If you found this guide on installing the LEPP Stack on RHEL 8 helpful and need further assistance with server setup or other technical support, consider hiring a professional. Visit my Fiverr profile for expert services in server configuration, database management, and more. Let’s make your project a success!
Puppy Linux is a fast, lightweight OS designed for speed and simplicity, perfect for old…
Learn how to change Apache document root in Linux by following this step-by-step guide. Adjust…
Discover how to change Apache port in Linux easily. Follow our simple guide to modify…
Learn how to create a virtual host in Apache Server with this comprehensive guide. Set…
Discover 10 practical tasks for the RHCSA exam with step-by-step solutions. Boost your Linux skills…
Discover the ultimate Fail2ban configuration guide. Learn how to set up, customize, and optimize Fail2ban…
This website uses cookies.
View Comments
Notice that you don't have to change http://www.conf, keept it running on "apache" is perfectly fine, default configuration is designed to work out if the box with Apache or Nginx.
Additional package (e.g. in EPEL, such as phpMyAdmin, Wordpress, ...) will rely on this settings
More, if you change default user, you also need to change used state directory (see php_value directive at the end of the http://www.conf file).
Thanks for your advice.