How to Install Apache Web Server on CentOS

Welcome back to shortlearner.com . in our previous post we learn how to install phpmyadmin on CentOS.
today in this post we will see how to install Apache web server on CentOS.

so before start the installation process we should take an overview about Apache web server.

install apache on centos

What is Apache Web Server

Apache is the most widely used Web Server application in Unix-like operating systems but can be used on almost all platforms such as Windows, OS X, OS/2, etc.
The word, Apache, has been taken from the name of the Native American tribe ‘Apache’, famous for its skills in warfare and strategy making.

Also Read
How to Install phpMyAdmin on CentOS 7 – Google Cloud
How to Install MySQL on CentOS 7

What is CentOS

CentOS is a Community Enterprise Operating System. It is an open-source platform for non-productive developmental work.
For production concern, those works can be migrated to RHEL (Red Hat Enterprise Linux) Linux distribution platform.

Before Installation:

two main configurations are perfect before the installation of Apache Web Server

First one is Non-root User configuration and another one is the Firewall Configuration.
These configurations will have sudo privileges to execute the commands. These initial server setup will enable root login, authentication key, SSH Daemon configuration, increased security and usability.

Installation Process.

Let’s start the installation.
First, log-in with the SSH from your instance.
Go to Compute Engine and select VM Instances

google cloud VM instance

so we just click on the open in browser window and than we will see terminal there. follow the below commands on the terminal.

Installation will take some time so we should wait for it.
After the installation complete. Next step will be enabling the package from the updates.
wecan use the below command to enable the Apache web Service.

we are going to start the Apache Web Service of the required version.
Here we need to start the package manually because the automatic start option will not be present.
So to start your Apache Service, apply the below command.

we can also manage the configuration by using the keywords, Start, stop, enable, disable, reload, restart etc.

How to Install phpMyAdmin on CentOS 7 – Google Cloud

Welcome back to shortlearner.com, in our previous post we learn how to install PHP in CentOS.
today in this post we will see how to install phpMyadmin on CentOS with the help of google cloud.

how to install phpmyadmin on centos

so before start this tutorial we should know some basic terms about phpMyadmin, centOS and google cloud.

What is phpMyadmin

so phpMyadmin is an open-source tool, which is used to administrate MySQL over the web interface.

phpMyadmin is one of the best GUI(Graphical User Interface) base database Management platform .

it is also used in MariaDB Database management. phpMyadmin is available in more than 78 languages.

What is CentOS

CentOS is a Community Enterprise Operating System. It is an open-source platform for non-productive developmental work.


For production concern, those works can be migrated to RHEL (Red Hat Enterprise Linux) Linux distribution platform.

What is Google Cloud

Google Cloud Platform offers services for compute, storage, networking, big data, machine learning and the internet of things (IoT),

as well as cloud management, security and developer tools. 

Features of phpMyadmin

provides compatibility to Create , Alter, Add, Drop, Rename , Import tables from CSV and SQL and Export tables from CSV, SQL, XML, PDF, etc. 

we can easily manage database, tables, fields, columns, indexes, relations, permission, etc.

 it can works with different operating systems and makes complex queries easier by using its predefined functions.


You can create PDF graphics of database layout. You can also search globally in a database or subset of it. 
phpMyAdmin can administrate multiple servers.

Also Read :

Also Read :

Password and Confirm Password Validation Using JavaScript
PHP Login Script With Remember me.
Change password using javascript, php and mysqli.
Check Email is Already Registered in Database using Ajax and JavaScript.

Before Installation

Before the installation process of phpmyadmin make sure you have already installed these below stuff.

Apache Web Server  – We need to install Apache! Check out our article Install Apache on CentOS 7.
PHP  – Then we need to install PHP! Check out our article Install PHP on CentOS.
MySQL  – Then we need to install MySQL! Check out our article Install MySQL on CentOS 7.

Step 1: VM Setup
so in the very first step logged in to your google cloud account and select the Compute Engine option from the menu.


