How to Install Virtualmin on CentOS 7 / RHEL 7 / Oracle Linux 7

Virtualmin is an advanced web hosting control panel that is very flexible and powerful for Linux and UNIX systems. It is based on the well-known Open Source web-based system management, Webmin. It is a Webmin module for managing multiple virtual hosts, multiple virtual domains, mailboxes, databases, applications, and the entire server, from one comprehensive and single friendly web interface. Virtualmin is an excellent alternative to cPanel and Plesk, with the same administrative structure based on user root, resellers, and customers. Virtualmin supports the account creation and management of Apache virtual hosts, BIND DNS domains, MySQL database. VirtualMin also provides functions for non-root users to manage their hosting account. In this article, i will show the steps to install Virtualmin on CentOS 7 / RHEL 7 / Oracle Linux 7. Steps maybe similar to older version of linux distribution.

Install Virtualmin on CentOS 7

There are two versions of Virtualmin exist:

  • Virtualmin GPL is a free and the open source version. (Discussed in this article)
  • Virtualmin Pro is a the commercial version of Virtualmin.

This tutorial assumes the following:

  • You have setup minimal installation for CentOS 7 / RHEL 7 / Oracle Linux 7.
  • You are running with root access.
  • If you are running as a normal user, you must have privileged access (sudo).

Install Virtualmin on CentOS 7 / RHEL 7 / Oracle Linux 7

1. It is recommended to install Virtualmin on the fresh server to avoid conflict when you start the installation. You need to update the system to ensure that we have all the latest software installed.

To update, run the following command :

# yum update -y

2. Download the VirtualMin installer into current directory:

# wget http://software.virtualmin.com/gpl/scripts/install.sh

3. Make the install.sh file executable :

# chmod +x install.sh

4. start the installation :

# ./install.sh
 The systems currently supported by install.sh are:
 CentOS/RHEL/Scientific Linux 7 on x86_64
 CentOS and RHEL 5-6 on i386 and x86_64
 Scientific Linux 6 on i386 and x86_64
 Debian 6, 7, and 8 on i386 and amd64
 Ubuntu 10.04 LTS, 12.04 LTS, and 14.04 LTS on i386 and amd64
 Amazon Linux 2012.03 on i386 and x86_64
 FreeBSD 7.0 and 8 on i386 and amd64

If your OS is not listed above, this script will fail. More details about the systems supported by the script can be found here:

http://www.virtualmin.com/os-support.html

Example :

# ./install.sh
Checking for Perl
found Perl at /usr/bin/perl


Welcome to the Virtualmin GPL installer, version 1.1.2

 WARNING:

 The installation is quite stable and functional when run on a freshly
 installed supported Operating System.

 If you have existing websites, email users, or if you manually installed
 Virtualmin via a Webmin 'wbm' module, you are likely to run into problems.
 Please read the Virtualmin Administrators Guide before proceeding if
 your system is not a freshly installed and supported OS.

 This script is not intended to update your system!  It should only be
 used to perform your initial Virtualmin installation.  If you have previously
 run the Virtualmin installer, you can perform upgrades and updates from within
 Virtualmin itself, or using your system's package manager. Once Virtualmin is
 installed, you never need to run this script again.

 The systems currently supported by install.sh are:
 CentOS/RHEL/Scientific Linux 7 on x86_64
 CentOS and RHEL 5-6 on i386 and x86_64
 Scientific Linux 6 on i386 and x86_64
 Debian 6, 7, and 8 on i386 and amd64
 Ubuntu 10.04 LTS, 12.04 LTS, and 14.04 LTS on i386 and amd64
 Amazon Linux 2012.03 on i386 and x86_64
 FreeBSD 7.0 and 8 on i386 and amd64

 If your OS is not listed above, this script will fail.  More details
 about the systems supported by the script can be found here:

   http://www.virtualmin.com/os-support.html

 Continue? (y/n) y
Checking for HTTP client...found /usr/bin/curl -s -O
Checking for perl...found /usr/bin/perl
Loading log4sh logging library...
INFO - Started installation log in /root/virtualmin-install.log
INFO - Checking for fully qualified hostname...
INFO - Hostname OK: fully qualified as centos71.ehowstuff.local
INFO - Installing serial number and license key into /etc/virtualmin-license
INFO - Loading OS selection library...
INFO - Download of http://software.virtualmin.com/lib/oschooser.pl Succeeded.
INFO - Loading OS list...
INFO - Download of http://software.virtualmin.com/lib/os_list.txt Succeeded.
INFO - Operating system name:    CentOS Linux
INFO - Operating system version: 7.1.1503
INFO - Configuring package manager for CentOS Linux 7.1.1503...
INFO - Disabling SELinux during installation...
/usr/sbin/setenforce: SELinux is disabled
INFO -   setenforce 0 failed: 1
INFO - Download of http://software.virtualmin.com/gpl/rhel/7.1.1503/x86_64/virtualmin-release-latest.noarch.rpm Succeeded.
warning: virtualmin-release-latest.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID a0bdbcf9: NOKEY
INFO -  Succeeded.
INFO - Installing dependencies using command: /usr/bin/yum -y -d 2 install bind bind-utils caching-nameserver httpd postfix spamassassin procmail perl-DBD-Pg
 perl-DBD-MySQL quota iptables openssl python mailman subversion mysql mysql-server mysql-devel mariadb mariadb-server postgresql postgresql-server rh-postgr
