Standard Installation Procedures for LAMP Stack on CentOS 7
1. System Upgrade
yum -y update
2. Install Required Software
yum -y install git policycoreutils-python httpd mariadb mariadb-server php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
3. Setup MySQL Server
mysql_secure_installation
4. Start and Enable All Services
systemctl enable httpd
systemctl enable mariadb
systemctl start httpd
systemctl start mariadb
5. Open Firewall Ports
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --permanent --zone=public --add-port=<ssh_port>/tcp
firewall-cmd --reload
6. Change SSH Port
vim /etc/ssh/sshd_config #and append 'Port <ssh_port>'
semanage port -a -t ssh_port_t -p tcp <ssh_port>
systemctl restart sshd
7. Enable Shutdown Button
Edit /etc/systemd/logind.conf
and uncomment the following 2 lines:
PowerKeyIgnoreInhibited=no
HandlePowerKey=poweroff
8. Reboot System
reboot
(HP MicroServer Only)
Edit /etc/default/grub
and append clocksource=hpet nolapic
to the end of GRUB_CMDLINE_LINUX
variable.