Installing A LAMP Stack In Oracle Linux 8.5 And VMware
LAMP is the accumulation of software that allows you to host a website on your local Linux system. This tutorial presumes you have a minimal install of Oracle Linux 8.5 You need to be logged in to the server using Putty or equivalent as an administrator.
I highly recommend you create a new document in NotePad++ or your favorite text editor. Copy the commands found below into your new document where you can then make changes such as server name, user name etc. You can then copy and paste these lines of code one at a tine into Putty. This will give you a reliable document showing exactly how you created your AMP installation
For this tutorial we will be using the local domain 192.168.1.140/test.
Now lets get started.
Updates, Apps and Repositories
Updates, apps and repositories.
sudo dnf -y install yum-utils
sudo dnf -y install wget tar perl
sudo dnf -y install nano
Apache (httpd)
Install Apache web server (httpd).
Start Apache.
Apache needs to start at boot.
Allow web traffic through the firewall.
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
sudo systemctl restart firewalld
sudo systemctl start httpd
Verify the Apache install by entering your ip address in you browser.
PHP
Install PHP and everything that goes with it.
sudo dnf module reset php
sudo dnf module install php:7.4
sudo dnf -y install php-curl php-zip
sudo dnf -y install php php-fpm php-mysqlnd php-opcache php-gd php-xml php-mbstring
Verify php version.
Restart Apache.
Verify the PHP installation by creating the info.php file and executing it.
Put the folowing text in the file created and save it.
phpinfo();
?>
Remove the info.php file.
Maria DB
Install MariaDB.
Start the MariaDB service.
MariaDB needs to start at boot.
To confirm that MariaDB daemon is running, run the command.
Secure the MariaDB installation and follow the onscreen instructions.
Enter current password for root (hit Enter for none as you do not have one yet):
Just hit ENTER and follow the prompts on the screen.
OK, successfully used password, moving on…
Set root password? [Y/n] y
New password: (enter your new password)
Re-enter new password: (reenter your new password)
Password updated successfully!
Reloading privilege tables..
… Success!
Remove anonymous users? [Y/n] y
… Success!
Disallow root login remotely? [Y/n] y
… Success!
Remove test database and access to it? [Y/n] y
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!
Reload privilege tables now? [Y/n] y
… Success!
Cleaning up…
All done! If you’ve completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!