Skip to main content

Standard Installation Procedures for LAMP Stack on CentOS 7

1. System Upgrade

  1. yum -y update

2. Install Required Software

  1. 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

  1. mysql_secure_installation

4. Start and Enable All Services

  1. systemctl enable httpd
  2. systemctl enable mariadb
  3. systemctl start httpd
  4. systemctl start mariadb

5. Open Firewall Ports

  1. firewall-cmd --permanent --zone=public --add-service=http
  2. firewall-cmd --permanent --zone=public --add-service=https
  3. firewall-cmd --permanent --zone=public --add-port=<ssh_port>/tcp
  4. firewall-cmd --reload

6. Change SSH Port

  1. vim /etc/ssh/sshd_config #and append 'Port <ssh_port>'
  2. semanage port -a -t ssh_port_t -p tcp <ssh_port>
  3. systemctl restart sshd

7. Enable Shutdown Button

Edit /etc/systemd/logind.conf and uncomment the following 2 lines:

  1. PowerKeyIgnoreInhibited=no
  2. HandlePowerKey=poweroff

8. Reboot System

  1. reboot

(HP MicroServer Only)

Edit /etc/default/grub and append clocksource=hpet nolapic to the end of GRUB_CMDLINE_LINUX variable.