Upgrading PHP 7.2 to 7.4 for WHMCS on CentOS 7

Lately  I needed an update of PHP (7.2 to 7.4) on my WHMCS CentOS 7 built box- here’re the process that I followed. But before that, I’m sharing my original post on setting up WHMCS on CentOS 7

Since I used remi repository to install version 7.2, I’ll be doing the same as well-

root@portal:~# yum-config-manager --enable remi-php74
root@portal:~# yum update

Now install PHP 7.4 with all necessary modules with the command below-

Read more

Share

Install Plex on CentOS 7

Was just playing around. It’s a great home entertainment tool indeed.

Method-1: Creating repository and using Yum

To enable the Plex repository open your text editor and create a new YUM repository configuration file named plex.repo in /etc/yum.repos.d/ directory:

[PlexRepo]
name=PlexRepo
baseurl=https://downloads.plex.tv/repo/rpm/$basearch/
enabled=1
gpgkey=https://downloads.plex.tv/plex-keys/PlexSign.key
gpgcheck=1

Method-2: Installation using RPM

download the package for your Linux distro. It is much easier to do this by simply coping the download link location with right click and then you can run:

$ sudo rpm -ivh https://downloads.plex.tv/plex-media-server/1.13.8.5395-10d48da0d/plexmediaserver-1.13.8.5395-10d48da0d.x86_64.rpm

Alternatively, you can download the package on your system with wget command as shown.

$ wget https://downloads.plex.tv/plex-media-server/1.13.8.5395-10d48da0d/plexmediaserver-1.13.8.5395-10d48da0d.x86_64.rpm

If you’ve used install base using yum repo- you now need to install it, otherwise if you’re with RPM installation, you already have plex installed.

Read more

Share

Install XRDP on CentOS 7

Prerequisites:

XRDP is an open-source version of the Microsoft Remote desktop Protocol server. It enables operating systems besides Microsoft Windows to offer a fully functional remote desktop experience. The prerequisites for the installation include:

Before all else, install Gnome GUI on CentOS 7 or RHEL 7.

Then install and configure EPEL repository with this commandrpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Read more

Share

Install and Configure Fail2Ban for Zimbra on CentOS 7

Below is how to install and configure Fail2Ban for Zimbra. In this guidance, I use CentOS. Please adjust python-pip version if using another OS

1. Install pip

yum install python3-pip

2. Install dependencies required by Fail2Ban

pip3 install pyinotify
pip3 install dnspython

3. Download and extract Fail2Ban

cd /tmp/
wget -c https://github.com/fail2ban/fail2ban/archive/0.9.4.tar.gz

4. Install Fail2Ban

tar -xvf 0.9.4.tar.gz
cd fail2ban-0.9.4
python3 setup.py install

5. Copy Fail2Ban service to systemd

cp files/fail2ban.service /usr/lib/systemd/system/

6. Adjust bin location on Fail2Ban service

vi /usr/lib/systemd/system/fail2ban.service

Adjust the following lines. Change /usr/bin become /usr/local/bin

Read more

Share

IPTables D-NAT Firewall Rule

# Generated by iptables-save v1.3.5 on Tue Oct 28 23:57:58 2014
*filter
:INPUT ACCEPT [2590:547311]
:FORWARD ACCEPT [11426:731834]
:OUTPUT ACCEPT [3989:328501]
-A INPUT -i eth0 -j ACCEPT
COMMIT
# Completed on Tue Oct 28 23:57:58 2014
# Generated by iptables-save v1.3.5 on Tue Oct 28 23:57:58 2014
*mangle
:PREROUTING ACCEPT [24964:3178001]
:INPUT ACCEPT [9150:1450474]
:FORWARD ACCEPT [11426:731834]
:OUTPUT ACCEPT [4655:374193]
:POSTROUTING ACCEPT [15415:1060335]
COMMIT
# Completed on Tue Oct 28 23:57:58 2014
# Generated by iptables-save v1.3.5 on Tue Oct 28 23:57:58 2014
*nat
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -m state -i eth0 --state RELATED,ESTABLISHED -j ACCEPT
-A PREROUTING -p tcp -m tcp -d 123.45.67.89 --dport 80 -j DNAT --to-destination 172.16.5.113
-A POSTROUTING -j MASQUERADE
COMMIT
# Completed on Tue Oct 28 23:57:58 2014
Share

Create A Network Bridge on CentOS 7

Install Module

CentOS 7 comes with bridging module loaded on system boot by default. Use the following command to verify whether the module is loaded or not.

# modinfo bridge
filename:       /lib/modules/3.10.0-327.el7.x86_64/kernel/net/bridge/bridge.ko
alias:          rtnl-link-bridge
version:        2.3
license:        GPL
rhelversion:    7.2
srcversion:     905847C53FF43DEFAA0EB3C
depends:        stp,llc
intree:         Y
vermagic:       3.10.0-327.el7.x86_64 SMP mod_unload modversions
signer:         CentOS Linux kernel signing key
sig_key:        79:AD:88:6A:11:3C:A0:22:35:26:33:6C:0F:82:5B:8A:94:29:6A:B3
sig_hashalgo:   sha256

If the module is not loaded, you can load it using the following command.

Read more

Share

Install transmission on Centos 7

Step 1. First, you need to enable the EPEL repository on your system.

yum install epel-release
yum -y update

Step 2. Installing Transmission on CentOS 7.

Just run the following command to install Transmission:

yum install transmission-cli transmission-common transmission-daemon

Once complete, you can verify Transmission is installed by running the below command:

systemctl start transmission-daemon.service
systemctl stop transmission-daemon.service

Step 3. Configuration Transmission.

Edit the transmission settings.json config file:

Read more

Share

Add User to Sudoers on CentOS

You can do this in 2 methods- however, IMHO method-2 usually works great for me.

Method-1

Step 1: Verify the Wheel Group is Enabled

Your CentOS 7 installation may or may not have the wheel group enabled. Open the configuration file by entering the command:

visudo

Scroll through the configuration file until you see the following entry:

## Allows people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL

If the second line begins with the # sign, it has been disabled and marked as a comment. Just delete the # sign at the beginning of the second line so it looks like the following:

%wheel        ALL=(ALL)       ALL

Then save the file and exit the editor.

Read more

Share

Remove Old Unused Kernels in CentOS

To display the current version of Linux (kernel) running on your system, run this command.

# uname -sr
Linux 3.10.0-327.10.1.el7.x86_64

List All Installed Kernels on System

You can list all kernel images installed on your system like this.

# rpm -q kernel
kernel-3.10.0-229.el7.x86_64
kernel-3.10.0-229.14.1.el7.x86_64
kernel-3.10.0-327.3.1.el7.x86_64
kernel-3.10.0-327.10.1.el7.x86_64

Removing Old/Unused Kernels on CentOS/RHEL

You need to install yum-utils, which is an assortment of utilities that integrate with yum to make it more powerful and easier to use, by extending its original features in several different ways.

Read more

Share