Build a Centos 7 Repo

Install httpd

[root@www ~]# yum -y install httpd
# remove welcome page
[root@www ~]# rm -f /etc/httpd/conf.d/welcome.conf

Configure httpd. Replace server name to your own environment.

[root@www ~]# vi /etc/httpd/conf/httpd.conf
# line 86: change to admin's email address

ServerAdmin root@srv.world
# line 95: change to your server's name

ServerName www.srv.world:80
# line 151: change

AllowOverride All
# line 164: add file name that it can access only with directory's name

DirectoryIndex index.html index.cgi index.php
# add follows to the end

# server's response header

ServerTokens Prod
# keepalive is ON

KeepAlive On

[root@www ~]# systemctl start httpd
[root@www ~]# systemctl enable httpd

Install other required packages.

[root@dlp ~]# yum -y install rsync createrepo

Continue reading “Build a Centos 7 Repo” »

Share

Install MariaDB on CentOS 7

Start by adding the MariaDB YUM repository file MariaDB.repo for RHEL/CentOS and Fedora systems.

# vi /etc/yum.repos.d/MariaDB.repo

Now add the following lines to your respective Linux distribution version as shown.

On CentOS 7
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Step 2: Install MariaDB in CentOS 7
Once MariaDB repository has been added, you can easily install it with just one single command.

# yum install MariaDB-server MariaDB-client -y

Continue reading “Install MariaDB on CentOS 7” »

Share

Install WHMCS on CentOS 7

As you may know, WHMCS is the leading web hosting management and billing software that automates all aspects of your business from billing, provisioning, domain reselling and etc. In this article, we are going to install WHMCS 7.7.1 on CentOS 7.6.

We assume you have a valid WHMCS license and have downloaded its package from WHMCS download area.

Here are our environment OS and software versions:

  • OS: Centos 7.6 on VMware
  • WHMCS: 7.7.1
  • PHP: 7.2
  • Database: Mariadb 10.3
  • Web server: httpd 2.4

Here we start from a fresh minimal CentOS 7.6 installation.

1- Initial CentOS setup
Set correct time and date. here we use “Asia/Dhaka”:

# timedatectl set-timezone America/New_York

Change default root password:

# passwd

Set SELinux to permissive mode by editing /etc/selinux/config:

# vim /etc/selinux/config
SELINUX=permissive

Also to apply it immediately run: Continue reading “Install WHMCS on CentOS 7” »

Share

Configuring SpamAssassin for Postfix on CentOS

In the process of receiving email, spamassassin will stand between the outside world and the email services running on your server itself. If it finds, according to its definition rules and configuration, that an incoming message is spam, it will rewrite the subject line to clearly identify it as such. Let’s see how.

The main configuration file is /etc/mail/spamassassin/local.cf, and we should make sure the following options are available (add them if they are not present or uncomment if necessary):

local.cf
report_safe 0
required_score 8.0
rewrite_header Subject [SPAM]

When report_safe is set to 0 (recommended value), incoming spam is only modified by modifying the email headers as per rewrite_header. If it is set to 1, the message will be deleted. To set the aggressivity of the spam filter, required_score must be followed by an integer or decimal number. The lesser the number, the more sensitive the filter becomes. Setting required_score to a value somewhere between 8.0 and 10.0 is recommended for a large system serving many (~100s) email accounts. Once you’ve saved those changes, enable and start the spam filter service, and then update the spam rules: Continue reading “Configuring SpamAssassin for Postfix on CentOS” »

Share

Install ClamAV on CentOS 6

Step 1. First add yum repository your system.

The EPEL repo is enabled by simply installing an RPM. Please use the command below to install the EPEL repository on your CentOS server.

#CentOS 6 – 32-bit

rpm -Uvh http://mirror.overthewire.com.au/pub/epel/6/i386/epel-release-6-8.noarch.rpm

#CentOS 6 – 64-bit

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Step 2. Install required ClamAV packages.

yum install clamav clamd

Step 3. Start the clamd service on system boot. Continue reading “Install ClamAV on CentOS 6” »

Share

Install SNMP and Configure the Community String For CentOS

Install SNMP

Install the SNMPD service by running the following command:

yum install net-snmp net-snmp-utils

Once the service is installed, verify that it is set to start at startup by running:

CentOS 6:

chkconfig snmpd on

CentOS 7:

systemctl enable snmpd

Continue reading “Install SNMP and Configure the Community String For CentOS” »

