Quick Start: Setup CentOS 7 as a LAMP Server
In this tutorial, I'm going to show you simple steps using which you can setup your own LAMP (Linux-Apache-MySQL-PHP) on a CentOS 7 system.
Prerequisites
CentOS 7 Minimal ISO
Make sure your system has a static IP address assigned to it and a fully qualified domain name.
System Details:
Base OS: CentOS 7 64 Bit (Minimal ISO)
HOSTNAME: master.cloud.com
IPADDRESS: 192.168.0.15
Steps:
LINUX
Start by Installing a CentOS 7 system. You can refer THIS GUIDE for the same.
APACHE WEB SERVER
Once the base OS is ready, we now install the Apache web server package.
# yum install httpd
The httpd package downloads some additional dependencies as well. Hit "Y" and download all the required RPMs as shown.
Next, edit the "httpd conf" file
# vi /etc/httpd/conf/httpd.conf
In this file, you only need to edit at two places:
# Replace ServerAdmin root@localhost
ServerAdmin root@<YOUR_CENTOS_IP_ADDRESS>
# Replace ServerName localhost:80
ServerName <YOUR_CENTOS_IP_ADDRESS>:80
NOTE: ServerName attribute is commented out by default, so remember to uncomment it out first.
Save and exit the editor once the changes are made.
Start and enable the httpd service
# systemctl start httpd
# systemctl enable httpd
Enable the HTTP port (Port 80) on the firewall and reload the firewall.
# firewall-cmd --permanent --add-port=80/tcp
# firewall-cmd --reload
Test your Web Server by typing in the CentOS system's IP address in a browser. You should see the following web page if your settings are done correctly.
http://<YOUR_CENTOS_IP_ADDRESS>
MySQL
Next up we install the MySQL Database. An important point to note here is that with CentOS 7, MariaDB is shipped as the default MySQL Engine unlike the earlier versions where MySQL was the de facto choice.
In this guide, I'll show you how to install both MariaDB and MySQL Server.
First off, its MariaDB
# yum install mariadb mariadb-server
This will install the necessary DB packages for MariaDB, rest of the configuring steps remain the same for MySQL so I'll now show you how to install MySQL Community Edition on a CentOS 7 system.
First off, we download some prerequisites:
# yum install wget
Next, download the MySQL Community Release RPM using the following command:
# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
Install the downloaded RPM
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
The RPM installs two repos at /etc/yum.repos.d directory, both will be used to install the MySQL Community Server packages
Once prepped, you can now install the MySQL packages as required
# yum install mysql-server mysql
Start and enable the MySQL service
# systemctl start mysqld
# systemctl enable mysqld
Run the mysql_secure_installation script to set the root password and other necessary parameters
# mysql_secure_installation
Test your MySQL server by logging on the DB:
# mysql -u root -p
PHP
The final install is PHP. Run the following command to install the basic PHP packages:
# yum install php php-mysql
Hit "Y" to download and install the packages
Next, create a simple file to test whether PHP was successfully installed or not
# vi /var/www/html/info.php
<?php phpinfo(); ?>
Restart the httpd service before you proceed.
# systemctl restart httpd
Open up a browser and type in the following. You should see the PHP info page as shown below:
http://<CENTOS_SERVER_IP_ADDRESS>/info.php
Thats it for this post.. but stay tuned for much more coming your way soon..
Cheers.
Restart the httpd service before you proceed.
# systemctl restart httpd
Open up a browser and type in the following. You should see the PHP info page as shown below:
http://<CENTOS_SERVER_IP_ADDRESS>/info.php
Thats it for this post.. but stay tuned for much more coming your way soon..
Cheers.
9 comments :
Very Nice Post
Best Software Training Institute in bangalore
Best SAP Training in bangalore
Best Advanced Excel Training in bangalore
I really enjoyed reading the Post. It was very informative and useful.Electrical Projects Center in Chennai | Electrical Projects Center in Velachery
Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
Java Training in Marathahalli
Wonderful blog..keep sharing...Diploma Projects Center in Chennai | Diploma Projects Center in Velachery
It has been just unfathomably liberal with you to give straightforwardly what precisely numerous people would've promoted for an eBook to wind up making some money for their end, basically given that you could have attempted it in the occasion you needed.
devops training in chennai
I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
java training in bangalore
It’s great to come across a blog every once in a while that isn’t
the same out of date rehashed material. Fantastic read.
dotnet training in bangalore
Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.
Data Science Training in Chennai
Data Science Training in Bangalore
Obat Aborsi ,
Obat Aborsi Ampuh ,
Obat Aborsi Asli ,
Jual Obat Aborsi ,
Obat Pelancar haid ,
Obat Telat datang Bulan ,
Obat Penggugur Kandungan ,
Pesan Cytotec Harga Obat Aborsi ,
Jual Obat Aborsi ,
Obat Aborsi ,
Jual Obat Penggugur Kandungan ,
Obat Penggugur Janin ,
Klinik Aborsi Janin Jakarta ,
Pesan Harga Obat Aborsi Tuntas ,
Order Cytotec Obat Aborsi ,
Post a Comment
Note: only a member of this blog may post a comment.