Cartika

Welcome, Guest Login

Support Center

Installing and configuring webmin + virtualmin

Last Updated: Sep 28, 2017 04:03AM EDT
Virtualmin + Webmin
Virtualmin is a Webmin module which allows for extensive management of (multiple) virtual private servers. You will be able to manage Apache, Nginx, PHP, DNS, MySQL, PostgreSQL, mailboxes, FTP, SSH, SSL, Subversion/Git repositories and many more. NOTE: Virtualmin GPL is a free and​ If a client Googles some functions which are available in his virtualmin its because we are using the free version he can upgrade anytime by buying license if he chooses to.  Since its open source hosting control panel for Linux machine based on the well-known web based application named Webmin. Virtualmin is a uniquely web server administration tool. It is unmatched in features and ease of use. It offers a wide range of tools for hosting providers, web developers, web designers, and end users. There are two different editions in which we can get our Virtualmin application running, one is under Professional in which we'll need to buy license and another is under GPL edition which is free and open source.

Note: Installing webmin and virtualmin or usermin separately is a BAD idea and always comes back as to compatibilty issues and conflicts.

In this example, we will be installing the GPL (free) edition of Virtualmin on a freshly created VPS (acmeshelving).
Prerequisites
  • Virtualmin highly recommends using a freshly installed server to prevent conflicts, assuming you just created a new VPS, this should be all good.
  • Confirm that your VPS has a fully qualified domain name set as hostname. An example of a fully qualified domain name is "myserver.example.com" or "example.com". Make sure that the domain name points to your server's IP address. Use the following command to check your current hostname.
hostname -f
And use the following command to change your hostname if necessary.
hostname myserver.example.com

Do note that virtualmin install script will ask for the hostname and that hostname can not be changed or modified later so please be careful and ask client for a hostname before we proceed further also if the client is using a main site something like acmeshelving.com we can use the hostname in the bounds of something like server.acmeshelving.com and even though its not setup yet or pointing to our dns you can proceed with the installation and ask the client to create an A record at his current host for server.acmeshelving.com and point it to IP e.g. 123.45.67.89 – that can also be done at a later date and time but the point is the hostname is not changeable so give it properly during install.
 
Login as Root
Grab the IP address of your droplet from the ONAPP control panel and use SSH to login as root.
ssh root@123.45.67.89
  
Make sure wget and perl is installed to run this script:

yum -y update
yum –y install wget perl
 
Downloading the Install Script:

Note: Currently this script supports CentOS7 , CentOS6 , Ubuntu14+ & Debian7+
But there are alot of bugs we found on ubuntu and debian regarding the functionality in production env. and we cant recommend it for our clients as of now because of the slow response and other bugs while adding sites and performing daily routine functions.


Use the following command to download the script to your root directory. (if the script link isnt working contact L3 or Abbas) 
wget http://67.22.128.179/dl/webmin/install.sh

You now need to setup chmod +x (execute permissions) on the script itself
chmod +x install.sh
 
Before we proceed further and continue with the installation you need to make sure what installation requirements the server came up with e.g. specific php and mysql version. Note that by default virtual min will install PHP7 + MYSQL5.1 if you need different versions then you need to enable epel repo and install your custom php and mysql version and the script will pickup those and wont over-write the default versions e.g. in our case we had to install php5.6 and mysq5.5+
Once those are installed we can continue Running the Install Script
Now it's time to run the script we just downloaded.
sh install.sh
This will start the installation wizard. It will start with a short disclaimer, after accepting it the installation will begin.

Accessing Virtualmin
When the install script has finished installing, you can reach Virtualmin with the following URL:
https://myserver.example.com:10000/  OR if the DNS Propagation is still not done you can use IP:10000 e.g.  https://123.45.67.89:10000/

There you can login with your root username and password. Once you are logged in the "Post-Installation Wizard", it will begin to configure your Virtualmin installation.
Post-Installation Wizard
This wizard is pretty self-explanatory, we'll cover some of the steps with some additional information.
Memory use
  • Preload Virtualmin libraries? This will make your Virtualmin UI faster, use this when you are going to use the UI extensively, the UI is very usable without it.
  • Run email domain lookup server? If fast e-mail is important to you and you have the spare RAM then it's recommended to enable this.
Virus scanning
  • Run ClamAV server scanner? This is explained pretty well on the page, if your server receives a lot of e-mails then it's beneficial to enable it.
Note: If you are installing Virtualmin on a 512MB VPS and you have just enabled ClamAV server scanner in the step above, then it is very likely that you run accros this error:
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)
              
The reason why you get this error is because your VPS is running out of RAM... you can choose to upgrade your RAM or add swap space to handle the increased memory usage.
You need call in ABBAS or WAQAS or Oleh from L3 if you cant proceed with the ClamAV or if its giving any errors relating to CLAMAV during post setup process.

Spam filtering
  • Run SpamAssassin server filter?

    Again this is explained pretty well on the page, if your server receives a lot of e-mails then it's beneficial to enable it.