Share

Extend/Reduce LVM’s (Logical Volume Management) in Linux

My Server Setup – Requirements

  1. Operating System – CentOS 6.5 with LVM Installation
  2. Server IP – 192.168.0.200

How to Extend Volume Group and Reduce Logical Volume

Logical Volume Extending

Currently, we have One PV, VG and 2 LV. Let’s list them one by one using following commands.

# pvs
# vgs
# lvs

Logical Volume Extending

Logical Volume Extending

Continue reading “Extend/Reduce LVM’s (Logical Volume Management) in Linux” »

Share

Install cPanel on CentOS 7

cPanel is an online Linux-based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site or email.

Prerequisite:

  • Launch a CentOS 7 instance (Only install cPanel & WHM on a freshly-installed operating system).
  • Access the instance via SSH.
  • Run all the following commands from the shell/terminal (All commands need to be run as the root user).
  • You need to purchase your own cPanel license to use the control panel.

Instructions:

Step 1: Set a valid hostname (FQDN) for your system. Note: Replace “your-hostname.example.com” with a FQDN.

hostname <your-hostname.example.com>

Step 2: Disable SELinux.

sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/’ /etc/selinux/config

Step 3: Download and run the installation script. Tips: You may use the screen utility in case your session disconnects during installation.

cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest

Step 4: Wait for the installation to complete.

Step 5: While waiting for the installation, you might want to allow all the required ports on the security group for your instance (eg: WHM SSL, FTP, HTTP, HTTPS). Please follow the guide here.

Note: To know which ports are used by cPanel & WHM, please refer to this official documentation: https://documentation.cpanel.net/display/CKB/How+to+Configure+Your+Firewall+for+cPanel+Services

Step 6: Set a password for root.

passwd

Step 7: Browse to https://<your-server-ip>:2087 to access the WHM, and login as root.

Result:

Src: https://www.ipserverone.info/cloud/how-to-install-cpanel-on-centos-7/

Share

Install Mariadb on CentOS 7

MariaDB is an open-source relational database management system, backward compatible, binary drop-in replacement of MySQL. It is developed by some of the original developers of the MySQL and by many people in the community. With the release of CentOS 7, MySQL was replaced with MariaDB as the default database system.

If you, for any reason need to install MySQL, check the How to Install MySQL on CentOS 7 tutorial. If your application does not have any specific requirements, you should stick with MariaDB, the default database system in CentOS 7.

In this tutorial we will show you how to install the latest version of MariaDB on CentOS 7 using the official MariaDB repositories.

Prerequisites

Make sure you are logged in as a user with sudo privileges before proceeding with the tutorial.

Install MariaDB 5.5 on CentOS 7: The version of the MariaDB server provided in default CentOS repositories is version 5.5. This is not the latest version though, but it is quite stable.

Follow the steps below to install and secure MariaDB 5.5 on CentOS 7:

Install the MariaDB package using the yum package manager:

sudo yum install mariadb-server

Press y when prompted to proceed with the installation. Once the installation is complete, start the MariaDB service and enable it to start on boot using the following commands:

sudo systemctl start mariadbsudo systemctl enable mariadb

To verify that the installation was successful, check the MariaDB service status by typing:

sudo systemctl status mariadb

The output should show that the service is active and running: Continue reading “Install Mariadb on CentOS 7” »

Share

Reinstall VirtualBox on Ubuntu & CentOS

For Ubuntu

To remove virtualbox

sudo dpkg --list virtualbox-*
sudo apt autoremove --purge virtualbox*
dpkg -l virtualbox* | grep ^i

Remove all PPAs from sources.list and source.list.d directory

mkdir ~/apt-tmp
sudo mv /etc/apt/sources.list.d/* ~/apt-tmp

Make sure there is nothing except official repositories sources in /etc/sources.list. And update your sources:

sudo apt update

Now we can search to see which versions are available to install:

apt-cache madison virtualbox | grep -iv sources

Which produces an output like this:

virtualbox | 5.0.32-dfsg-0ubuntu1.16.04.2 | http://mirrors.kernel.org/ubuntu xenial-updates/multiverse amd64 Packages
virtualbox | 5.0.18-dfsg-2build1 | http://mirrors.kernel.org/ubuntu xenial/multiverse amd64 Packages

Then I would install the last version mentioned in xenial-updates: Continue reading “Reinstall VirtualBox on Ubuntu & CentOS” »

Share