follow the below image for better understanding.
Now we can see VM instances in Compute Engine. Click on that as shown in below image.

google cloud VM instance

so we just click on the open in browser window and than we will see terminal there. follow the below commands on the terminal.

Step 2: Adding the EPEL Repository
before adding this repository we should take an small overview of EPEL.
so basically EPEL is Extra Package for Enterprise Linux.

which creates, maintains, and manages a high-quality set of additional packages on CentOS. EPEL has an epel-release package that includes GPG

keys for package signing and repository information.
just follow the below command in the terminal for add this repository

Step3 : Install PhpMyAdmin
we have enable EPEL Repository ,now we have to install phpmyadmin by using followinng command.

Step 4 : Configuration
so for doing configuration first of all we need to have grant remote access.
We are going to make changes in the config file.


For that, we can get into the config file by using the below command.

once the command is executed we will see the below lines which is shown in the below image.

configuration of phpmyadmin in centos

Step 5 : Edit in phpmyadmin.conf file
In the above image, wecan see the line Require ip. The default value will be 127.0.0.1.
we need to replace the IP string with our machine IP.

  • To update the change , press “i”.
  • Replace that “Require ip” with the IP of your machine.
  • Saving the changes made in the config file, enter “:wq“.
  • Then exit from the phpMyAdmin.conf file by pressing ESC Key.

the changes are updated in the phpMyAdmin.conf file.

Step 6 : Restart the Apache Web Server
Now we need restart the apache web server to sync up the updated phpMyAdmin.conf file with Apache Webserver.

Once this is done, we are ready to start using phpMyAdmin.
use the following command to restart the apache web server.

After installation of phpMyAdmin

so we have successfully installed the phpmyadmin in our CentOS.
to check the GUI (Graphics user interface) of phpmyadmin.

go to the browser and type http://127.0.0.1/phpmyadmin . so the default IP is 127.0.0.1 so you must replace it with your machine IP.

Setup Login Credentials
You can set your credentials (Username and Password) in a below-mentioned manner.

First, we need to get into the phpMyAdmin installation directory by using below command.

Here you can find the below mentioned file.

Now we are going to create your credentials in this file. By using below command we can edit the config.inc.php file.

Edit the file with your own credentials. As we did before, for Saving the changes made in the config file, enter :wq. And then exit from the config.inc.php file by pressing ESC key.

How to Install MySQL on CentOS 7

Welcome back to shortlearner.com, in our previous post we learn How to Install PHP on CentOS.
now today in this post we will see how to install MySQL on CentOS.
before going to installation process we just take an overview of CentOS and MySQL.

install mysql in centos

CentOS is a Community Enterprise Operating System. It is an open-source platform for non-productive developmental work.
For production concern, those works can be migrated to RHEL (Red Hat Enterprise Linux) Linux distribution platform.

Also Read :
How to integrate Razorpay Payment Gateway using PHP.
Get Domain name from URL
How to Send Attachment on mail using PHP.
PHP Login Script With Remember me.
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

MySQL open-source tool and Database Management System. MySQL is a fast, stable, true multi-user, multi-threaded SQL database server.
Apart from the free edition, MySQL also offers other services like MySQL Enterprise Edition, MySQL Cluster CGE, Oracle MySQL Cloud Service and MySQL for OEM/ISV.

Drupal, Joomla, phpBB, and WordPress are some examples of MySQL database-driven web application.
Facebook, Flickr,MediaWiki, Twitter and YouTube are some examples of MySQL database–driven websites.

Install MySQL 8.0:

If you choose MySQL 8.0 for installation on CentOS 7. You can follow the below commands for installation.

First, We need to Enable the MySQL 8.0 Repository Package because MySQL 8.0 is not a default package in CentOS 7. Use the below command to enable for local installation

Now the MySQL 8.0 Repository Package got enabled in the CentOS. We can directly install the package using below mentioned command.

