Important Notes:
This guide will show you how to install Apache, mySQL, and PHP from the Linux command line.
Getting Started:
Log into your server using SSH
First, we'll install apache. Issue the following command to install apache:
[root@server] yum install httpd mysql-server php mysql php-mysql
Next, we need to make sure that the firewall is configured to save its settings when stopped or restarted:
Edit /etc/sysconfig/iptables-config and make sure following variables are set to “yes”:
IPTABLES_SAVE_ON_STOP = “yes”
IPTABLES_SAVE_ON_RESTART = “yes”
Finally, we need to add the firewall rules allowing access to the HTTP and HTTPS ports and set SELinux to be permissive:
[root@server] iptables -I INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 80 -j ACCEPT
[root@server] iptables -I INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 443 -j ACCEPT
[root@server] service iptables restart
[root@server] echo 0 >/selinux/enforce
The LAMP stack should now be fully functional and accessible on your server.