1. Cài đặt Remi repository
## Remi Dependency on CentOS 7 and Red Hat (RHEL) 7 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
## Remi Dependency on CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
## Remi Dependency on CentOS 5 and Red Hat (RHEL) 5 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
2. Cài đặt Apache (httpd) Web server và PHP 5.6.4
yum --enablerepo=remi,remi-php56 install httpd php php-common
3.Cài đặt PHP 5.6.4 modules
yum --enablerepo=remi,remi-php56 install php-pecl-apcu php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
4. Khởi động Apache HTTP server (httpd) và tự động chạy Apache HTTP server (httpd) khi khởi động.
## CentOS / RHEL 6.6/5.11 ##
/etc/init.d/httpd start ## use restart after update
## OR ##
service httpd start ## use restart after update
## Fedora and CentOS/RHEL 7 ##
systemctl enable httpd.service
## CentOS / RHEL 6.6/5.11 ##
chkconfig --levels 235 httpd on
5. Tạo test file test PHP và Apache
Thêm file /var/www/html/info.php với nội dung.
<?php
phpinfo();
?>
Mở trình duyệt web gõ: http://IP/info.php , nếu chạy ra trang phpinfo là thành công.
6. Tạo Rule allow port 80 cho apache trên firewall iptables
iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -I INPUT 1 -p tcp --dport 22 -j ACCEPT
iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
iptables -P INPUT DROP
/etc/init.d/iptables save