2014 06 03 17 17 47 Sirolo

Monte Conero 1920x512

Monte Conero 1920x512

Setting up an AWS instance with Ubuntu 16.04 LTS and virtualmin

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

{jcomments off}

Part 3: Download and Install Virtualmin

Introduction

In this article I set up an AWS EC2 Instance from scratch to run VirtualMin, an open-source virtual server management tool. While Virtumin can be set up on an in-use server, it requires a lot of reconfiguration so it is simpler to set up a new server and proceed from there. At the end of this article we shall have a clean install of VirtualMin ready to accept new websites. This is part 3 where we download and install Virtualmin.

The article is broken into 4 main steps:

  1. Set up an AWS instance with sufficient EBS storage space
  2. Prepare Ubuntu LTS to accept VirtualMin
  3. Download and install VirtualMin This page
  4. Prepare VirtualMin to run websites

The article is based on various pages by numerous authors who I thank for their invaluable insights, as well as my own experiences. Any errors are most likely mine. I give no guarantee that what you find in these pages will work on your setup - as usual YMMV.

In this series of articles I shall be using an FQDN of myserver.example.com and a user called myuser. The server will reside at the fictitious public ip 12.34.56.78. Make sure you substitute your own FQDN, user and ip where necessary - the example values given will not work.


Usually, getting started with Virtualmin can be done with a few simple steps, using the automated install script. The install script will setup your package manager, apt-get, and then download the packages as well as all of the necessary dependencies for running Virtualmin.

Never run the install.sh script to upgrade or renew an existing Virtualmin system! The "virtualmin change-license" command is designed for that purpose. Check the license FAQ for details.

Download the Virtualmin Install Script

The easiest way to get the install script onto your server, is to login to your server and use wget or curl. For example:

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

Run the Install Script and Configure Virtualmin

