How To Install and Utilize VirtualMin on a VPS

About Virtualmin

A Webmin module, Virtualmin permits comprehensive management of a number of virtual private servers. It enables you to manage Nginx,Apache, DNS, PHP, MySQL, mailboxes, PostgreSQL, FTP, Subversion/Git repositories, SSL, SSH and more.

In this guide, the GPL (free) edition of Virtualmin will be deployed on a newly created VPS (droplet).

Prerequisites

  • Virtualmin advocates utilization of a freshly deployed server for preventing conflicts and based on the assumption that a new VPS has just been created, all this would be good.
  • You will need to confirm that your VPS possesses a fully qualified domain name for being set up as hostname. “example.com” or “myserver.example.com” is the example of a fully qualified domain name. You need to ensure that the domain name is pointing to the IP address of your server. The command given below can be utilized for checking your present hostname.
hostname -f

And the command given below can be utilized for modifying your hostname if required.

hostname myserver.example.com

Login as Root

Take the IP address of your VPS from the control panel and utilize SSH for logging in as the root.

ssh [email protected]

Downloading the Install Script

An install script is provided by Virtualmin which makes installation quite easy. The command given below can be utilized for downloading the script into your root directory.

wget http://software.virtualmin.com/gpl/scripts/install.sh -O /root/virtualmin-install.sh

On finishing, you will see something as given below:

