Serial Terminal Configuration in RHEL Distribution

Serial Terminal Configuration in RHEL 7

Add, or update if already present, the following lines to /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

GRUB_CMDLINE_LINUX_DEFAULT applies this configuration only to the default menu entry, use GRUB_CMDLINE_LINUX to apply it to all the menu entries.
NOTE: each line type above should only appear once within the /etc/default/grub file. If the line already exists, then just modify it rather than add a second copy of same. That is, only one GRUB_CMDLINE_LINUX_DEFAULT line should exist in the file, etc.

Rebuild the /boot/grub2/grub.cfg file by running the grub2-mkconfig -o command as follows:

On BIOS-based machines: ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
On UEFI-based machines: ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

Red Hat Enterprise Linux 8

Read more

Share

PHPSysinfo CentOS 7 Installer Script

Intended to to deploy on a barebone fresh CentOS installation with Apache and PHP-

!#/bin/sh

#################################################
# Server Configuration for Centos 6.8 Final #
# Don't use port 7071 
# Updated by Rumi- hasan@servermart.net # 
#################################################

## updating packages
sudo yum update -y

## installing dependencies
sudo yum install unzip -y
sudo yum install nano -y
sudo yum install sed -y
sudo yum install screen -y

## installing HTTP Server (Powered By Apache)
sudo yum install httpd mod_ssl -y

## starting HTTP Services
sudo /usr/sbin/apachectl start

## fix for hostname resolving
echo "ServerName localhost" >> /etc/httpd/conf/httpd.conf

## make automatic start after reboot
sudo /sbin/chkconfig httpd on

## make sure automatic start is running
sudo /sbin/chkconfig --list httpd | grep httpd

## install PHP
sudo yum install php php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml -y

## change to port 7071
#sed -i -e 's/Listen 80/Listen 7071/g' /etc/httpd/conf/httpd.conf

##restarting HTTP Services
sudo systemctl restart httpd &&

## downloading phpsysinfo
cd /var/www/html
rm -R *
wget https://github.com/phpsysinfo/phpsysinfo/archive/master.zip
unzip master.zip
cp -r phpsysinfo-main/* /var/www/html
mv phpsysinfo.ini.new phpsysinfo.ini

## finishing installation
sudo systemctl restart httpd
Share

Install PHPIPAM using Docker on CentOS 7

Update Docker Package Database. In a terminal window, type:

sudo yum check-update

Remove if any docker is preinstalled with your OS-

sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine

Install the Dependencies

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

The –y switch indicates to the yum installer to answer “yes” to any prompts that may come up. The yum-utils switch adds the yum-config-manager. Docker uses a device mapper storage driver, and the device-mapper-persistent-data and lvm2 packages are required for it to run correctly.

Read more

Share

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