Execute the downloaded install script using a command like the following:

  • sudo /bin/sh install.sh

 

  • Welcome to the Virtualmin GPL installer, version 6.0.5
  •  
  •  This script must be run on a freshly installed supported OS. It does not
     perform updates or upgrades (use your system package manager) or license
     changes (use the "virtualmin change-license" command).
  •  
  •  The systems currently supported by install.sh are:
  •  
  •    CentOS/RHEL Linux 6 and 7 on x86_64
  •    Debian 7, 8, and 9, on i386 and amd64
  •  
  •  
  •    Ubuntu 14.04 LTS and 16.04 LTS, on i386 and amd64
  •  
  •  If your OS/version/arch is not listed, installation will fail. More
     details about the systems supported by the script can be found here:
  •  
  •    http://www.virtualmin.com/os-support
  •  
  •  The selected package bundle is LAMP and the size of install is
     full. It will require up to 650 MB of disk space.
  •  
  •  Exit and re-run this script with --help flag to see available options.
  •  
  • Continue? (y/n) y
    [INFO] Started installation log in /root/virtualmin-install.log
  •  
  • ▣□□ Phase 1 of 3: Setup
    Downloading repository metadata                                         [  ✔  ]
    Enabling universe repositories, if not already available                [  ✔  ]
    Disabling cdrom: repositories                                           [  ✔  ]
    Cleaning out old metadata                                               [  ✔  ]
    Downloading RPM-GPG-KEY-virtualmin-6                                    [  ✔  ]
    Downloading RPM-GPG-KEY-webmin                                          [  ✔  ]
    Installing Virtualmin 6 key                                             [  ✔  ]
    Installing Webmin key                                                   [  ✔  ]
    Updating apt metadata                                                   [  ✔  ]
    Removing non-standard Webmin package, if installed                      [  ✔  ]
  •  
  • ▣▣□ Phase 2 of 3: Installation
    Installing Webmin                                                       [  ✔  ]
    Installing Usermin                                                      [  ✔  ]
    Installing fail2ban                                                     [  ✔  ]
    Removing nginx (if installed) before LAMP installation.                 [  ✔  ]
    Removing unneeded packages that could confict with LAMP stack.          [  ✔  ]
    Installing postfix                                                      [  ✔  ]
    Installing virtualmin-lamp-stack                                        [  ✔  ]
    Installing Virtualmin and plugins                                       [  ✔  ]
    25 Aug 14:47:39 ntpdate[8684]: adjust time server 91.189.89.198 offset 0.003663 sec

  • Installing updates to Virtualmin-related packages                       [  ✔  ]
  •  
  • ▣▣▣ Phase 3 of 3: Configuration
    [1/23] Configuring AWStats                                              [  ✔  ]
    [2/23] Configuring Apache                                               [  ✔  ]
    [3/23] Configuring Bind                                                 [  ✔  ]
    [4/23] Configuring ClamAV                                               [  ✔  ]
    [5/23] Configuring Dovecot                                              [  ✔  ]
    [6/23] Configuring Firewalld                                            [  ✔  ]
    [7/23] Configuring MySQL                                                [  ✔  ]
    [8/23] Configuring NTP                                                  [  ✔  ]
    [9/23] Configuring Net                                                  [  ✔  ]
    [10/23] Configuring ProFTPd                                             [  ✔  ]
    [11/23] Configuring Procmail                                            [  ✔  ]
    [12/23] Configuring Quotas                                              [  ✔  ]
    [13/23] Configuring SASL                                                [  ✔  ]
    [14/23] Configuring Shells                                              [  ✔  ]
    [15/23] Configuring SpamAssassin                                        [  ✔  ]
    [16/23] Configuring Status                                              [  ✔  ]
    [17/23] Configuring Upgrade                                             [  ✔  ]
    [18/23] Configuring Usermin                                             [  ✔  ]
    [19/23] Configuring Webalizer                                           [  ✔  ]
    [20/23] Configuring Webmin                                              [  ✔  ]
    [21/23] Configuring Fail2banFirewalld                                   [  ✔  ]
    [22/23] Configuring Postfix                                             [  ✔  ]
    [23/23] Configuring Virtualmin                                          [  ✔  ]
    ▣▣▣ Cleaning up
  •  
  • [SUCCESS] Installation Complete!
    [SUCCESS] If there were no errors above, Virtualmin should be ready
    [SUCCESS] to configure at https://myserver.example.com:10000.

After a few minutes, your system should have everything it needs to provide a full-feature virtual web hosting environment. Now login to Virtualmin by browsing to port 10000 on the address of your server using the HTTPS protocol. Ignore the SSL certificate validation error (the SSL certificate is a self-signed one after initial installation, but can be replaced with a valid certificate after initial configuration is complete).

Follow the steps in the post-install wizard to setup Virtualmin to suit your environment and needs. Virtualmin will check the configuration of the system and validate some server settings to insure your system is ready for service.

  • Preload Virtualmin libraries? Yes
  • Run email domain lookup server? Yes
  • Run ClamAV server scanner? Yes
  • Run SpamAssassin server filter? Yes
  • Run MySQL database server? Yes
  • Run PostgreSQL database server? No
  • Set MySQL password yourMySqlpassword
  • MySQL configuration size Huge system (2G or more) on which MySQL is heavily used
  • Primary nameserver myserver.example.com
  • Password storage mode Only store hashed passwords

Now Re-check and refresh the configuration

There will be an error because we are not set up for Bind. Go to VirtualminSystem SettingsFeatures and Plugins and turn off BIND DNS domain, since we shall be using AWS Route 53 for this.

Now go to VirtualminSystem SettingsVirtualmin Configuration and set Default IP address for DNS records to our Elastic IP address: 12.34.56.78. Scroll to the bottom of the page and save.

Now go to VirtualminSystem SettingsRe.check Configuration where it should tell us that the system is ready for use by Virtualmin.

{jcomments on}