Server Setup
OS Setup
I have experience with Ubuntu and the community support is also quite good.. so we will use Ubunutu. We'll use Virtual min for server management.
Cloud provider is providing limited editions of Ubuntu and as of today, Virtual min installer works best with Ubuntu 16.04.
However, Ubuntu 16.04 is quite old and not preferred because it comes with default version of PHP 7.0. For HSM, we need a min of PHP 7.2. So, we'll have to overcome this.
Prepare for Virtual min
- Change password of the default user with command
passwd
- Make sure to change the password of the root user also.. Switch to root with
su
and change password - Add the default user to sudo group also with command
user mod -aG sudo <user>
- Change the hostname with command
hostnamectl set-hostname <new_hostname>
- Change it in the
/etc/hosts
file also. - Make sure that the hostname are resolvable from external DNS
Install Virtualmin
After all the preparations are done.. time to install virtual min. Install with the following commands:
wget http://software.virtualmin.com/gpl/scripts/install.sh
sudo /bin/sh install.sh
Note: Install. Dont configure yet..
Upgrade Ubuntu
We dont want to stay with version 16.04. We should atleast move to 18.04 or 20.04.
Note: Move only to LTS versions.
Prepare for Upgrade
Upgrade over SSH may not be easy.. So we should prepare for upgrade..
Take a coffee and as it may take some time and its very important that you dont leave the screen un-attended (sometimes we saw that due to in-activity, the SSH terminal was disconnected in the middle of ugrade)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install screen
Perform Upgrade
Upgrade with following commands:
do-release-upgrade
Configure Virtual min
Now that the server is upgraded to the version we want, and Virtual min is also installed... we can proceed to configure the virtual min.
Login to the Virtual min.. It should by default start with configuraiton screen.
- Do the necessary configuration.
- Upgrade Virtual min and update all packages as suggested
- Add all IPs as Virtual IPs from Network intefrace configuration
Restore Backup
If there is any previous backups, restore them.
Copy the backups to server with scp command : scp <folder> <user>@server:/home/<path>
Post Install Setups
After the install is done, some more optional software may be required. Install these...
sudo apt-get install default-jre
sudo apt-get install curl
sudo apt-get install composer
sudo apt-get install php-curl
sudo service apache2 restart
After all the software is installed and the backup is also restored... make sure we update certificates. - Check the SSL certificates are restored - Copy the main server certificate to other services like: Postfix, Dovecot, Usermin, Virtualmin etc.
Troubleshooting
Even after following everything, something will evenutally not work...
Testing and Validation
Do some smoke tests
- Check in HanuGCM app. Do a simple ping to see if everything is working fine.
- Check in one of the post utility apps. Query, approve and reject posts