#! /bin/sh # install-webmin (Bourne shell script) -- Install webmin and optionally virtualmin # # e.g. to install both automatically (warning: installs postfix): # (cd src/tools/${DISTRO,}/sources.$DISTRO_CODENAME && sudo ../install-webmin -yv) self=`basename $0` allowed_options=ysv # == command-line handling == # defaults install_virtualmin=n skip_update=n # process options set -e eval set -- `getopt --shell=sh -n $self +$allowed_options "$@"` set +e # getopt would have already reported the error while [ x"$1" != x-- ] ; do case "$1" in -v) install_virtualmin=y ;; -s) skip_update=y ;; -y) aptitude_opts=-y ;; esac shift # get rid of the option (or its arg if the inner shift already got rid it) done shift # get rid of the "--" # sanity checking # process remaining args # == preparation == if ! [ -f webmin.list -a -f ../sources.3rd-party/RPM-GPG-KEY-virtualmin.asc -a -f ../sources.3rd-party/RPM-GPG-KEY-webmin.asc ] ; then echo "${self}: essential file(s) missing. Run from tools/{debian,ubuntu}/sources.whatever" >&2 exit 2 fi set -e # == processing == if [ $install_virtualmin = y ] ; then aptitude install $aptitude_opts awstats libapache2-mod-fcgid postfix # Don't disable the module, but prevent it being used for .php files by default # see ../web/apache/non-fcgid_site.conf.snippet if [ -f /etc/apache2/mods-enabled/php5.conf ] ; then mv /etc/apache2/mods-enabled/php5.conf /etc/apache2/mods-enabled/php5.conf.dist fi service apache2 restart # virtualmin setup complains if FCGID mode is chosen but suexec isn't runnable touch /usr/local/bin/suexec chmod a+x /usr/local/bin/suexec fi # http://software.virtualmin.com/lib/RPM-GPG-KEY-webmin apt-key add ../sources.3rd-party/RPM-GPG-KEY-webmin.asc apt-key add ../sources.3rd-party/RPM-GPG-KEY-virtualmin.asc install -m 644 webmin.list /etc/apt/sources.list.d/ if [ $skip_update != y ] ; then aptitude update fi aptitude install $aptitude_opts webmin usermin if [ $install_virtualmin = y ] ; then # Even though virtualmin-base requires webmin-virtual-server, the former # won't install successfully unless the latter is already present aptitude install $aptitude_opts webmin-virtual-server virtualmin-base fi