2013-07-06 11:03:57 (129 KB/s) - `/root/virtualmin-install.sh' saved [45392/45392]

Running the Install Script

The time is now ripe for running the script that we downloaded just now.

sh /root/virtualmin-install.sh

The installation wizard would be started by this. You will be provided a short disclaimer, and the deployment will start as soon as you accept it.

Accessing Virtualmin

Once installing of the install script finishes, Virtualmin can be reached by using the URL given:

https://myserver.example.com:10000/

Here log in using your root username and password. As soon as you log in the “Post-Installation Wizard”, configuration of Virtualmin installation will be started by it.

Post-Installation Wizard

This wizard is quite self-explanatory, some steps have been covered below with some added information.

Memory use

  • Preload Virtualminlibraries? This will enableUI of your Virtualmin to become faster. This can be utilized when UI is going to be used extensively, as the UI is quite usable in its absence.
  • Run email domain lookup server? If you possess spare RAM and quick e-mail holds importance for you, then it should be enabled.

 

Virus scanning

  • Run ClamAV server scanner? In case a lot of emails are received by your server, then it should be enabled.

 

Note: In case Virtualmin is being deployed on a 512MB VPS and ClamAV server scanner has just been enabled using the step above, then you may come across the error given below:

A problem occurred testing the ClamAV server scanner :

A problem occurred testing the ClamAV server scanner :
ERROR: Can't connect to clamd: No such file or directory

----------- SCAN SUMMARY -----------
Infected files: 0
Time: 0.000 sec (0 m 0 s)

This error occurs when your VPS is exhausting RAM… In order to handle the enhanced memory usage, you have the option of upgrading your RAM or adding swap space.

Spam filtering

  • Run SpamAssassin server filter?This has been well explained on the page. It’s quite advantageous to enable it in case a number of emails are received by your server.

Database servers

Based on the assumption that you know what PostgreSQL or MySQL is, this step is quite clear. Enable the one required by you.

In case MySQL is selected, you will be asked to provide your MySQL server’s root password. The next step asks which configuration type should be used by MySQL.

We recommend you to select that one which suits your RAM. By default, right one is selected.

DNS zones

If Virtualmin is being used for managing your DNS zones then here you will need to provide your primary and secondary nameservers.

Passwords

Virtualmin provides two options on how passwords should be saved by it. You are recommended that “Only store hashed passwords” should be selected.

This ensures that in case any uninvited people are able to access your server, thenany personal passwords would be far from their reach.

This completes your post-installation wizard! On top of the page, you will see a big yellow bar with a button saying “Re-check and refresh configuration”.

Press that button for ensuring that all is well.

During this check, if you encounter an error, then follow the instructions provided for resolving it and re-checking your configuration till all errors are resolved.

Some Useful Knowledge

This section provides some useful information for getting around Virtualmin:

Virtual Private Server

Normally a virtual private server (VPS) symbolizes a website, as almost all websites have their own VPS.

Sub-server

It may sound a bit confusing but a sub server is basically only a subdomain.

VirtualminvsWebmin

Since on the top left you can see that you have Webmin and Virtualmin. These are simply different control panels.Webmin can be used for managing the server itself, whereas Virtualmin is used for managing all the VPS and everything related to it.

Documentation

Virtualmin has been documented quite well as every page possess help page of its own and label(the label before the input field) of every optionhas been linked with that option’s explanation.

Virtualmin’s menu structure can be understood through this screenshot.

img78

Setting Up a Virtual Private Server

Now since we went through the wizard and installation, we will start to set up our VPS(s). On left side in navigation, click “Create Virtual Server”.

Type in domain name for which you intend to setup a server. We will be using example.com in this guide.

Provide an administration password that will be the major password to be utilized for managing the VPS. In case the VPS is being managed by yourself, then there’s no need to know this password. For that case, it’s recommended to use a long generated password for additional security.

Through Virtualmin, you can manage account plans and server configuration templates and these modifications can be made under “System Settings”, then “Server Templates” and finally “Account Plans”.

You need to provide an administration username, as if it’s left on automatic, then “example” would be made the username.

You should also look at different options hidden beneath other tabs and change/enable/disable those things that you may want to configure in your VPS.

Next click on “Create Server” and all the steps needed to setup your VPS will be executed by Virtualmin. Also, in case any errors are encountered, then they will be displayed there.

Setting Up a Subdomain

As our VPS is now set, we need to add a subdomain now, for which you need to click on “Create Virtual Server” again.

Check that on top of the page, now there are different options: “Top-level server” (Virtual private server), “Sub-server” (Subdomain), “Alias of example.com” and “Alias of example.com, with own e-mail”.

Click upon “Sub-server” for creating subdomain of “example.com“.

Type in the complete domain name (test.example.com) and then see the options that are provided below it. As soon as you are prepared click on “Create Server”.

See Virtualmin do everything that needs to be done and once it’s done, you will be able to see “test.example.com” as the presently selected VPS.

Setting Up Users

Firstly, we need to ensure that we are there on the top-level server “example.com” and next click “Edit Users”. You can see on top that three options are there for creating users: “Add a user to this server.”, “Batch create users.” and “Add a website FTP access user.”

In case you only want to setup a user with FTP access, then click upon that link, and we will use “Add a user to this server.” The basic step involvesproviding the email address, real name and password of the user. Next, check out different options available carefullyso as to get the perfect setup, once you are done, press “Create”.

Now you can see that your user is being appended to the list and the main user is bold. Also, it tells about the user’s login(it is test.example by default).

For setting up of e-mail addresses, you need to see the link “Edit Mail Aliases” in the menu.

Setting Up Your Databases

Click on the link “Edit Databases” in the menu, and keep in mind that you should correctly set up your VPS. All VPSs have their own databases depending upon your settings.

Each database possesses a “Manage…” link that provides you with an extremely simple database view and permits you for executing queries. Next move on to the “Edit Databases” page and click on “Passwords”.This is the password of your database that was created automatically by Virtualmin.

Navigate to the tab of “Import Database” , where an existing database can be assigned (a database made outside Virtualmin) to the present VPS, advantageous during the creation of databases utilizing a MySQL client of any form.

Lastly, the tab of “Remote hosts” permits you to allow multiple hosts for connecting to your server.It should be left as it is (localhost) and an SSH tunnel should be utilized for logging in to your database server.

Directory Structure

Virtualmin possesses an extremely well organized directory structure. View the scheme that follows:

-- /home/example
    |-- /home/example/awstats
    |-- /home/example/cgi-bin
    |-- /home/example/domains
    |   `-- /home/example/domains/test.example.com
    |       |-- /home/example/domains/test.example.com/awstats
    |       |-- /home/example/domains/test.example.com/cgi-bin
    |       |-- /home/example/domains/test.example.com/homes
    |       |-- /home/example/domains/test.example.com/logs
    |       `-- /home/example/domains/test.example.com/public_html
    |           `-- /home/example/domains/test.example.com/public_html/stats
    |-- /home/example/etc
    |   `-- /home/example/etc/php5
    |-- /home/example/fcgi-bin
    |-- /home/example/homes
    |   `-- /home/example/homes/test
    |       `-- /home/example/homes/test/Maildir
    |           |-- /home/example/homes/test/Maildir/cur
    |           |-- /home/example/homes/test/Maildir/new
    |           `-- /home/example/homes/test/Maildir/tmp
    |-- /home/example/logs
    |-- /home/example/public_html
    |   `-- /home/example/public_html/stats
    `-- /home/example/tmp	

It can be seen that everything has been kept in /home/example and the subdomain is there in/home/example/domains/test.example.com/. All domains possess their own logs directories and by default, Virtualminoffersawstatsthat can be accessed through “http://www.example.com/stats“, except that you didn’t disable it during the VPS creation.

Where Do I Go from Here?

Spend some time checking the settings of Virtualmin. Multiple different things can be used for improving your experience. Also remember to explore the control panel’s Webmin side.

This guide only takes you through Virtualmin’s surface, but there’s much more that can be added or done with it using modules. Even modules are there to set up svn/git repositories.

KB Admin has written 28 articles

Leave a Reply