Wednesday 24 January 2024

How to Install Virtualmin on CentOS 7/RHEL [Step by Step]

 Virtualmin is a powerful web hosting control panel built on top of webmin and offer similar functionalities of cPanel and Plesk. It’s a perfect control panel for those looking for a free cPanel alternative.

Using virtualmin, one can manage Apache virtual host, BIND DNS server, Mail server, database and more with its easy to use interface.



It is a worthy alternative to cPanel or Plesk since the administrative workflow is based on root user, resellers or customers.

It has both Open Source version (GPL)/free and commercial version that you can choose from. Although the functionalities are almost identical but the professional versions offers few more utilities and support for it.

It is possible to install virtualmin either manually or by using automated installer script. In this article we will look into how to install virtualmin in CentOS 7 using the automated installer script.

In this step by step tutorial you will learn how to install Virtualmin on Centos 7 VPS and configuring the server to make it secure and hacker proof.

Pre-requisites

  • You need to have SSH access with root or a sudo enabled user
  • The domain name that you want use for virtualmin installation is pointing to the public IP of CentOS/RHEL 7 instance
  • For full installation of Virtualmin, your CentOS 7 system must have at least 2GB of RAM

Configure FQDN of the host

The first step of configuring hostname is to change the hostname of your system use hostnamectl command. It does not require you to reboot the system since hostnamectl will directly update the kernel about change in hostname.

hostnamectl set-hostname virtualmin

Now edit the hosts file and add a line at the end.  The format is IP_ADDRESS hostname.yourdomain hostname

vi /etc/hosts

127.0.0.1  virtualmin.domain.com  virtualmin

Run the following command to restart network manager to apply above changes:

systemctl restart NetworkManager.service

OR

systemctl restart network

Check the hostname and FQDN of the host:

hostname 
virtualmin

hostname -f
virtualmin.domain.com

Install Virtualmin

It is always recommended to install Virtualmin in a fresh server/VPS to avoid any conflict in the packages. To start with update the system to make sure that you have all the latest packages installed.

yum update

Now that you have updated your Linux OS, all you need to do is download the installer script and execute the script to install Virtualmin.

cd /tmp/
wget http://software.virtualmin.com/gpl/scripts/install.sh
chmod u+x install.sh
./install.sh

The command will first change the directory to “tmp”, then it will download the script to that directory, the next command i.e. “chmod u + x”  assigns the permission to execute and run the “install.sh” file.

The installer script will prompt you for a confirmation to proceed with installation. Press ‘Y’ to continue. It will take few minutes to complete the installation and at the end the installer will provide you with an URL to login for the first time.

Install Virtualmin - Success

The installation of virtualmin is completed. Now proceed with configuring packages and elements of virtualmin as per your requirements. But before that, configure firewall settings so that you can access virtualmin from public domain.

Configure Firewall

If you have enabled the default firewall manager firewalld and is running in your Centos 7 box then open up tcp port 10000 so that inbound traffic can reach virtualmin server. Use the following firewall-cmd to open the port no 10000 so that virtualmin is accessible from outside.

firewall-cmd --permanent --zone=public --add-port=10000/tcp
firewall-cmd --reload`

Post installation setup

Now that virtualmin has been installed successfully, point your favorite web browser to the Virtualmin URL that have been shown at the end of the installation. There will be a SSL warning in the browser but ignore it for the time being and proceed to the login page of virtualmin. You will be redirected to the post installation wizard to complete the setup. It is also very much possible to cancel the post installation setup and use the default settings.

Install Virtualmin - Login

Log-in with root credential, you will be redirected to post installation wizard to complete the setup.

Click Next to start the post installation setup.

install virtualmin centos

Choose ‘Yes’ to pre-load virtualmin libraries and email domain lookup. This will lead to increase in consumption of primary memory.

Choose either ‘Yes’ or ‘No’ for clamAV scanner. Remember choosing yes will lead to significant uses of RAM of around 600 MB.

You will possibly choose to run SpamAssasin filter if you opt for a mail server otherwise chose ‘No’.

It is better to run either MariaDB or PostGresql database server at this point by choosing ‘Yes’.

Set a MySQL/MariaDB root password. Don’t forget to tick override root MySQL password match.

install GPL (free) virtualmin on centos 7

You can allocate more memory to MariaDB/MySQL database server for better performance if it is available.

For DNS zone in virtualmin to be resolvable, provide the domain name of primary and secondary (optional) nameserver. Remember the A record of domain name must point to the public IP address of virtualmin server.

For better security of password, choose the password storage mode as hashed but with this mode password recovery of virtual server will not be possible.

Next choose either ‘Yes’ or ‘No’ for configuring grub to enable XFS quotas.

Finally click ‘Next’ to complete the post installation setup.

If you have successfully completed the Post Installation steps as mentioned above you should be all set to get to the Virtualmin Dashboard as shown below.

Now, create “Virtual Server” with main domain to finish the configuration.

install virtualmin centos

Conclusions

The virtualmin installation is complete. You can now proceed with configuring other elements like creating users, setup mail boxes, and adding servers, backup and restore methods and more. Also don’t forget to explore the webmin section of the control panel. https://toolsmt.com

No comments:

Post a Comment