Webmin + Virtualmin + CSF + PHP 7.2

by jwpegram
40 deployments · 7 still active · last rev. 4 months ago

This script will deploy Webmin, Virtualmin minimal (no Email server) and ConfigServer Firewall (CSF) in place of FirewallD. PHP 7.2 is also added along with updating all the system packages.

Note: Please open a console as there is point where user input is needed.

Recommend rebooting after the script finishes.

Compatible with: Ubuntu 16.04 LTS
						#!/bin/bash
# This block defines the variables the user of the script needs to input
# when deploying using this script.
#
#
#<UDF name="hostname" label="The hostname for the new Linode.">
# HOSTNAME=
#

echo "###################################################################################"
echo "Please be Patient: Installation will start now....... It may take some time :)"
echo "###################################################################################"

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C

apt-get update
apt-get --with-new-pkgs upgrade -y

# Setup the hostname
hostname $HOSTNAME

# AppArmor is a security extension (similar to SELinux) that should provide extended 
# security. You don't really need it to configure a secure system, and it usually causes more 
# problems than it advantages. Therefore, I disable it.
service apparmor stop
update-rc.d -f apparmor remove 
apt-get remove -y apparmor apparmor-utils

# Install virtualmin
wget http://software.virtualmin.com/gpl/scripts/install.sh -O /root/virtualmin-install.sh
sh /root/virtualmin-install.sh -m -y -n $HOSTNAME

# Add the ppa repo for PHP 7
apt-get install -y software-properties-common
add-apt-repository ppa:ondrej/php -y
apt-get update -y 

# I prefer CSF so remove FirewallD
apt autoremove firewalld -y

#Download CSF
cd /root; wget https://download.configserver.com/csf.tgz

#Extract CSF
tar -xzf csf.tgz

#Install CSF
cd csf
sh install.sh

# Post installation updates
# This should add php7.1 and php7.2
apt-get update
apt-get --with-new-pkgs upgrade -y

echo "Installation complete - recommend restarting the server"