Database servers
This step should be pretty clear assuming you know what MySQL or PostgreSQL is. Enable whichever one you need.
If you picked MySQL, the next step will ask you to enter a root password for your MySQL server. The step after that asks what type of configuration MySQL should use.
It's recommended to pick the one that matches your RAM (I believe it selects the right one by default).
DNS zones
If you plan on managing your DNS zones with Virtualmin then enter your primary and secondary nameservers here.
Passwords
Virtualmin gives you two choices on how it should save passwords. It is highly recommended to select "Only store hashed passwords".
This way if any uninvited people get into your server they won't be able to retrieve any personal passwords.
All right, you've completed the post-installation wizard! You might see a big yellow bar on the top of the page with a button that says "Re-check and refresh configuration".
It's recommended to press that button just to make sure everything is well.
If you run into an error during that check, follow the instructions to resolve it and re-check your configuration until all errors are gone.
Some Useful Knowledge
Here's some information which will help you get around Virtualmin:
Virtual Private Server
A virtual private server (usually) represents a website, typically every website has it's own virtual private server.
Sub-server
A sub-server sounds confusing but it's basically a subdomain.
Virtualmin vs Webmin
As you can see on the top left, you have Virtualmin and Webmin. These are different control panels, Virtualmin is where you manage all the VPS and anything related to that. Webmin is where you manage the server itself.

Documentation
Virtualmin is not very well documented, but in itself every page has it's own help page and every option's label (the label in front of the input field) is linked to an explanation of that option.
https://doxfer.webmin.com/Webmin/Main_Page
https://doxfer.webmin.com/Webmin/Virtualmin_Features
https://doxfer.webmin.com/Webmin/Webmin_Modules

Here's a screenshot explaining the menu structure of Virtualmin.
http://ca-files1.cologlobal.com/public.php?service=files&t=1m3sRh07Q0dMjBv
 
Setting Up a Virtual Private Server
Now that we've gone through the installation and wizard, we can start setting up our virtual private server(s). Click "Create Virtual Server" in the navigation on the left side.
Enter the domain name you want to setup a server for, in this tutorial we will use: example.com.
Enter an administration password which will become the main password to manage the virtual private server. If you are managing the virtual private server by yourself then you don't really need to know this password. In that case, I suggest using a long generated password for extra security.
Virtualmin allows you to manage server configuration templates and account plans, these can be modified under "System Settings" and then "Server Templates" and "Account Plans".
You can specify an administration username, leaving it on automatic would make "example" the username.
Have a look at the options hidden underneath the other tabs and enable/disable/change anything you'd like to configure your virtual private server.
Now click "Create Server", Virtualmin will execute the steps needed to setup your virtual private server, if any errors occur, it will display them there.
Setting Up a Subdomain
Now that we've setup our virtual private server, it's time to add a subdomain, click on "Create Virtual Server" again.
Notice how different options are now on the top of the page: "Top-level server" (Virtual private server), "Sub-server" (Subdomain), "Alias of example.com" and "Alias of example.com, with own e-mail".
Click on "Sub-server" to create a subdomain of "example.com".
Fill in the full domain name (test.example.com) and go through the options below it, once you are ready click "Create Server".
Watch Virtualmin do what it needs to do and after it's all done, you should see "test.example.com" as the currently selected virtual private server.
Setting Up Users
First of all, let's make sure we are on the top-level server "example.com" and then click on "Edit Users". On the top, you see you have three options of creating users: "Add a user to this server.", "Batch create users." and "Add a website FTP access user."
If you are only looking to setup a user that has FTP access then click that link, we will go with "Add a user to this server.". The first step is to enter the user's email address, real name and password. Then, carefully look at the other options available to get your ideal setup, when you're done press "Create".
You will now see your user being added to the list, the main user is bold. It also tells you what the user's login is (by default this is something like test.example).
For further setup of e-mail addresses see the "Edit Mail Aliases" link in the menu.

Installing phpmyadmin

Once a new site is created (or as virtualmin calls it VirtualServer) you need to goto Install scripts section as shown from http://ca-files1.cologlobal.com/public.php?service=files&t=jE9dUieTakXyJLH
The list of scripts available are:
                WordPress         4.8.1      A semantic personal publishing platform with a focus on aesthetics, web standards, and usability.             
Commerce
                WHMCS                            WHMCS is an all-in-one client management, billing & support solution for online businesses.      
Database
                phpMyAdmin                  A browser-based MySQL database management interface.     
                phpPgAdmin    5.1          A browser-based PostgreSQL database management interface.           
Development
                Django                Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.          
Email
                RoundCube                    RoundCube Webmail is a browser-based multilingual IMAP client with an application-like user interface.  
                SquirrelMail       1.4.22 (Stable) SquirrelMail is a standards-based webmail package written in PHP
 
Note: If you are installing scripts – make sure you choose default directory and it will be installed in example.com/phpmyadmin/ only then it can be made available using IP e.g. 123.45.67.89/phpmyadmin/ otherwise it will break php versions.
 

Setting Up Your Databases
Click the "Edit Databases" link in the menu, remember to set your virtual private server correctly. Depending on your settings, every virtual private server has its own database (or multiple).
Every database has a "Manage..." link which gives you a very simple view of the database and allows you to execute queries. Now go back to the "Edit Databases" page and click "Passwords", here is your database's password which was automatically generated by Virtualmin.
Moving on to the "Import Database" tab you can assign an existing database (a database created outside of Virtualmin) to the current virtual private server, useful for when you created databases using a MySQL client of some form.
Last but not least, the "Remote hosts" tab allows you to provide multiple hosts to connect to your server, it's recommended to leave it as is (localhost) and use an SSH tunnel to login to your database server.
Directory Structure
Virtualmin has a very nicely organised directory structure. See the following scheme.
`-- /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     
              
As you can see, everything is put in /home/example and our subdomain can be found in /home/example/domains/test.example.com/. Every domain has its own logs directory and Virtualmin comes with awstats by default and is accessible through "http://www.example.com/stats", unless you disabled this during the creation of the virtual private server.
 
 
 

Contact Us

sales@cartika.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete