Webmin Scripts

Installing via Webmin Scripts

Installation via our Webmin Scripts is always the fastest installation path.

In addition to the selected Java Server, the scripts also install Webmin with complete LAMP stack:

  • Webmin Latest
  • Apache
  • MySQL

As with CoffeeCP Templates, you can modify the scripts to suit your needs.

The script below is the same script that is executed via WHMCS (if you are using WHMC) .

You can also download the script and integrate in any way you wish to

 

1. Set the username and password in the script section below:


			REPO_USER='UserName'
REPO_PASS='Password'
			

2. The script takes one agrument "MOD". Values are: tomcat, wildfly, glassfish, and jetty

 


			
#!/bin/bash -e
# CoffeeCP for Webmin
# Cited, Inc. 2017
# Usage Implies Acceptance of Terms
# https://coffeecp.com/terms-of-service.html

#--------------------------------------
# For use on clean VM
#--------------------------------------


#--------------------------------------
# Install Webmin Function
#--------------------------------------
 
function install_webmin(){
	if [ -f /etc/centos-release ]; then
		REPO='rpm'
 
	elif [ -f /etc/debian_version ]; then
		REPO='apt'
 
	elif [ -f /etc/fedora-release ]; then
		REPO='rpm'
 
	elif [ -f /etc/sl-release ]; then
		REPO='rpm'
 
	elif [ -f /etc/os-release ]; then
		DISTRO=$(grep -m 1 ID /etc/os-release | cut -f2 -d= | tr -d '"')
		if [ ${DISTRO} == 'ubuntu' ]; then
			REPO='apt'
		fi
	fi
 
	if [ -z "${REPO}" ]; then
		echo "Error: Failed to detect distribution"; exit 1;
	elif [ "${REPO}" == 'rpm' ]; then
		cat >/etc/yum.repos.d/webmin.repo < /etc/apt/sources.list.d/webmin.list
		wget -qO - http://www.webmin.com/jcameron-key.asc | apt-key add -
		apt-get -y update
		apt-get -y install webmin
	fi
}


#--------------------------------------
# Install Apache HTTP Server Function
#--------------------------------------



	function install_apache(){
	if [ "${REPO}" == 'apt' ]; then
		apt-get -y install apache2
	elif [ "${REPO}" == 'rpm' ]; then
		yum -y install httpd
	fi
}
 


install_webmin;
install_apache;

#--------------------------------------
# Begin Module Installation
#--------------------------------------


#--------------------------------------
# Set creds and repo location
#--------------------------------------
 
REPO_USER='UserName'
REPO_PASS='Password'
REPO_BASE="https://${REPO_USER}:${REPO_PASS}@gogs.coffeecp.com/webmin"
MOD=$1



#--------------------------------------
# RHEL or Debian?
#--------------------------------------

if [ "$(which apt-get 2>/dev/null)" ]; then
	apt-get -y install git
       WEBPATH='share'
elif [ "$(which yum 2>/dev/null)" ]; then
	yum -y install git
       WEBPATH='libexec'
else
	echo 'Error: Unsupported distro'; exit 1;
fi
 
cd ${HOME}
 
#--------------------------------------
# Grab the Instance Modules
#--------------------------------------

git clone ${REPO_BASE}/${MOD}
pushd ${MOD}
git remote update
git fetch
popd 
	


#--------------------------------------
# Install Module
#--------------------------------------

tar -cvzf /tmp/${MOD}.wbm.gz ${MOD}/
rm -rf ${MOD}/
/usr/${WEBPATH}/webmin/install-module.pl /tmp/${MOD}.wbm.gz
rm -f /tmp/${MOD}.wbm.gz
			
			

 

 

Log in (or instruct your customer) to log in to complete the GUI installation.

The user can select any Java version.

 

Up Next: Module Structures

Module Structure