What is Webmin?
Webmin is a web interface that will let you work from the browser to manage the server.
The Virtualmin is a plugin for the Webmin that simplifies the management of the Multiple virtual hosts via the single interface.
Webmin is the cPanel alternative for Ubuntu. It is similar to cPanel or Plesk.
Using the Virtualmin, you can manage the Apache virtual hosts, MySQL Database, DNS entries and the mailbox.
We are going to use a script called Virtualmin GPL.
This script will make your job easy by installing everything which you require to use the Virtualmin including the Webmin.
The script will install the following things on the server.
- LAMP stack (Apache, MySQL, PHP)
- BIND (DNS server)
- Postfix (the mail server.
After installing the Virtualmin along with its component, you have to configure the Webmin through its graphical user interface.
You can also create a new virtual host with Virtualmin.
After completing this Virtualmin tutorial, you will be able to create any number of user account and host as many as the website on the server.
You have to use a new server for this purpose. Don't implement these procedures on the existing server which is running the Apache, MySQL and PHP.
You will require a new Ubuntu 16.04 server with 1 GB of RAM. You have to configure that ubuntu server according to this Ubuntu initial server setup guide.
A Fully Qualified Domain Name (FQDN) pointing to your server.
Custom name servers for your domain. example, it can be ns1.mydomain.com and ns2.mydomain.com.
Read the complete ubuntu server 16.04 Webmin tutorial.
Setting up the HostName and FQDN
To make the Virtualmin work properly, you have to setup the hostname and FQDN properly.
You can do this by editing the following file. /etc/hostname and /etc/hosts.
Also, update the DNS settings along with the change. So, your DNS lookup will be resolved properly.
You have to log in to the server as the non-root user and then update the package index.
$ sudo apt-get update
After that, install any required packages and update any packages which are not yet updated.
You have to start with a stable and updated system.
$ sudo apt-get dist-upgrade -y
Then, you have to match up the hostname with FQDN that you have pointed to the server.
To see the current server hostname, use the below command.
$ hostname -f
You have to change the hostname. To do that, open the /etc/hostname file using nano editor.
$ sudo nano /etc/hostname
In that file, delete the current hostname and add your hostname.
Use the hostname only and not the entire FQDN.
After that, save the file and exit the editor.
Then, you have to add the hostname and FQDN in the /etc/hosts file.
Open the file using nano editor
$ sudo nano /etc/hosts
The file will open and in that file, you have to make changes in the 127.0.0.1 to use FQDN hostname.
/etc/hosts 127.0.1.1 your_hostname.your_domain.com your_hostname 127.0.0.1 localhost ...
You should replace the hostname and your domain name with your own hostname and FQDN.
After that, save and close the file.
Then, check whether the name server has been changed properly.
To see that, first reboot your server using the below command.
$ sudo reboot
Now, you can see the hostname in the terminal prompt.
To check whether the FQDN was set correctly, use the hostname command.
$ hostname -f
You will get the following output
If you did not get above output, then you have to check the configuration and the changes you have made.
After that reboot the server.
Then, edit the server configuration file to make it use the DNS server to resolve the domain name.
Open the configuration file using the nano editor.
$ sudo nano /etc/network/interfaces.d/50-cloud-init.cfg
Add the IP address in the configuration file as mentioned below.
/etc/network/interfaces.d/50-cloud-init.cfg dns-nameservers 188.8.131.52 184.108.40.206
Change that into
/etc/network/interfaces.d/50-cloud-init.cfg dns-nameservers 220.127.116.11 18.104.22.168 127.0.0.1
You should add the space before the IP address. Then save and close the file.
Here, you have done with setting up the hostname, FQDN and network configuration.
Now, you have to install the Virtualmin.
First, install Virtualmin ubuntu. To install the Virtualmin, first, you have to download and run the Virtualmin script.
It will install the Virtualmin, Webmin, BIND, Postfix and LAMP stack.
Use the below command to download the script.
$ wget https://software.virtualmin.com/gpl/scripts/install.sh
Before running the script, you can open the script and view it.
$ sudo nano ./install.sh
After viewing the script and if it is ok for you, then use Virtualmin install ubuntu command to install Webmin Ubuntu server and it's prerequisites.
$ sudo /bin/sh ./install.sh
You will be prompted and warned about the current system and data and compatibility. Press Y and press enter to continue.
The script will run for a small time. It is because it will install various software and packages.
Once all the process regarding installation got over, you can set the root password.
Configure the Webmin Root Password
Virtualmin is the plugin for the Webmin. By default, Webmin uses the same root password of the server.
If you are logging in through SSH, then you may not feel comfortable using the root password in the browser, you can set a different password for the Webmin.
This will not change the root password. We will instruct the Webmin to use a new password instead of the root password.
Use the below command to change the Webmin's root password
$ sudo /usr/share/webmin/changepass.pl /etc/webmin root newpassword
You should replace the newpassword with your strong password.
Then, restart the Webmin service to make the changes to take effect.
$ sudo systemctl restart webmin
The next task is to configure the Webmin using the front-end.
Webmin Post Installation Wizard
You can configure the Webmin using the Post Installation Wizard.
First, open your web browser and enter the server IP and port to access the post-installation wizard.
You can use https://your_server_ip:10000 or you can use FQDN with the port number to access them.
== When you open the wizard, the browser will tell you that your connection is not secure or your connection is not private.==
This is because the Webmin uses the self-signed SSL certificate. You can also use the Let's Encrypt SSL certificate to solve this issue.
Log in as the root user with your newly created password for the Webmin login in Webmin port.
Once you log in, you will see the setup and click on next to complete the setup.
Do the following.
For Memory use screen, choose No for the Preload Virtualmin Libraries.
This is because you don't need the Virtualmin UI to run all the time.
For Run Email Domain Lookup server, choose Yes. It will enable the faster email processing.
Then Press Next to continue.
The Next will be Virus Scanning Screen. You have to choose No for the Run ClamAV Server Scanner. So, the RAM memory won't be consumed more.
Then in the Spam Filtering, Choose No for the Run SpamAssassin server filter and press Next to continue.
Hereafter you have to configure the Database servers.
In the first screen (Database server screen), you have to choose Yes for Run MySQL Database server and choose no for Run PostgreSQL server. Then Press Next to continue.
In the second screen (MySQL Password Screen), You should enter a password for the root. And the password should be different from the root password you set for Webmin.
In the third screen (MySQL Database size screen), In the RAM option, you have to choose according to your server RAM.
After that, you have to enter the primary and secondary name servers.
If you have not configured them, you have to choose the skip check for resolvability box. It will avoid getting error messages.
In the next step, you have to configure the password storage mode screen.
In that, there are two options. If you want to store the password for the recovery purpose, you have to choose the Store plaintext passwords or else you can choose the Only store hashed passwords.
Then click on Next. Now you will see the screen "All Done". Then click next.
At last, you can see the virtual Webmin dashboard.
If the Virtualmin has the new theme, you will get the notification for that.
You can select the new theme by clicking on Switch Theme button.
The page will be reloaded.
You can't see the page properly. To view the page properly, you have to reload the page.
A message will be displayed and it will state "Virtualmin's configuration has not been checked.
To check the configuration, click on "Re-check and refresh configuration" button.
If you see any error, fix it.
That's all. Your server is configured.
Now, let us create a virtual server using the Webmin interface.
Creating a New Virtual Server
How to use Webmin?
Here I am going to explain to you how to use Webmin ubuntu.
You can create a new virtual server using Virtualmin. Also, you can create a new user to manage that server using Virtualmin.
First, click on the Virtualmin tab and then click on the Create Virtual server.
Then you will get Create Virtual Server Wizard.
Enter the domain name, Description and Administrator password. After that, click on create the server.
That's all. You have created virtual server and user. You can start using them.
If you want to uninstall Virtualmin, refer the virtualmin documentation.
You have learned How to install and configure the Virtualmin on Ubuntu 16.04.
You also learned How to create the virtual server and user for that server.
If you have doubts, ask them in the comment. We will revert you back.
Make sure, that you are the signup for the upcoming tutorial.