Monthly Archives: August 2018

How to setup phpMyAdmin in NGINX CentOS 7.5

phpMyAdmin is a free software tools written in PHP, intended to handle the administration of MYSQL over the web. In our case we access percona database from phpmyadmin

I created sub domain database.travelhand.xyz for accessing phpMyAdmin

how to setup phpmyadmin in nginx centoos 7.5 phpmyadmin centos 7 How to setup phpMyAdmin in NGINX CentOS 7.5 6

Important note phpMyAdmin version 4.8 is not compatible with PHP7.2 that cause we use phpMyAdmin development  version 5 

First enter /usr/share/nginx/html location 

Enter phpMyAdmin website download section phpMyAdmin 5.0+snapshot part select tar.gz file by write click it . Full Link : https://files.phpmyadmin.net/snapshots/phpMyAdmin-5.0+snapshot-all-languages.tar.gz

Then enter your cloud machine and use wget to download this file 

If wget command not found then download it 

After successfully download need to unzip this folder 

Write ls to see folder and rename this folder phpMyAdmin

Remove this tar.gz folder 

Now need to create a configuration file for nginx to work phpMyAdmi properly

then file open now write this line 

save and close the file . Check nginx -t to everything working properly or not . If not any error found then everything is working fine

Need to provide write access php session folder 

Now restart nginx and php-fpm 

Now Enter your brower database.travelhand.xyz

how to setup phpmyadmin in nginx centoos 7.5 phpmyadmin centos 7 How to setup phpMyAdmin in NGINX CentOS 7.5 7

phpMyAdmin is working properly . login using your percona mysql user name and password 

how to setup phpmyadmin in nginx centoos 7.5 phpmyadmin centos 7 How to setup phpMyAdmin in NGINX CentOS 7.5 8

here you see phpMyAdmin is working properly. Bye for Today

How to setup percona database in CentOS 7.5

Percona’s industry-leading architecture design consultants have full stack expertise to build databases in hosted and private, public and hybrid cloud environments that are optimized and scale for growth while minimizing application downtime and operational costs.

This portion of tutorial we learn how to install percona database in CentOS 7.5 server and change default password 

Installing Percona Server from Percona yum repository

Install the packages. You can now install Percona Server by running 

Running Percona Server:

Starting the service

Status of the service

Stopping the service

Restarting the service

After successfully install percona server 5.7 . It create a default password we need to get this default password and change it . To get this default password write this command 

Sample outputs of root user default password

Change Percona mysql default password 

Enter mysql server using command line 

Then Enter password screen prompt write your desire password get from previous command in my case password is : 0fR)jBZ*7j%k

Then mysql coomand open then write this command 

in new password section write your own choice password and click enter then write exit

Then enter previous step and write new password if you enter successfully then you are completely update percona database password successfully 

No more today 

How to configure PHP FPM in NGINX CenotOS 7.5

PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites

This part of this tutorial series we learn how to configure PHP-FPM 7,2 in NGINX server. Previous part of this tutorial we already install php-fpm .

Turn on PHP fpm for nginx

Sample outputs:

Start PHP fpm service

Stop PHP fpm service

Restart PHP fpm service

Get Status of PHP fpm service

Configure Nginx for using with PHP 7.2

Sample outputs:

Edit nano /etc/opt/remi/php72/php-fpm.d/www.conf:

set user and group to nginx 

how to configure php fpm in nginx cenotos 7.5 How to configure PHP FPM in NGINX CenotOS 7.5 3

Save and Close the file then restart php-fpm service

Update your nginx config file 

Edit as following line in server sections

Save and close file then check everything is working fine 

how to configure php fpm in nginx cenotos 7.5 How to configure PHP FPM in NGINX CenotOS 7.5 4

I write this file end of the server section . Now check nginx by following command 

Sample output if everything is working properly

Then restart nginx server 

Create a test script called test.php at /usr/share/nginx/html

Add this following line 

Save and close the file . Now open your browser and type your ip then test.php

how to configure php fpm in nginx cenotos 7.5 How to configure PHP FPM in NGINX CenotOS 7.5 5

if you see this page that means your php-fpm and nginx everything is working properly

How to install PHP 7.2 on CentOS 7.5

php is backend programming language to render dynamic website . This part this tutorial series we learn how to install PHP 7.2 on CentOS 7.5 

Turn on EPEL repo on a CentOS

sample output

then remi repo too:

sample output:

Install yum-utils packages too:

Enable remi repo by writing command :

Then install php 7.2 on CentOS 7.5

then see sample output:

then install php others required packages

List installed modules

Sample output:

Now your PHP 7.2 and its related modules install completely. Next part we learn about PHP FPM

How to install and use NGINX on CentOS 7.5

Nginx [engine x]  is free and open source high performance web server. This part of this tutorial series we learn how to install and use NGINX in CentOS latest version (7.5)

Enter your cloud server using putty and login using your cloud server root user name and password 

Step 1: I use my favorite editor nano. First check nano is present in your machine . Writing this following command 

If you see 

that means nano editor not present in your CentOS 7.5 machine . Now you need to download it from yum repository. 

Run command 

then click Ctrl + x then click y . file saved successfully

Step 2:

how to install and use nginx on centos 7.5 How to install and use NGINX on CentOS 7.5 1

Step 3: Start/Stop/ restart nginx server

First enable nginx server by running systemctl command . It start server at boot time 

Sample Output

Start Nginx server

Stop NGINX server

Restart Nginx server

Status Nginx server

Output :

Step 4 : firewall setup

At this point, your server could be vulnerable to unauthorized access by unauthorized users. To fix this, set up a firewall using firewalld. You may need to first install firewalld, which can be done with the following command:

Then, start the firewalld service:

Next, add some firewall rules to allow SSH access to your server, and HTTP and HTTPS connections to Nginx:

Reload firewalld to implement the new firewall rules:

Check everything is working properly below command 

simple output  

then enter your IP or domain address see in browser

how to install and use nginx on centos 7.5 How to install and use NGINX on CentOS 7.5 2

if you see nginx default page that means your setup completed

Some important note for nginx:

  • nginx directory – /etc/nginx
  • Main configuration file – /etc/nginx/nginx.conf
  • Default site config file – /etc/nginx/conf.d/default
  • TCP port for nginx – 80 (HTTP) and 443 (HTTPS)
  • Day 0: Basic instruction of server setup
  • Day 1: How to install and use NGINX on CentOS 7.5
  • Day 2 : We learn how to install PHP versition 7.2 and configure php fpm with nginx
  • Day 3 : We learn how to setup percona 5.7 database server instead of MySQL server
  • Day 4 : We learn how to create virtual host in nginx
  • Day 5: we learn how to setup phpmyadmin in nginx with centOS 7.5
  • Day 6 : We learn How to install nodeJS application in nginx and reverse proxy work

How to install CentOS 7.5, nginx, PHP 7.2, PhpMyAdmin and nodeJS

CentOS is most popular linux distributor software for web server. There are many resource available but the problem is their is no compact series to work with  CentOS 7.5, nginx, PHP 7.2, PhpMyAdmin and nodeJS.

Most of the time developer is frustrated to finding resource which support everything but they can not find out exact solution . Nginx server setup they can’t understand properly what is named virtual host and ip based virtual host . Step by step series I share you everything about the solution .

  • Day 0: Basic instruction of server setup
  • Day 1: How to install and use NGINX on CentOS 7.5
  • Day 2 : We learn how to install PHP versition 7.2 and configure php fpm with nginx
  • Day 3 : We learn how to setup percona 5.7 database server instead of MySQL server
  • Day 4 : We learn how to create virtual host in nginx
  • Day 5: we learn how to setup phpmyadmin in nginx with centOS 7.5
  • Day 6 : We learn How to install nodeJS application in nginx and reverse proxy work