Install PHP 7.3, 7.2, 7.1 on CentOS/RHEL 6.10

Configure Yum Repository

First of all, you need to enable Remi and EPEL yum repositories on your system. Use the following command to install EPEL repository on your CentOS and Red Hat 7/6 systems

Use this command to install epel-release yum repository

yum install epel-release

and now execute one of the following commands as per your operating system version to install Remi repository.

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Install PHP 7 on CentOS 6

Your system is prepared for the PHP installation from yum repositories. Use one of the following commands to install PHP 7.3 or PHP 7.2 or PHP 7.1 on your system based on your requirements.

## Install PHP 7.3 
yum --enablerepo=remi-php73 install php
## Install PHP 7.2 
yum --enablerepo=remi-php72 install php
## Install PHP 7.1 
yum --enablerepo=remi-php71 install php

I have installed the latest version PHP 7.3 on my system. Now running the following command to check current active PHP version on my system.

Read more

Share

Apache Virtual Hosts on CentOS

Step One— Create a New Directory

The first step in creating a virtual host is to a create a directory where we will keep the new website’s information.

This location will be your Document Root in the Apache virtual configuration file later on. By adding a -p to the line of code, the command automatically generates all the parents for the new directory.

sudo mkdir -p /var/www/example.com/public_html

You will need to designate an actual DNS approved domain, or an IP address, to test that a virtual host is working. In this tutorial we will use example.com as a placeholder for a correct domain name.

However, should you want to use an unapproved domain name to test the process you will find information on how to make it work on your local computer in Step Six.

Step Two—Grant Permissions

We need to grant ownership of the directory to the user, instead of just keeping it on the root system.

sudo chown -R apache:apache /var/www/example.com/public_html

Additionally, it is important to make sure that everyone will be able to read our new files.

sudo chmod 755 /var/www

Now you are all done with permissions.

Read more

Share

Find Out NFS Clients Connected To My NFS Server

You can use the following commands. SSH or login into your nfs server and type the following command:

netstat -an | grep nfs.server.ip:port

If your nfs server IP address 192.168.1.12 and port is 2049, enter:

netstat -an | grep 192.168.1.12:2049

Sample outputs:

tcp 0 0 192.168.1.12:2049 192.168.1.5:757 ESTABLISHED
tcp 0 0 192.168.1.12:2049 192.168.1.6:892 ESTABLISHED

Where,

192.168.1.12 – NFS serer IP address
2049 – NFS server port
192.168.1.5 and 192.168.1.6 – NFS clients IP address

Read more

Share

How to Change Hostname on Ubuntu 18.04

Display the Current Hostname

To view the current hostname, enter the following command:

hostnamectl

As you can see in the image above, the current hostname is set to ubuntu1804.localdomain.

Change the Hostname

The following steps outline how to change the hostname in Ubuntu 18.04.

1. Change the hostname using hostnamectl

In Ubuntu 18.04 we can change the system hostname and related settings using the command hostnamectl.

For example, to change the system static hostname to linuxize, you would use the following command:

Read more

Share

Split large file and combine file in Linux

$ du -h Linux\ Security.mp4

Sample output:

1.1G Linux Security.mp4

As you see, the video file size is 1.1 GiB, which is very large to upload to my google drive. Even though, Google Drive lets users upload files up to 5TB in size, it is really time consuming process. With my low speed Internet connection, I presume it would take more than 30 minutes to upload. I don’t want to wait that much longer. So, what I am going to do is split this file into multiple smaller size files, for example 100 MB each, to make upload process faster.

Now, let us split the above file into multiple smaller files, say for example 100MB each. To do so, run:

$ split -b 100M Linux\ Security.mp4 ls.

Read more

Share

Install Netdata on CentOS 6

Installing Netdata

[root@linuxhelp Desktop]# yum install zlib-devel libuuid-devel libmnl-devel gcc make git autoconf autogen automake pkgconfig -y
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Determining fastest mirrors
.
.
perl-Error.noarch 1:0.17015-4.el6 perl-Git.noarch 0:1.7.1-9.el6_9 
ppl.x86_64 0:0.10.2-11.el6

Complete!

It doesn’t end with that, you should also install additional packages. Run the following command for the same purpose.

Read more

Share

Repeat a Linux Command Every X Seconds Forever- using watch

Use watch Command

Watch is a Linux command that allows you to execute a command or program periodically and also shows you output on the screen. This means that you will be able to see the program output in time. By default watch re-runs the command/program every 2 seconds. The interval can be easily changed to meet your requirements.

Monitor Memory Usage

“Watch” is extremely easy to use, to test it, you can fire up a Linux terminal right away and type the following command:

# watch free -m

The above command will check your system free memory and update the results of the free command every two seconds.

Monitor Memory Usage in Linux

As seen per the above output, you have a header, displaying information about (from left to right) update interval, command that is being executed and current time. If you wish to hide this header, you can use the -t option.

Read more

Share

Set Up Apache Virtual Hosts on Debian 7

Step One— Create a New Directory

First, it is necessary to create a directory where we will keep the new website’s information. This location will be your Document Root in the Apache virtual configuration file. By adding a -p to the line of code, the command automatically generates all the parents for the new directory.

You will need to designate an actual DNS approved domain (or an IP address) to test that a virtual host is working. In this tutorial, we will use example.com as a placeholder for a correct domain name.

sudo mkdir -p /var/www/example.com/public_html

*If you want to use an unapproved domain name to test the process, you will find information on how to make it work on your local computer in Step Seven.

Read more

Share