Installing A LAMP Stack In CentOS 7 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 CentOS 7. 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 ip address 192.168.1.120.
Now lets get started.L
Updates, Apps and Repositories
Updates, apps and repositories.
sudo yum -y install epel-release
sudo yum -y install yum-utils
sudo yum -y install wget tar perl
sudo yum -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
Verify the Apache install by entering your ip address in you browser.
PHP
Install PHP and everything that goes with it.
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
sudo rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum-config-manager --enable remi-php74
sudo yum -y install php-curl php-zip
sudo yum -y install php php-fpm php-mysqlnd php-opcache php-gd php-xml php-mbstring
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.
<?php
phpinfo();
?>
Remove the info.php file.
Maria DB
Install MariaDB.
Start the MariaDB service.
MariaDB needs to start at boot.
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!
phpMyAdmin (optional)
Install phpMyAdmin (optional).
Edit the phpMyAdmin configuration file.
Because this is a local server, edit the following lines in phpMyAdmin.conf to look like this.
# <RequireAny>
# Require ip 127.0.0.1
# Require ip ::1
# </RequireAny>
Require all granted
Restart Apache.
Enter your ip address into your browser fallowed by /phpMyAdmin to launch the app.
That’s it. You are ready to install a FTP server and a CMS.