esql rh-postgresql-server logrotate webalizer php php-xml php-gd php-imap php-mysql php-odbc php-pear php-pgsql php-snmp php-xmlrpc php-mbstring mod_perl mod
_python cyrus-sasl dovecot spamassassin mod_dav_svn cyrus-sasl-gssapi mod_ssl ruby ruby-devel rubygems perl-XML-Simple perl-Crypt-SSLeay mlocate perl-LWP-Pro
tocol-https
                  
..
..
..

5. Once the install.sh script complete, you have to login to web management console :

https://IPADDRESS:10000/

The following are the summaries for the Post Setup Wizard task :

a) Once you login you will be prompted with a Post Setup Wizard. Click Next.

b) You will be prompted if you would like to pre-load certain libraries. Click Yes and then Next.

c) You will be prompted if you would like to run ClamAV virus scanner on your server. It is suggested that you select Yes and click Next.

d) You will be prompted if you would like to run the SpamAssassin e-mail spam scanner. If you are not running e-mail services it is not necessary to run this. However if you are hosting e-mail it is highly advised. Click Yes and Next if you are going to use SpamAssassin, otherwise click Next.

e) Next you will be prompted if you would like to run MySQL and/or PostgreSQL servers. This is entirely up to you as to which database servers you will provide to your customers (if any). Select your options and click Next. You will be prompted on the following screens for password information.

f) Once finished, you will be presented with an ‘All Done’ page. Click Next.

g) Once the main page loads you will need to reload your configuration. Click the Re-check and refresh configuration button in the yellow box.

I hope this article gives you some ideas and essential guidance on how to install Virtualmin on CentOS 7 / RHEL 7 / Oracle Linux 7.

 

How to Configure Firewalld in Linux CentOS 7 / RHEL7

Linux kernel includes powerful network filtering subsystem called Netfilter. It allows kernel modules to inspect each packet crossing the linux system such as to allow or drop incoming and outgoing network packet. In older Red Hat Enterprise Linux (RHEL) release such as RHEL 5 and RHEL 6, iptables was the main method of interacting with the kernel netfilter subsystem. The firewall capabilities were provided by the iptables utility, and configured either at the command line or through the graphical configuration tool, system-config-firewall.

configure firewalld in linux

In RHEL 7, firewalld has been introduced as a new method of interacting with netfilter. It is a default method for managing host-level firewalls. Basically the firewall capabilities are still provided by iptables. But linux administrators now interact with iptables through the dynamic firewall daemon, firewalld, and its configuration tools: firewall-config, firewall-cmd, and firewall-applet, which is not included in the default installation of Red Hat Enterprise Linux 7. Traffic management becomes easier after firewalld classifies all network traffic into a specific zone. Based on criteria such as source IP address of packets through the network, traffic was diverted into the firewall rules for approriate zone.

How to Configure Firewalld in Linux

There are three main ways for system administrators to interact with firewalld.

  • By directly editing congfiguration files in /etc/firewalld
  • By using the graphical firewall-config tool
  • By using firewalld-cmd from the command line (will be discussed in this article)

This article will discuss how to configure firewalld in linux CentoS 7, RHEL 7 and Oracle linux 7 by using firewalld-cmd command line. Please take note that the firewalld daemon is installed from the firewalld package. It is part of a base install, but not part of a minimal installation.

1. How to install Firewalld :

Firewalld package is installed by default in RHEL 7.1 and CentOS 7.1. If you noticed it is not installed, you can install it using the following YUM command.

# sudo yum install firewalld -y

2. How to disable or enable Firewalld at boot :

a) To disable start at boot :

# sudo systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'

b) To enable start at boot :

# sudo systemctl enable firewalld

3. Verify that firewalld is enabled and running on your server system :

# sudo systemctl status firewalld.service

Example :

# sudo systemctl status firewalld.service
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled)
   Active: active (running) since Wed 2015-09-09 21:26:25 MYT; 1 weeks 0 days ago
 Main PID: 2348 (firewalld)
   CGroup: /system.slice/firewalld.service
           ??2348 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Sep 09 21:26:25 centos71.ehowstuff.local systemd[1]: Started firewalld - dynamic firewall daemon.

4. How to query the current default zone ?

# sudo firewall-cmd --get-default-zone
public

In this case, the default zone is public.

5. How to list all available zones ?

# sudo firewall-cmd --get-zones
block dmz drop external home internal public trusted work

This will display all available zones.

6. Open up incoming http,https and mysql traffic for public zone :

# sudo firewall-cmd --permanent --zone=public --add-service=http
# sudo firewall-cmd --permanent --zone=public --add-service=https
# sudo firewall-cmd --permanent --zone=public --add-service=mysql

7. Activate the changes to your server firewall :

# sudo firewall-cmd --reload

8. Check the configuration of the running firewall on your system :

a) Query active zone :

# sudo firewall-cmd --get-active-zones

b) Display all running firewall configuration :

# sudo firewall-cmd --zone=public --list-all

Example :

# sudo firewall-cmd --zone=public --list-all
public (default, active)
  interfaces: ens32
  sources:
  services: dhcpv6-client http https mysql ssh
  ports:
  masquerade: no
  forward-ports:
  icmp-blocks:
  rich rules:

I hope that this gives you some ideas and essential guidance on how to configure firewalld in linux RHEL 7 / CentOS 7.