Logo

dev-resources.site

for different kinds of informations.

Installing Apache, PHP, and MySQL on Oracle Linux 8

Published at
8/8/2024
Categories
ol8
apache
php
mysql
Author
nhisyamj
Categories
4 categories in total
ol8
open
apache
open
php
open
mysql
open
Author
8 person written this
nhisyamj
open
Installing Apache, PHP, and MySQL on Oracle Linux 8

Bismillah...

Instructions to Install Apache, PHP, and MySQL on Oracle Linux 8

  1. Install Apache Web Server
   sudo yum install -y httpd
Enter fullscreen mode Exit fullscreen mode
  • Installs the Apache HTTP server.
  1. Enable and Start Apache
   sudo systemctl enable httpd
   sudo systemctl restart httpd
Enter fullscreen mode Exit fullscreen mode
  • Enables Apache to start on boot and restarts it to apply changes.
  1. Configure Firewall
   sudo firewall-cmd --add-service=http --permanent
   sudo firewall-cmd --reload
Enter fullscreen mode Exit fullscreen mode
  • Opens HTTP (port 80) on the firewall and reloads the firewall to apply the rule.
  1. Install PHP
   dnf module list php
   sudo dnf module reset php
   sudo dnf install @php:7.4
   sudo dnf install php-mysqli
Enter fullscreen mode Exit fullscreen mode
  • Lists available PHP modules, resets the PHP module, and installs PHP 7.4 with MySQL support.
  1. Allow Apache to Connect to External Databases (optional)
   setsebool -P httpd_can_network_connect_db 1
Enter fullscreen mode Exit fullscreen mode
  • Configures SELinux to allow Apache to connect to databases over the network.
  1. Set Permissions for Apache
   chown -R apache:apache *
   # if you have folder to store uploaded file (optional)
   sudo chcon -R -t httpd_sys_rw_content_t docsuploaded
   find /var/www/html -type d -exec chmod 755 {} \;
   find /var/www/html -type f -exec chmod 644 {} \;
   systemctl restart httpd
Enter fullscreen mode Exit fullscreen mode
  • Changes ownership of files to Apache, sets security context for directories, adjusts file permissions, and restarts Apache.
  1. Install MySQL Server
   yum install https://dev.mysql.com/get/mysql84-community-release-el8-1.noarch.rpm
   yum-config-manager --disable mysql-8.4-lts-community
   yum-config-manager --disable mysql-tools-8.4-lts-community
   yum-config-manager --enable mysql80-community
   yum-config-manager --enable mysql-tools-community
   yum repolist enabled | grep mysql
   sudo yum module disable mysql
   yum install mysql-community-server
Enter fullscreen mode Exit fullscreen mode
  • Installs MySQL Community Edition, disables unnecessary repositories, and installs the MySQL server.
  1. Start MySQL and Check Status
   systemctl start mysqld
   systemctl status mysqld
Enter fullscreen mode Exit fullscreen mode
  • Starts the MySQL server and checks its status.
  1. Retrieve MySQL Temporary Root Password
   sudo grep 'temporary password' /var/log/mysqld.log
Enter fullscreen mode Exit fullscreen mode
  • Fetches the temporary root password for MySQL from the log file.

Buy Me A Coffee

apache Article's
30 articles in total
Favicon
Power Up Your AWS Game: Create EC2 Instances, Install Apache, and Connect with PowerShell
Favicon
AutoMQ: A Revolutionary Cloud-First Alternative to Kafka
Favicon
Laravel 11: Allowed memory size of 134217728 bytes exhausted (tried to allocate 23085056 bytes)
Favicon
Seamlessly Migrate PostgreSQL to YugabyteDB in Minutes!
Favicon
Apache Log Parser and Data Normalization Application
Favicon
Unlock 10% Discounts in 5 Minutes: Build a Drools Project with Maven
Favicon
[pt-BR] Como criei minha prรณpria imagem Docker do Apache Benchmark para testes de stress em servidores web
Favicon
What Goes Into a Major OSS Release? A CouchDB Story
Favicon
Monitor Apache Ignite in 5 Minutes: Fix Cluster Issues Fast!
Favicon
Mastering Data Routing in Apache Camel: Leveraging the Splitter Pattern
Favicon
Exploring Core Features and Components of Apache Camel
Favicon
Practical Guide to Apache Camel with Quarkus: Building an ETL Application
Favicon
Implementation of Missing Security Header Vulnerability in Apache (Part 2)
Favicon
Join Apache Answer at CommunityOverCode Asia 2024
Favicon
Implementation of Missing Security Header Vulnerability in Apache (Part 1)
Favicon
Installing Apache, PHP, and MySQL on Oracle Linux 8
Favicon
Install LEMP LAMP LLMP LEPP LAPP or LLPP using parameters only
Favicon
Deploying an Application Using Apache as a Web Server
Favicon
My first experience with the LAMP stack
Favicon
Shades of Open Source - Understanding The Many Meanings of "Open"
Favicon
Updating the solr client(org.apache.solr.solr-core) from 8.11.2 to 9.6.0
Favicon
Automating the installation of a LAMP stack on Ubuntu 22.04
Favicon
How to setup an Apache server on Ubuntu 22.04.4 LTS with Virtual hosting
Favicon
Build a Safe and Respectful Community with Answer 1.3.1
Favicon
Apache Spark 101
Favicon
Apply for Apache Answerโ€™s Project at OSPP 2024
Favicon
Understanding Kappa Architecture and Kafka: Empowering Real-Time Data Processing
Favicon
Run Laravel locally on Ubuntu using Apache virtual host
Favicon
Deploy Sendy on AWS EC2 with Apache in Ubuntu
Favicon
Docker LAMP Stack With Composer PSR-4 Autoloading โ€“ Apache Server

Featured ones: