admin, Author at CloudMinister

How to add FTP user in Plesk panel

In this tutorial, I will show you how to create FTP user. FTP (file transfer protocol) which used for access files via remotely here you can upload, delete or modify files.

Let’s start to create FTP user in Plesk panel Websites & Domain –> FTP Access

Next move to add FTP user in Plesk panel
Now here you have to fill details like user name, password and home directory access.
You add successfully FTP user in Plesk panel.

How to set php version and phpmyadmin in Plesk panel

Here today we go to set php version and phpmyadmin in plesk panel. So let’s start today task

Go and click on Website & Domain –> Php settings

Here in php settings you can change you php version as well as lot’s of settings to change in php like memory_limit, upload_max_size, max_execution_time etc.

Next we move towards phpmyadmin just click on database –> phpmyadmin

Now click on Phpmyadmin and here able to access phpmyadmin.

Here we successfully finished today task.

How to create MYsql database user in CWP panel

CentOS web panel is a free web hosting panel it works very easily and smoothly with the help of this panel you can manage several services like web server, ssh service, database management, email management, billingsuser management, file system management as well as DNS management, etc.
Here in this document, we will teach you how to create a database and user in MYSQL manager which are as follows-
cwp panel
You see in CWP panel several options are available there than just click on SQL SERVICES  and see several options are present many databases are already named like postfix, RoundCube here you can add a user by just click on ADD USER.
mysql-menu
After this step, you have to click on create a database by click on create the database. Please keep in your mind already have a user account or ar strong hostname. Here I already set a host domain name or user name for further steps-
create-database
Here my host domain name is Gulfam and i create a database name cloud_web
cwp-database-list
After this just click on add user for that database which you create an earlier name cloud_web 
user-list
Now click on List user you see your database user name and details which you created earlier. You did this successfully.

How to install WordPress with LEMP stack on CentOS 7 VPS (Part2)

5. Install Nginx

Nginx, pronounced as “Engine X” and is a very fast and lightweight web server, that can be used to support static files, used as a reverse proxy and also for load balancing.

Firstlly, update all the software packages by typing the following command:

# yum -y update

After that install EPEL repository that is required for Nginx packages by using command:

# yum -y install epel-release

Now install Nginx by typing the command:

# yum -y install nginx

After the installation is completed you must Enable and Start Nginx server by typing command:

# systemctl start nginx

And enable it with the command:

# systemctl enable nginx
Also check its status with

# systemctl status nginx

6. Configure Firewall

After completed with installation part, configure the firewall settings with the following command:

Open HTTP port by typing command with:

# firewall-cmd –permanent –zone=public –add-service=http

If firewalld package is not available then you can install it with command:

# yum -y install firewalld

And start firewalld service with command:

# systemctl start firewalld

Now reload firewall configuration file by typing:

# firewall-cmd –reload

Now verify your installation of Nginx by visiting the following URL on any browser you like with http://ip_address

7. Configure Nginx File

An Nginx server configuration file plays an important role, So you should be more careful when setting up this file.

For configuring Nginx file go inside the following path with the following command:# cd /etc/nginx/conf.d

# vi default.conf

And write the following code in the above file i.e. default.conf.

Also change your domain in place of ip_address

server {

listen 80;

server_name 54.161.140.2;

root /usr/share/nginx/html/wordpress;

index index.php index.html index.htm;

location / {

try_files $uri $uri/ =404;

}

error_page 404 /404.html;

location = /40x.html {

root /usr/share/nginx/html/wordpress;

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root /usr/share/nginx/html/wordpress;

}

location ~* \.php$ {

try_files $uri =404;

fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;

fastcgi_index index.php;

include fastcgi_params;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

}

}

And save it with :wq command, after that edit the configuration file of php-fpm with the following command:

# vi /etc/php-fpm.d/www.conf

Open the file with above command and edit the following lines i.e.

user = nginx

group = nginx

Add new listen under listen = 127.0.0.1:9000

listen = /var/run/php-fpm/php-fpm.sock

And also add

listen.owner = nginx

listen.group = nginx

Remove comment (;) from the above two lines and save it with :wq.

8. Install WordPress File

You can easily download WordPress archive file from the link I provided in this blog.
First go inside /tmp directory by typing below command:
# cd /tmp
Download the latest WordPress setup by using wget command
# wget https://wordpress.org/latest.tar.gz
And if wget command not work then you can download it with the following command
# yum -y install wget
Now extract the downloaded file using below command:
# tar xzvf latest.tar.gz
After that move wordpress directory in /var/www/html directory by using command:
# mv wordpress /usr/share/nginx/html
Also change the ownership of /var/www/html directory by using the following command
# sudo chown -R nginx: /usr/share/nginx/html
# chmod -R 755 /usr/share/nginx/html

9. Test WordPress

Now for testing the server of WordPress you should restart the server for that follow the command:
# nginx -t (If the command shows ‘successfully’ message then the changes in file are correct and else the changes are wrong in the nginx configuration file.)
# systemctl restart php-fpm
# systemctl restart nginx

Then open any browser and type inside URL i.e http://ip_address/

After then configuration page i.e. http://ip_address/wp-admin/ is open and select language.

 

 

 

CONCLUSION

After this installation, you will be able to create or manage blog in wordpress CMS in Centos VPS.

 

How to install WordPress with LEMP stack on CentOS 7 VPS (Part1).

WordPress is one of the most popular and widely used content management system, blogging platform in the world. It is popularly used as a Blog, Portfolio Website,  etc.

In this tutorial, you are going to learn how to install WordPress with LEMP(Linux,Nginx,MySQL,and PHP)  on CentOS 7 Linux VPS.


Table of Content

  1. Prerequisites
  2. Install MySQL 8.0
  3. Configure Database in MySQL
  4. Install & Configure PHP 7.2
  5. Install Nginx
  6. Configure Firewall
  7. Configure Nginx File
  8. Install WordPress File
  9. Test WordPress

1. Prerequisites


Before you start the installation of WordPress with (LEMP) stack on Centos 7 VPS, you must have one Centos 7 VPS with root privileges on it or you can use sudo for non-root user.  

 You should also run basis command on server to check the following things-:

# df -h (To check the disk space on the system.)

 

# cat /etc/os-release (To verify the version of the VPS.)

 

# yum -y update (To update all the packages of the VPS)

2. Install MySQL 8.0

WordPress uses a MySQL database for storage, MySQL is used in stack for storing user details in database.

For installing MySQL on Centos 7 first you need to enable MySQL repository and then you can install MySQL.

# yum localinstall    -y https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm

The command used for installing MySQL in CentOS 7 VPS is as follows:

# yum install mysql-server -y

Then check the MySQL version by typing following command:

# mysql -V(‘V’ is in uppercase)

After the installation is completed MySQL will start automatically and you can check it’s status by typing:

# systemctl status mysqld

If MySQL is not start automatically you can write the following command:

# systemctl start mysqld

Before going for the next step you should generate a temporary password to access MySQL root user with the following command:

# grep ‘temporary password’ /var/log/mysqld.log
Now configure the MySQL secure installation to improve the security by typing the following commands.
#
mysql_secure_installation

Login with the temporary password and assign new password, after that in this configuration it ask several questions you can give Y or N according to your requirement.

Change the password for root ? N

Remove anonymous users? Y

Disallow root login remotely? Y

Remove test database and access to it? Y

                  Reload privilege tables now? Y

 

3. Configure Database in MySQL

Now create database for WordPress in MySQL for that first login with MySQL server by using the following command:

# mysql -u root -p

And give its password, after that create database in it with the command:
mysql> CREATE DATABASE wordpress;

You can also check that database is created or not with the command:

mysql> SHOW  DATABASES;

Now create user and assign him password by using command:

mysql> CREATE USER ‘wordpress’@’localhost’ IDENTIFIED 

BY ‘Password’;

After that grant all privileges to the user created under that database with the command:

mysql> GRANT ALL ON  wordpress.* TO ‘wordpress’@’localhost’;       

Then flush all privileges on MySQL server with the command:

mysql> FLUSH PRIVILEGES;

Now exit from the MySQL server you can use commands:

mysql> exit;

mysql> \q;

Note-: In MySQL you must end each command with a semicolon(;).

4. Install & Configure PHP 7.2

PHP is used by WordPress to do various functions done by PHP like calling plugin, calling theme, validating user permissions, checking option, grab from database, etc.

In this Blog we are using PHP 7.2 versionand install it with epel-release with remi repository.

Firstly, install yum-utils packages using the following command:

    # yum -y install yum-utils

After that, install epel-release package by using command:

# yum -y install epel-release

Then import remi repository from the command:

# yum -y install  http://rpms.remirepo.net/enterprise/

remi-release-7.rpm

Enable the remi repository by typing:
# yum-config-manager –enable remi-php72

After that install PHP and all required modules by using command:

# yum -y install php-fpm php-mysql php-mbstring php-xml      php-gd php-cli php-json php-opcache php-curl
Now after the installation completed you can check the PHP version with the command:
# php -v (‘v’ is in smallcase)

 

To be Continued………

How to install Joomla with LEMP stack on CentOS 7 VPS (Part 2)

5. Install Nginx

Nginx, pronounced as “Engine X” and is a very fast and lightweight web server, that can be used to support static files, used as a reverse proxy and also for load balancing.

Firstlly, update all the software packages by typing the following command:

# yum -y update
After that install EPEL repository that is required for Nginx packages by using command:

    # yum -y install epel-release 

Now install  Nginx by typing the command:

    # yum -y install nginx

 After the installation is completed you must Enable and Start Nginx server by typing command:

    # systemctl start nginx

And enable it with the command:

    # systemctl enable nginx

Also check its status with

    # systemctl status nginx

6.Configure Firewall

After completed with installation part, configure the firewall settings with the following command:

Open HTTP port by typing command with:

    # firewall-cmd –permanent –zone=public –add-service=http

If firewalld package is not available then you can install it with command:

    # yum -y install firewalld

And start firewalld service with command:

    # systemctl start firewalld

Now reload firewall configuration file by typing:

    # firewall-cmd –reload

Now verify your installation of Nginx by visiting the following URL on any browser you like with http://ip_address

7. Configure Nginx File

An Nginx server configuration file plays an important role, So you should be more careful when setting up this file.

For configuring Nginx file go inside the following path with the following command:

# cd /etc/nginx/conf.d

# vi default.conf (Creating new file)

And write the following code in the above file i.e. default.conf.    

Also change your domain in place of   ip_address       

server {

        listen       80;

        server_name  3.95.30.147;

root /usr/share/nginx/html/joomla;

        index index.php index.html index.htm;

location / {

          try_files $uri $uri/ =404;

       }

error_page 404 /404.html;

            location = /40x.html {

        root /usr/share/nginx/html/joomla;

     }

        error_page 500 502 503 504 /50x.html;

            location = /50x.html {

        root /usr/share/nginx/html/joomla;

}

        location ~* \.php$ {

        try_files $uri =404;

        fastcgi_pass unix: /var/run/php-fpm/php-fpm.sock;

        fastcgi_index index.php;

        include fastcgi_params;       

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

   

        }

}

And save it with :wq command, after that edit the configuration file of php-fpm with the following command:

    # vi /etc/php-fpm.d/www.conf

Open the file with above command and edit the following lines i.e.

user = nginx

group = nginx

Add new listen under listen  = 127.0.0.1:9000

listen = /var/run/php-fpm/php-fpm.sock

And also add 

listen.owner = nginx 

listen.group = nginx

Remove comment (;) from the above two lines and save it with :wq.

8. Install Joomla File

     You can easily download Joomla archive file from the link I provided in this blog.

First go inside /tmp directory by typing below command:

    # cd /usr/share/nginx/html

Make one directory i.e. joomla,

# mkdir joomla

Come inside the joomla directory:

    # cd joomla/

Download the latest Joomla setup by using wget command:

    # wget https://downloads.joomla.org/cms/joomla3/3-7-5/Joomla_3-7.5-Stable-Full_Package.zip  ?format=zip

And if wget command not work then you can download it with the following command:

    # yum -y install wget

Now unzip the downloaded file using below command:

    # unzip Joomla_3-7.5-Stable-Full_Package.zip

If unzip command is not work then install it first with the following command:

# yum -y install unzip

Also change the ownership of /var/www/html directory by using the following command:

    # chown -R nginx: /usr/share/nginx/html

# chmod -R 755 /usr/share/nginx/html

Note: Also change the ownership of group of /var/lib/php/session i.e. by default it is set as apache, so now change it’s ownership with:

ls -al /var/lib/php/session (It is used to check the ownership)

    chown root:nginx /var/lib/php/session (It is used to change the ownership)

9. Test Joomla

     Now for testing the server of Joomla you should restart the server for that follow the command:

    # nginx -t (If the command shows ‘successfully’ message then the changes in file are correct and else the changes are wrong in the nginx configuration file.)

    # systemctl restart php-fpm

# systemctl restart nginx

Then open any browser and type inside URL i.e http://ip_address/

After then configuration page i.e. http://ip_address/installation/ is open and then configure the following settings

CONCLUSION 

After the above installation, you will be able to manage your website by Joomla CMS in Centos VPS by using Nginx web server.

Note-: All commands are highlighted with the green color.
All links are highlighted with the blue color.
All files are highlighted with the yellow color.
All notes are highlighted with the red color.

How to install Joomla with LEMP stack on CentOS 7 VPS (Part 1)

Joomla is a popular open source Content Management System(CMS), which is used to build websites and online application. It is separated into front-end and back-end templates.

In Joomla CMS the more focused on portal-like websites.

In this tutorial, you are going to learn how to install Joomla with LEMP(Linux,Nginx,MySQL,and PHP)  on CentOS 7 VPS.


Table of Content

  1. Prerequisites
  2. Install MySQL 8.0
  3. Configure Database in MySQL
  4. Install & Configure PHP 7.2
  5. Install Nginx
  6. Configure Firewall
  7. Configure Nginx File
  8. Install Joomla File
  9. Test Joomla

     1. Prerequisites

Before you start the installation of Joomla with (LEMP) stack on Centos 7 VPS, you must have one Centos 7 VPS with root privileges on it or you can use sudo for non-root user.  

 You should also run basis command on server to check the following things-:

# df -h (To check the disk space on the system.)

# cat /etc/os-release (To verify the version of the VPS.)

# yum -y update (To update all the packages of the VPS)

  1. Install MySQL 8.0

    Joomla uses a MySQL database for storage, MySQL is used in stack for storing user details in database.

For installing MySQL on Centos 7 first you need to enable MySQL repository and then you can install MySQL.

    # yum localinstall  -y https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm

The command used for installing MySQL in CentOS 7 VPS is as follows:

    # yum install mysql-server -y

Then check the MySQL version by typing following command:

    # mysql -V(‘V’ is in uppercase)

After the installation is completed MySQL will start automatically and you can check it’s status by typing:

    # systemctl status mysqld

If MySQL is not start automatically you can write the following command:

    # systemctl start mysqld

Before going for the next step you should generate a temporary password to access MySQL root user with the following command:

    # grep ‘temporary password’ /var/log/mysqld.log

Now configure the MySQL secure installation to improve the security by typing the following commands.

# mysql_secure_installation

Login with the temporary password and assign new password, after that in this configuration it ask several questions you can give Y or N according to your requirement.

Change the password for root ? N

Remove anonymous users? Y

Disallow root login remotely? Y

Remove test database and access to it? Y

Reload privilege tables now? Y

  1. Configure Database in MySQL

     Now create database for Joomla in MySQL for that first login with MySQL server by using the following command:

    # mysql -u root -p

And give its password, after that create database in it with the command:

mysql> CREATE DATABASE joomla;

You can also check that database is created or not with the command:

mysql> SHOW  DATABASES;

Now create user and assign him password by using command:

    mysql> CREATE USER ‘joomla’@’localhost’ IDENTIFIED 

BY ‘Password’;

After that grant all privileges to the user created under that database with the command:

mysql> GRANT ALL ON  joomla.* TO ‘joomla’@’localhost’;       

Then flush all privileges on MySQL server with the command:

    mysql> FLUSH PRIVILEGES;

Now exit from the MySQL server you can use commands:

    mysql> exit;

    mysql> \q;

Note-: In MySQL you must end each command with a semicolon(;).

   4. Install & Configure PHP 7.2

    PHP is used by Joomla to do various functions done by PHP like calling plugin, calling theme, validating user permissions, checking option, grab from database, etc.

In this Blog we are using PHP 7.2 versionand install it with epel-release with remi repository.

Firstly, install yum-utils packages using the following command:

    # yum -y install yum-utils

After that, install epel-release package by using command:

    # yum -y install epel-release

Then import remi repository from the command:

    # yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Enable the remi repository by typing:

    # yum-config-manager –enable remi-php72

After that install PHP and all required modules by using command:

    # yum -y install php-fpm php-mysql php-mbstring php-xml      php-gd php-cli php-json php-opcache php-curl

Now after the installation completed you can check the PHP version with the command:

# php -v (‘v’ is in smallcase)

 

To be Continued…….

How to install and configure Linux Malware Detect (LMD) on Centos Web Panel(CWP) 7 with alert?

Linux Malware Detect(LMD) is a malware detector and scanner for Linux, designed for shared hosting environments. LMD is released under GNU GPLV2 license, it can be installed on cPanel, WHM and Linux environments with together other detection tools such as ClamAV. 

CWP doesn’t provide LMD service in it’s free version, it asks to take CWP pro for LMD service. You can install it from the terminal and scan for malware present in your server.

Prerequisite

CWP

Terminal access

Root user (If not use sudo)

ClamAV

Install Linux Malware Detect (LMD)

Linux Malware Detect is not available in CentOS or Epel repository, you need to install it manually from source, by using the following command:

First go inside tmp directory,

# cd /tmp

Now download and extract it from the source with the help of wget command:

# wget http://www.rfxn.com/downloads/maldetect-current.tar.gz

# tar -xzvf maldetect-current.tar.gz

After downloaded go inside the maldetect directory and run the install script with the following command:

# cd maldetect-*

# ./install.sh

Now make a symlink of the maldet command in the /bin/maldet

# ln -s /usr/local/maldetect/maldet /bin/maldet

# hash -r

Configure Linux Malware Detect (LMD)

LMD has been installed into the /usr/local/maldet/ directory. Open the directory and edit the configuration file conf.maldet with vi editor:

# cd /usr/local/maldetect/

# vi conf.maldet

In this file, edit the following lines to enable various feature and alerts
Enable email alert by changing the value to 1 :

email_alert=”1”
Type your email address :
email_alert=”your@domain.com

We will use the ClamAV clamscan binary as default scan engine because it provides a high-performance scan on large file sets. Change value to 1:
scan_clamscan=”1”
Next, enable quarantining to move malware to the quarantine automatically during the scan process. Chang value to 1:
quarantine_hits=”1”
Change value to 1, to enable clean based malware injections.
quarantine_clean=”1”

Save and exit, you can also change other values based on your requirement.

Testing Linux Malware Detect(LMD)

For testing LMD manual scan with the maldet command, you will use the maldet command to scan the web directory ‘/var/www/html’.
Download some malware file with the help of following commands in web root directory:
# cd /var/www/html
# wget http://www.eicar.org/download/eicar.com.txt
# wget http://www.eicar.org/download/eicar_com.zip

Next, scan the web root directory with the maldet command:

# maldet -a /var/www/html

Check the scan report with the following command:

# maldet –report 18882——-*

Other LMD Command

To ensure Maldet is up-to-date, run the command below:

# maldet -u


You can see the details of the option available by running the following command:

# maldet -h


Perform a scan for specific file extension only:

# maldet -a /var/www/html*.php

Get a list of all reports:

# maldet -e list


Restore files from the quarantine directory.

# maldet -s SCANID

Enable monitoring of a directory.
# maldet -m /var/www/html

CONCLUSION-

The above configuration will show how to configure Linux Malware Detect in CWP and scan for malware data in your server.

How to create Automated Backup for website files with shell script?

Backup

With the help of shell script and crontab you can take automated backup in server with the help of following the document.

Archive the content

Backing up your files using tar is very simple using the following command: 

# tar -cvpzf /backup/backupfilename.tar.gz /data/directory

A real example would be backing up the HTML folder for your website, my case:

# tar -cvpzf /backup/file_name.tar.gz /var/www/html

Tar command explained

tar = Tape archive

c = Create

v = Verbose mode will print all files that are archived.

p = Preserving files and directory permissions.

z = This will tell tar that to compress the files.

f = It allows tar to get the file name.

Now create backup script with the help of vi editor.

Create Backup Script

Now let’s add tar command in a bash script to make this backup process automatic. Also it is good to add some dynamic value in the name to make sure there is no overwriting of backup files. 

E.g. Create the file using the vi editor and paste below script.

# vi /backup.sh

Paste the following script and change your details.

#!/bin/bash

TIME=`date +%b-%d-%y`                                                # This Command will read the date.

BK_FILENAME=backup-domainname.com-$TIME.tar.gz    # The filename including the date.

SOURCE=/var/www/html                                                 # Source backup folder.

DESCT=/backup                                                           # Destination of backup file.

tar -czf $DESCT/$BK_FILENAME $SOURCE

Note: The only risk that can occur is to get out of disk memory if the source folder is big, but you can configure it by removing file after 30 days or any number of days with the help of the find command.

find /backup -type f -name ‘*.gz’ -mtime +15 -exec rm {} \;

Automation

In Linux, we can easily use the cron jobs in order to schedule task and perform the above backup task easily.                The cron jobs line has 6 parts see below explanation: Minutes Hours Day of Month Month Day of Week Command 0 to 59 0 to 23 1 to 31 1 to 12 0 to 6 Shell Command Open crontab editor utility:
#
crontab -e 

Note: the edit rules are similar with vi editor.
Paste the following text in the editor:
# M H DOM M DOW CMND
00 04 * * * /bin/bash /backup.sh
This will run the script every day at 04:00:00.
Check the rules of crontab with the help of the following command:
#
Crontab -l 

CONCLUSION

After the above configuration, you can take backup automatically and remove it in some specific period of time.

How to configure Domain Name with VirtualHost in Centos 7 VPS and attach SSL certificate?

Several providers provides Domain Name service to its customer so that people need not remember the IP address of the web server. With the help of DNS the IP address can easily resolve with Domain Name and Vise Versa.

Prerequisite

1. Domain Name – Free(Freenom), Paid(Godaddy)

VPS – Centos 7
3. Web Server – apache, nginx

Configure Domain Name

In this blog we are going to take Free Domain Name from https://www.freenom.com, you can also purchase it from Godaddy.

Now follow the steps to configure the Domain Name:

Open the above given website and search for new domain.
Select the required domain and click on checkout option.
Now click on Use DNS option and also give the IP address of your VPS, also select the period from top right corner and then click on continue.

Click On Agree all the Terms and Condition checkbox and complete the shopping.

After that go inside the Domain Name and click on DNS management for your Domain.

Configure VPS

VPS stands for Virtual Private Server are the servers provided by many organizations like AWS, Azure that are used as

Web Server for Website Hosting and Database Server for storing database of all the customer.

For Example, Centos, Ubuntu, etc.

Now follow the steps to configure VirtualHost in Centos 7 VPS.
1. Open the server with SSH and type sudo command for non-root users.

After that go inside the /var/www/html directory and create new directory over their with the Domain Name by using the following command:

# sudo cd /var/www/html

# sudo mkdir yourdomain.com

# sudo cd yourdomain.com

# sudo vi index.html

After then write “Website under construction”.

Now create new conf file with server name in conf. directory

# sudo cd /etc/httpd/conf.d

# sudo vi yourdomain.com.conf

Now write the following code to create Virtual Host,

 

DocumentRoot “/var/www/html/learalot.ga”

ServerName learnalot.ga

ServerAlias www.learnalot.ga

<Directory “/var/www/html/learnalot.ga”>

Options FollowSymLinks

AllowOverride All

Options -Indexes

 

Redirect Permanent / https://learnalot.ga <—-> If you want to redirect http traffic to https.

 

DocumentRoot “/var/www/html/learnalot.ga”

ServerName learnalot.ga

ServerAlias www.learnalot.ga

<Directory “/var/www/html/learnalot.ga”>

Options FollowSymLinks

AllowOverride All

Options -Indexes

 

 

And save the file with :wq command.

Configure Web Server

For configuring Web Server you first decide which server you want to use for hosting website, Like apache, nginx, Microsoft IIS select any server based on your requirement.

In this we are going to install apache web server by using the following command:

# yum install -y httpd

# systemctl start httpd

# systemctl enable httpd

Configure SSL certificate

SSL stands for Secure Sockets Layer is a standard security technology for establishing an encrypted connection between the server and the client, Like Mail Server and Web server(Browser) and Mail Client.

Steps to configure the Let’s Encrypt Free SSL certificate in centos7 VPS.
1. Open this URL https://certbot.eff.org/ and click on Get certbot  instruction options.

Now select the software and VPS in which your website is running.

Run VPS with SSH and use sudo if you don’t have root privileges.
Enable EPEL repository by using the following command:
# yum install -y
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Now after that enable the optional channel by using the following command:

# yum -y install yum-utils

# yum-config-manager –enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

6. Install certbot by using following command:

# yum install certbot python2-certbot-apache

Run this command to get a certificate and have Certbot edit your Apache configuration automatically to serve it, turning on HTTPS access in a single step.

# certbot –apache

Set up automatic renewal

# echo “0 0,12 * * * root python -c ‘import random;

import time; time.sleep(random.random() * 3600)’ && certbot

renew” | sudo tee -a /etc/crontab > /dev/null

Confirm that certbot worked by clicking on the particular website.

https://www.ssllabs.com/ssltest/

Enter your domain name and it will show that website is secured or not.

Test your Domain Name

Now after completing the above installation go to any browser and type the Domain Name yourdomain.com in the URL to check the configuration.

Before

After

CONCLUSION-

In this blog you can learn how to configure Domain Name with VirtualHost in centos 7 VPS and also learn how to configure SSL certificate in your website by using Let’s Encrypt Free SSL service provider.

Get started with CloudMinister Today