Thursday 15 April 2021

LAMP installation in CentOS Stream, RedHat 8





Greeting Everyone,

Installation of LAMP Stack in RedHat 8, CentOS Stream and Oracle Linux 8

First of all, during apache server installation its completely up to you and can begin with whatever you like either apache or mariadb or php. I will start in LAMP format which is Linux first and it obviously already installed then apache, mariadb then finally, php


Update your system
# dnf update -y

Install Apache (httpd)
# dnf install httpd httpd-tools

Start and Enable Apache (httpd)
# systemctl start httpd
# systemctl enable httpd
# netstat -tnlp

Give permission to Apache and check website
# chown apache:apache -R /var/www/html
# echo “welcome to the site” >> /var/www/html

 Install MariaDB

# dnf install mariadb-server mariadb

Enable MariaDB
# systemctl start mysqld
# systemctl enable mysqld

Mysql installation to create user and pass
# mysql_secure_installation

 

create a root password and selected Y to all

# mysql -u root -p
MariaDB> exit;

Install php
# dnf install php php-fpm php-xml php-mysqlnd php-gd php-mbstring

Enable php-fpm
# systemctl start php-fpm
# systemctl enable php-fpm

Enable SELINUX to allow apache to execute PHP-FPM
# setsebool -P httpd_execmem 1
Enable firewall for port 80, 443 and 3306
# systemctl status firewalld
# systemctl start firewalld
# firewall-cmd --permanent --zone=public --add-port=80/tcp
# firewall-cmd --permanent --zone=public --add-port=443/tcp 
# firewall-cmd --permanent --zone=public --add-port=3306/tcp 
# firewall-cmd --reload
# firewall --list-all

Test php
# echo “<?php phpinfo() ?)” >> /var/www/html/info.php
# links http://localhost/info.php

1 comment:

  1. Hi There,

    11/10!! Your blog is such a complete read. I like your approach with Linux made for Aarif. Clearly, you wrote it to make learning a cake walk for me.

    I've been browsing the many Linux setups but could not find exactly what I am looking for.
    I'd like to boot a Linux kernel and be able to RDP to a windows computer. More specifically, I would like Linux to boot from a USB drive, display a small window where I would type in the computer name I want to connect to and press [ENTER] to connect.
    Excellent tutorials - very easy to understand with all the details. I hope you will continue to provide more such tutorials.

    Kind Regards,
    Radhey

    ReplyDelete