don’t forgot to verify the signature key , it is the most important thing to do. For a specific package, we need to obtain a copy of public GPG build key. While installation it will be asked for key permission. so just type Y and hit the enter button.

After installation of MySQL:

1) Enabling the MySQL Service:

so the steps are mentioned below is same for any version of MySQL. so just follow the below steps one by one.

First , we need to enable mysqld . which will help to run the MySQL package in background during the boot time. Use below command for enabling the server.

after enabling the server we need to start the server for the connectivity by using the below command.

now we need to check with the status of the server for its operating status. we can use below command to check the status in the output terminal – Status: SERVER_OPERATING

2) Securing your Credentials:

For the first time when we start with our MySQL server, we will have default password in the MySQL server root user. we can locate the default password by using below command.

In the output our default password will be displayed. Remember the default password, will will help to login in further steps.

To enhance the security of the MySQL installation, use below command

When we execute the above command, it will be asked for a password. we need to enter our password there.

After this, we need to enter our own password.
For secure password: 8 Char length, 1 upper case, 1 lowercase, 1 special character, and 1 Numeric char.
Now the MySQL server will ask some questions regarding Access, User Permission, remove the database. so just type Y and hit the enter button for all questions.

3) Login Setup to Your MySQL Server:

We all set with our credentials , we are ready to login to the MySQL Server. For that we need to enter into the root of MySQL server. we can enter below command to get into the root.

Once we entered into the root, we will be asked for our own password, which we created in previous steps.

4) Database and Table Creation:

We all set with the MySQL server. To create the database, we can use below command.

We created our database, now we can get into our database using the following command.

Below is the simple structure of table creation.

How to Install PHP on CentOS

Welcome back to shortlearner.com, so today we are starting a new tutorial category in our learning platform.
in our previous post we learn how to implement Razorpay payment gateway with the help of PHP.
so in this post today we will learn how to Install PHP on CentOS. before start this tutorial first of all we should take an small overview about CentOS and PHP.

install php on centos

we all know about PHP is a server side scripting language which stands for hyper text processor. mostly PHP is used from web based software, its easy to learn.
CentOS is a Community Enterprise Operating System. It is an open-source platform for non-productive developmental work.


For production concern, those works can be migrated to RHEL (Red Hat Enterprise Linux) Linux distribution platform.
so in this post we will learn to install the PHP version 5.6. which is most popular PHP version.


In our next article we see how to install PHP My Admin and MySQL in CentOS.
Let’s see some features about PHP version 5.6
Reduced Memory
due to the reuse of php://input. Numeric, String and constant have scalar expression.
A constant array can use constant keywords.
PHP 5.6 can be used for command-line scripting.
Graphical user interface application can also be used by clients.
It has advanced protection patches.

Before Installation

Please make sure that remi:repo file was enable. i.e Enable=1 (inside remi:repo file) .Next point is to check the package was having required version for installation .
Step1:
Type the below command to install the rpm release packages. This will help you to install the packages of PHP version you wish to install.

Step2: now we are install utils. This will provide user with advanced package management options.
So that no manual configuration required for enabling and disabling the packages. For this, install utils command given below.

Also Read :
How to Install MySQL in CentOS.
How to Send Attachment on mail using PHP.
PHP Login Script With Remember me.
Unable to create a directory a wordpress error
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

Enter Y after the utils command execution completed.
Step3 : In the next step we will be the most important program provided by utilities is configuration manager, through which the activation of ‘Remi repository’ will happen.
This will be the default manipulating repository settings provided by utilities. which is help us to install any version of PHP.

In the end of command you can see two digits, which represents the version number.Eg: 56 for PHP 5.6 , 74 for PHP 7.4Below command will enable you the selected version.

Step4: We are going to install the PHP of required version. You can use any extension from the list given below with respect to your library files.


Finally, To make sure that you have enabled correct version, use below command and check the version.

After Installation of PHP:

To check the installation, First you can restart your apache package, using below command.