Debian Nginx 0.7/PHP 5.3/MySQL 5.1 Install Guide

This script is based of 21Andy’s work, and Lowendbox’s work.

Please note that this script has been deprecated in favor of Xeoncross’s updated Lowendscript. This post remains here just for historical purposes.

Link: https://github.com/Xeoncross/lowendscript

The main differences compared to Andy’s and Lowendbox’s work are:
PHP 5.3 vs 5.2
Nginx 0.7 vs 0.6
MySQL 5.1 vs 5.0
Cleaner repos (for those Debian templates with broken repositories)

To run this script, enter in:

wget http://www.putdispenserhere.com/wp-content/uploads/setup-cheap-debian.sh
bash setup-cheap-debian.sh

Afterward, run this to setup WordPress:

bash setup-debian.sh wordpress blog.example.com

Make sure you change blog.example.com to match your domain.

Script source:

#!/bin/bash

mv /etc/apt/sources.list /etc/apt/sources.list.backup

cat > /etc/apt/sources.list <<END
#############################################################
################### OFFICIAL DEBIAN REPOS ###################
#############################################################

###### Debian Main Repos
deb http://ftp.us.debian.org/debian/ lenny main contrib non-free 

###### Debian Update Repos
deb http://security.debian.org/ lenny/updates main contrib non-free 
deb http://ftp.us.debian.org/debian/ lenny-proposed-updates main contrib non-free 
deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free 

##############################################################
##################### UNOFFICIAL  REPOS ######################
##############################################################

###### 3rd Party Binary Repos
#### DotDeb Backports - http://www.backports.org
deb http://packages.dotdeb.org oldstable all
deb-src http://packages.dotdeb.org oldstable all
deb http://php53.dotdeb.org oldstable all
deb-src http://php53.dotdeb.org oldstable all
END

wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | apt-key add -
apt-get update

apt-get upgrade

#wget --no-check-certificate https://github.com/lowendbox/lowendscript/raw/master/setup-debian.sh

wget http://dl.dropbox.com/u/1120738/setup-debian.sh

bash setup-debian.sh system

bash setup-debian.sh exim4

bash setup-debian.sh mysql

bash setup-debian.sh nginx

bash setup-debian.sh php

cat > ./restart.sh <<END
#!/bin/bash
invoke-rc.d nginx restart
invoke-rc.d php-cgi restart
invoke-rc.d mysql restart
END

invoke-rc.d nginx stop

cat > /etc/apt/preferences <<END
Package: nginx
Pin: release a=lenny-backports
Pin-Priority: 990
END

cat >> /etc/apt/sources.list <<END
deb http://backports.debian.org/debian-backports lenny-backports main
END

apt-get update

apt-get -t lenny-backports -y --force-yes install "nginx"

bash ./restart.sh

apt-get update

apt-get -y install unattended-upgrades

cat > /etc/apt/apt.conf.d/10periodic <<END
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
END

echo 'Install complete'
Bookmark the permalink.