After launching an AWS EC2 instance , with RHEL 7 , LAMP can be setup as outlined below :
Update Linux
To update Linux run this command :
sudo yum update
If nothing gets updated , no need to reboot . Otherwise reboot the server by issuing this command :
sudo reboot
Install Apache Web Server
Command to install Apache Web Server :
sudo yum install httpd
Command to start Apache Web Server at System Boot/Reboot :
sudo systemctl enable httpd.service
Command to start Apache Web Server now :
sudo systemctl start httpd.service
Command to check if Apache Web Server has started and is active :
systemctl is-active httpd.service
sudo apachectl configtest
Install PHP Scripting Language
Before installing PHP make sure RHEL’s Extras and Optional repos are enabled . This is to make sure php-mbstring gets installed .
View the list of available repos using these commands :
sudo yum -y install yum-utils
sudo yum repolist all
Command to enable Extras and Optional repos :
sudo yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
View and make sure those repos are enabled :
sudo yum repolist all
Now install PHP using this command :
sudo yum install php php-mysql php-gd php-pear php-mbstring
Restart Apache Web Server
sudo systemctl restart httpd.service
Install MariaDB MySQL Database Server
sudo yum install mariadb-server mariadb
sudo systemctl start mariadb
sudo mysql_secure_installation
sudo systemctl enable mariadb.service
AWS => Amazon Web Services
EC2 => Elastic Compute Cloud
RHEL => Red Hat Enterprise Linux
LAMP => Linux Apache MySQL PHP
- Published by : Athyala Mani Kanth
- Last Updated : 2016-01-14