fbpx

Introduction

The LAMP stack (Linux, Apache, MySQL, PHP) is a group of open source software that is typically installed together to enable a server to host dynamic PHP websites and web apps.

 

This guide includes the steps to set up a LAMP stack on Centos 7, if you want more information on LAMP click here.

Notice:

There is a new player on the table, LAMP which originally stood for Linux, Apache, MySQL and PHP, has now been going through some change, that being the new player Maria DB, a replacement for original MySQL.
MariaDB has almost all the features of MySQL and features library binary equivalency and exact matching with MySQL APIs and commands. It means if an app is able to run with MySQL and it also is able to on MariaDB without any glitch. I will not explain what is Apache and PHP as I’ve explained before and I believe you already knew what it is.

If you want more info on the similarities and differences on MariaDB and MySQL, here is the article:

https://mariadb.com/kb/en/mariadb/mariadb-vs-mysql-features/

 

Let’s start with the step by step tutorial:

INSTALL APACHE WEB SERVER

Step 1 – Login to your server via Terminal.

Step 2 – Now issue command below to install Apache 2.4 on your CentOS 7 server:

1 yum install httpd -y

As you can see the command is still the same.

1

And when the process finished, you’ll see something like this:

2

Step 3 – Now you have Apache 2.4 installed which you can then start the service by typing command below:

 

1 systemctl start httpd.service

3

Step 4 – You can verify that Apache is really running by opening your favorite web browser and access your vps via its IP address:

http://xxx.xxx.xxx.xxx

and you’ll see default Apache welcome page.

4

In current example I’ve installed Apache v2.4.6.

or, you can directly issue this command:

systemctl status httpd.service

you’ll see something like this:

5

Enable Apache to automatically run every time your server reboot:

1 systemctl enable httpd.service

INSTALL PHP5

Step 5 – Now, it is time to install PHP5. Default command is:

1 yum install php -y

That’ really is a simple command but since we will install MySQL then we’ll need PHP MySQL modules plus any other PHP5 modules you website / app may need it. You can view all available modules using this command:

You can simply use command below that includes common PHP5 modules most websites can run with it.

 

yum install php php-common php-cli php-devel php-gd php-imap php-intl php-mysql php-process php-xml php-xmlrpc php-zts -y

6

And once done, you’ll see something like this:

7

INSTALL MARIADB MYSQL SERVER

Step 6 – Once again we’ll make us of yum package manager:

1 yum install mariadb-server mariadb -y

9

and once done you’ll see something like this:

10

Step 7 – Now you can start MariaDB server for the very first time using this simple systemctl command :

1 systemctl start mariadb.service

11

 

MARIADB INITIAL CONFIGURATION

Step 8 – So its service is now running but there is one thing you should do immediately: configuring MariaDB setup for the very first time like setting up your mysql root password. Issue this command:

1 mysql_secure_installation

Then you’ll see a series of question, just answer it accordingly. The main important part is to define your root password while everything else is just up to you or you can simply hit the “ENTER” key through each prompt to accept the default values.

12

 

You, my friend, are done!, Congrats!

Categories: Tutorials

2 Comments

WordPress Tutorial -Installing WordPress Manually on a VPS – Virtono Community · September 16, 2020 at 3:24 PM

[…] LAMP : You can use this tutorial to do […]

Tutorial WordPress - Instalarea Manuală A WordPress Pe Un VPS - Virtono.ro Blog · October 29, 2020 at 2:54 PM

[…] Instalarea LAMP: Puteți utiliza acest tutorial pentru a face acest lucru. […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: