Recommended Article:

1. Setup Yum Repository
REMI and EPEL repositories has most of updated packages. So its useful to add these repositories before processing to LAMP setup on CentOS/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
2. Install Apache Server
Apache (HTTPD) is the most popular web server used on Linux systems. Let’s install Apache web server using following command with enabling epel and remi yum repositories.# yum --enablerepo=Now start httpd service and enable to start on boot using below commands.epel,remi install httpd
# systemctlstart httpd.service # systemctlenable httpd.service
3. Install MySQL
First add MySQL yum repository in your system using following command. You may visit repo.mysql.com to find repository rpms for other operating systems.# rpm -Uvh http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmNow install MySQL server and other dependency packages.
# yumApply security on mysql and also set root user password.install mysql-server
# systemctlNow restart MySQL service and enable to start on system boot.start mysqld.service # mysql_secure_installation
# systemctlrestart mysqld.service # systemctlenable mysqld.service
4. Install PHP
Now install php packages with enabling epel and remi repositories using following command.# yum --enablerepo=Now install required php modules. Use following command to list available modules and install it.epel,remi install php
# yum --enablerepo=After installing php and other php modules restart Apache service.epel,remi list php-* # yuminstall php-mysql php-xml php-xmlrpc php-soap php-pgsql php-gd
# systemctlrestart httpd.service
5. Open Port in Firewall
Finally open firewall ports for http (80) and https (443) services using following command.# firewall-cmd --permanent --zone=public --add-service=http # firewall-cmd --permanent --zone=public --add-service=https # firewall-cmd --reload
6. Check Installed Version
Let’s check the installed versions of packages on system using following commands one by one.#php -v PHP5.4.38 (cli) (built: Feb 18 2015 16:36:53) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
#httpd -v Server version:Apache/2.4.6 (CentOS) Server built: Jan 12 2015 13:22:31
#Now you have successfully configured LAMP setup on your CentOS or RedHat 7 system.mysql -V mysql Ver 14.14 Distrib5.6.23 , for Linux (x86_64) using EditLine wrapper
Recommended Article:
Comments
Post a Comment