Quick Debian Server Provisioning Script

By | January 26, 2011

Here is a quick little bash script that I use to initially provision Debian LAMP servers from a fresh install. This should setup PHP with all the whistles and bells, a whole handful of utilities as well as install webmin for you.

Nothing to complicated here, just a quick little script to speed up your life.

clear
clear
echo 'Debian Provisioning Script'
echo '01-12-2011 TNL Total Solutions'
echo 'http://www.tnlsoft.com'
echo ''
read -p "Press any key to begin provisioning"
clear
echo 'Preparing server for provisioning...'
apt-get update
apt-get upgrade
apt-get dist-upgrade
echo ''
echo 'All existing packaged updated'
echo ''
read -p "Press any key to begin installing NEW packages"
clear
echo 'Installing Required Packagesn'
apt-get install apache2 apache2-utils apache2.2-common bind9 bind9-host bind9utils curl gawk denyhosts sendmail ftp proftpd gzip iptables lftp libapache2-mod-perl2	libapache2-mod-php5 libapache2-reload-perl libcurl3 libxml2 lynx mysql-client mysql-common mysql-server ntp ntpdate openssh-client openssh-server openssl perl perl-base perl-modules php-pear php5 php5-cli php5-common php5-curl php5-dev php5-gd php5-geoip php5-imagick php5-imap php5-ldap php5-mcrypt php5-mhash php5-mysql php5-odbc php5-xmlrpc proftpd python rdate samba samba-common sendmail sendmail-base sendmail-bin sendmail-cf sensible-mda subversion tar unzip wget makeself zip libghc6-openal-dev libsage2 libsdl-gfx1.2-4 mingw32 mingw32-binutils mingw32-runtime
echo ''
echo ''
echo 'Creating Skel'
mkdir /etc/skel/www
mkdir /etc/skel/logs
mkdir /etc/skel/www/cgi-bin


cd /var/www
rm index.html
wget http://www.tnlsoft.com/debian/index.txt
mv index.txt index.php
chmod 0777 index.php
cp index.php /etc/skel/www

echo ''
echo ''

echo 'Reconfiguring PHP 5'
cd /etc/php5/apache2
mv php.ini php.ini.old
wget http://www.tnlsoft.com/debian/php.ini

echo ''
echo ''
echo 'Installing PEAR Packages'
pear install Mail
pear install Net_SMTP

echo ''
echo ''
echo 'Enabling Apache Mods'
a2enmod dav_fs
a2enmod dav
a2enmod rewrite


echo ''
echo ''
echo 'Restarting Apache'
/etc/init.d/apache2 restart

echo ''
echo ''
echo 'Installing Webminn'
cd /root
wget http://downloads.sourceforge.net/project/webadmin/webmin/1.530/webmin-1.530.tar.gz
tar -xvf webmin-1.530.tar.gz
cd webmin-1.530
./setup.sh
echo 'Done!'

Grab it here: http://dev.tnlsoft.com/download/debian_provision.zip

Related Posts

2 thoughts on “Quick Debian Server Provisioning Script

  1. Pingback: Install ISPConfig on Debian Quickly « Shafe Shifter

  2. Pingback: Installing ISPConfig Quickly | TNL Development Blog

Leave a Reply

Your email address will not be published. Required fields are marked *