Install Aegir Manually

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

Note that those instructions are DEPRECATED, see the new installation guide.

The manual installation instructions on this page assume that you have followed the steps in Preparing a Server for Aegir. You may need to change some elements of these instructions to fit your own servers setup.
You can also follow the instructions in the INSTALL.TXT file that is packaged with the Hostmaster installation profile.

NOTE: you should probably just use INSTALL.txt above. We had issues following this version!
NOTE: the drush dl command downloads the latest published release. If you want a specific release, you need to specify it. For example, if you want to download the stable 0.3 release of Aegir, instead of the latest 0.4-alpha2 release, you need to run, for example, drush dl hosting-6.x-0.3

Create a user for aegir to operate as

Start by being logged in as root in a shell session to your server.

adduser --system --group --home /var/aegir aegir

This will create a new system user, and thus WILL NOT ask you to provide a password. The aegir user's shell will be /bin/false. You can su to become the aegir user to carry out tasks, by typing this as root:

su -s /bin/sh aegir

Note: /bin/sh is an agnostic example. You may wish to use a different shell. I.e /bin/sh will drop an Ubuntu user into a Dash shell, which may not be preferable. In Ubuntu, use this instead:

sudo su -s /bin/bash - aegir

Preparations

Setup CVS repository...

export CVSROOT=:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib 
cvs login 

Download Drush and Provision

cvs -z6 co -d drush -r DRUPAL-6--2-1 contributions/modules/drush 
mkdir .drush 
cd .drush
/var/aegir/drush/drush.php dl provision
cd ..

At this point we need to gain superuser privileges to execute the next few commands, so we logout of the aegir session...

logout 

chmod u+x /var/aegir/drush/drush  

ln -s /var/aegir/drush/drush /usr/bin/drush 

su - aegir

We're now back as the aegir user.

Test that the drush setup is working:

drush

This should list all available drush commands. Check that it includes the 'provision' commands. If this doesn't work as expected troubleshooting is needed... check the permissions of the directories and drush file. Try /var/aegir/drush/drush.php. If that works, then there's a problem with the symlink.

If all is working with drush, let's move on to the next step.

Setup Drupal codebase

We start by checking out the latest drupal 6 release...

drush dl drupal

See how easy drush makes things?!

Get Hostmaster install profile

cd aegir/drupal-6./profiles 
export CVSROOT=:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib  
cvs login 
cvs -z6 co -d hostmaster -r DRUPAL-6--0-4-ALPHA2 contributions/profiles/hostmaster 
mkdir hostmaster/modules
mkdir hostmaster/themes 
/var/aegir/drush/drush.php dl --destination=/var/aegir/drupal-6.
/profiles/hostmaster/modules hosting install_profile_api admin_menu
/var/aegir/drush/drush.php dl --destination=/var/aegir/drupal-6.*/profiles/hostmaster/themes eldir

Note that the hostmaster profile still needs to be checked out via CVS, as drush has problems downloading profiles (see http://drupal.org/node/500324).

Configure Apache

Now we'll copy across a file template (with the filename changed from aegir.example.com to the domain name of our aegir install)...

mkdir -p /var/aegir/config/vhost.d 
chmod 0711 /var/aegir/config
cp hostmaster/apache2.conf.txt ~/config/vhost.d/aegir.example.com 

Edit this file as you wish, but you must ensure the servername, documentroot and directory are all correct for the codebase. So:
vim ~config/vhost.d/aegir.example.com

Next, we'll create some other useful directories...

mkdir /var/aegir/backups 
chmod 0700 /var/aegir/backups

mkdir /var/aegir/platforms 

mkdir  /var/aegir/drupal-6./sites/all/modules 
chmod 0777 /var/aegir/drupal-6.
/sites/all/modules 

mkdir  /var/aegir/drupal-6./sites/all/themes 
chmod 0777 /var/aegir/drupal-6.
/sites/all/themes 

mkdir /var/aegir/drupal-6./sites/aegir.example.com
cp /var/aegir/drupal-6.
/sites/default/default.settings.php /var/aegir/drupal-6./sites/aegir.example.com/settings.php
chmod a+w /var/aegir/drupal-6.
/sites/aegir.example.com/settings.php
mkdir /var/aegir/drupal-6./sites/aegir.example.com/files
chmod 2770 /var/aegir/drupal-6.
/sites/aegir.example.com/files

And then...
logout 

So we're now back as root. Next we add the aegir user to the www-data group.

adduser aegir www-data 

Now we want to tell apache to include aegir's vhost files. Apache will automatically run files in /etc/apache2/conf.d, so add/edit the new file with:
sudo vim /etc/apache2/conf.d/aegir 
putting the following inside it:
Include /var/aegir/config/vhost.d/* 

Next we configure sudo to allow aegir user permission to restart apache:
sudo visudo 
Use the arrow keys to go to the last line. Press 'a' to add a line. Type:
aegir ALL=NOPASSWD: /usr/sbin/apache2ctl 
Hit Esc. Type ':'. type 'wq' and hit ENTER.

Configure MySQL

We'll now setup the necessary users and database in MySQL.

The main aegir site uses database 'aegir' and a database user 'aegir'.

mysql -uonlyme -p 

mysql> CREATE DATABASE aegir
mysql> GRANT ALL ON aegir.* TO 'aegir'@'localhost' IDENTIFIED BY 'password'; 

We also configure a MySQL 'superuser' who is capable of creating more databases. It is advised to not use the same user as the previous db user, but instead a separate superuser for security. As a naming standard, we recommend calling this superuser 'aegir_root'

mysql> GRANT ALL PRIVILEGES ON *.* TO 'aegir_root'@'localhost' IDENTIFIED BY 'password'  WITH GRANT OPTION; 
mysql> exit 

If your database server is running not on the local server but as a remote database server, substitute the 'localhost' commands for the wildcard '%'.

Run the installer

First, restart apache:
sudo /etc/init.d/apache2 restart 

Then in a browser, go to http://aegir.example.com (you will need to have setup the DNS entries for your domain to point at the IP of your server).

Hosting setup

Setup the database with the 'hostmaster' details we created earlier.

The setup will ask you to enter the path to drush.php. This is:
/var/aegir/drush/drush.php 

The configuration path is:
/var/aegir/config 

And the backup path is:
/var/aegir/backups 

We've already done the step of adding the line to httpd.conf.

On the Database page, enter the details for the 'aegir' database user.

At some point during the install you'll be prompted to enter a drush command to run the hosting setup...

su - aegir 
cd /var/aegir/drupal-6.*
/var/aegir/drush/drush.php --uri=http://yoursite.com hosting setup 

Configure Aegir

Aegir is now installed, and you can configure it with your preferred settings. Have a browse around. Read the wiki and other posts on here: http://groups.drupal.org/aegir-hosting-system to find out what you can do with it. Prepare to be excited (if you're a geek)!

For next steps see: Aegir Is Installed - What Next?

Aegir hosting system

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week