Installing Aegir 3 on Debian 8 Jessie/Ubuntu with Nginx

So, after a few failed attempts at installing the Aegir 3 Drupal control system we hit upon this “recipe” as what works for us currently on a fresh install of Debian 8 Jessie or Ubuntu 14.04.

This assumes you are logged in as root. First, update and upgrade your system.

apt-get update && apt-get upgrade -y

For the version of OS that currently gets installed with a fresh Binary Lane VPS we also need to update the base system. We like to use aptitude for that; while we’re installing aptitude, we might as well install the other thing that Aegir needs to install properly:

apt-get install curl sendmail aptitude -y

Upgrade:

aptitude safe-upgrade -y

Now, we need to install the database server. We use MariaDB.

apt-get install mariadb-server -y

One that’s done – you will be prompted to enter a root password for the database – we run the following command:

mysql_secure_installation

Don’t worry about changing the root password now that you have already set one, but delete the test database when prompted, disable anonymous access and flush privileges. Now we can install Aegir, nginx, php5-fpm etc.:

echo “deb http://debian.aegirproject.org stable main” | sudo tee -a /etc/apt/sources.list.d/aegir-stable.list
curl http://debian.aegirproject.org/key.asc | sudo apt-key add –
apt-get update
apt-get install aegir3 aegir3-provision aegir3-hostmaster nginx php5-fpm

Enter the hostmaster URL – usually the fully qualified domain name. Enter the database root password once for provision and once for hostmaster.

Assuming all of the above has gone well, you should be given a one-time-login link in your terminal at the end of the install process, e.g.:

http://aegir.example.com.au/user/reset/1/1446598196/Nw4T4yd25IWEngCP2d2A_Ck3XslBiobnhbuNzXU4/login

Now, before using that run the following:

visudo

Add this to the end of the file:

Defaults:aegir !requiretty
aegir ALL=NOPASSWD: /etc/init.d/nginx

This gives Aegir – the aegir user – permission to restart nginx without requiring a sudo password.

Test this works by doing the following:

su – aegir
sudo /etc/init.d/nginx restart

What you want to see then is this:

* Restarting nginx nginx
[ OK ]

Then:

vim /etc/nginx/nginx.conf

Comment out by putting a # in front of:

# tcp_nopush on;
# types_hash_max_size 2048;
# error_log /var/log/nginx/error.log;

Reboot, and use the one-time-link. You should be logged in fine and now can use Aegir!