Install webmin using bash on Ubuntu 11.10


webmin is a web-based tool for administering UNIX and UNIX based systems such as Ubuntu. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more.

We can automate the installation of webmin using a bash script. Here are the steps:

  1. Create a new folder to store bash scripts

    $ cd <path-to-scripts-parent-folder>
    $ sudo mkdir <scripts-folder>
    $ cd <scripts-folder>

  2. Create a new bash script file and copy the webmin_install script content provided further down the page

    $ sudo nano webmin_install.sh

  3. Grant execute privilege to webmin_install.sh

    $ sudo su
    # chmod +x webmin_install.sh

  4. Execute webmin_install.sh bash script to kick off the webmin installation

    # ./webmin_install.sh

  5. After the installation finishes, open a web browser and enter the following URL:

    https://localhost:10000

  6. Log in as a user with sudo privileges.

webmin_install.sh bash script file content:

#!/bin/bash
# webmin install
# update package list
echo ‘################’
echo ‘update the package list ‘
echo ‘################’
apt-get update
# install webmin pre-requisites
echo ‘###############’
echo ‘ Install pre-requisites ‘
echo ‘###############’
apt-get install -y perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python
#update package list to include webmin
echo ‘############################’
echo ‘   Update package list to include webmin ‘
echo ‘############################’
echo deb http://download.webmin.com/download/repository sarge contrib | sudo tee -a /etc/apt/sources.list
echo deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib | sudo tee -a /etc/apt/sources.list
#install GPG key
echo ‘############’
echo ‘  Install GPG key  ‘
echo ‘############’
cd /root
wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
#download and install webmin
echo ‘############’
echo ‘   Install webmin  ‘
echo ‘############’
apt-get update
apt-get install -y webmin
echo ‘ webmin installation completed’

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s