Tag Archives: Install Apache

Installing LAMP on CentOS

Install Apache HTTP Server (httpd) and PHP 5.3.8

Reposted from Here.
1. Change root user
su –
2. Install Remi repository
## Remi Dependency on CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm
## CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
3. Install Apache (httpd) Web server and PHP 5.3.8
yum –enablerepo=remi install httpd php php-common
4. Install PHP 5.3.8 modules
yum –enablerepo=remi install php-pear php-pdo php-mysql php-pgsql php-pecl-memcache php-gd php-mbstring php-mcrypt php-xml
5. Start Apache HTTP server (httpd) and autostart Apache HTTP server (httpd) on boot
service httpd start ## use restart after update
chkconfig –levels 235 httpd on
6. Create test PHP page to check that Apache, PHP and PHP modules are working
Add following content to /var/www/html/test.php file.
7. Check created page with browser
Access following address, with your browser. http://localhost/test.php

 Enable Remote Connection to Apache HTTP Server (httpd) –> Open Web server Port (80) on Iptables Firewall (as root user again)
1. Edit /etc/sysconfig/iptables file:
nano -w /etc/sysconfig/iptables
2. Add following line before COMMIT:
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
3. Restart Iptables Firewall:
service iptables restart
## OR ##
/etc/init.d/iptables restart
4. Test remote connection
Access following address, with your browser. http://your.domain/test.php