Drupal camp South Florida 2011 - Introduction to the Aegir hosting platform

22
Author: Hector Iribarne @hectoriribarne

Transcript of Drupal camp South Florida 2011 - Introduction to the Aegir hosting platform

Author: Hector Iribarne @hectoriribarne

•What is Aegir? 1

•Installing Aegir on

clean Linux Ubuntu 2

•Post install Aegir

Basics 3

Let's get started . . .

What is Aegir?

A hosting platform for deploying, managing and maintaining Drupal sites (Drupal 6, Drupal 7, etc)

Makes it easy to install Drupal distributions (e.g. Managing News, Open Publish, Commons, etc.)

Uses Drush for backend functionality

Installs directly on clean Linux install at aegir.example.com

Aegir can manage local and remote servers

Current version is Aegir 1.4, which is Drupal 6 based

Future Aegir 2.0 will be based on Drupal 7

Support on IRC: #drupal-aegir irc://irc.freenode.net/aegir

@hectoriribarne

Step-by-step Installation

Installing Aegir on Linux Ubuntu

10.04 LTS

Italics means that you will have to use your information in place of the italics

servername = the name of your server (e.g. linode12345, or

whatever you name it)

IPaddress = the public IP of your server

example.com = your domain name

DomainHost.com = your domain name host (e.g. godaddy.com, etc.)

VPShost.com = the domain of your VPS host (e.g. linode.com,

rackspace.com, etc.)

Linux commands are in blue.

Text inside files is in green.

Pay extra attention to text in red.

@hectoriribarne

Go to your domain name host (i.e. DomainHost.com) and point your main domain name (i.e. example.com) to the name servers of your host (e.g. ns1.linode.com, ns2.linode.com or dns1.stabletransit.com, dns2.stabletransit.com, etc.) Wait about 2 hours for the change to take effect, although sometimes it can be a little longer.

Add A records for aegir and servername. You may also want to add one for mail and www, if you don't already have one

After waiting the appropriate time. Do a whois on your domain name to make sure it is pointing to the name servers you set up. You should not process with installing aegir unless your name servers are set up for your domain

Login as root to your server so we can begin typing in the commands in the continuing slides

@hectoriribarne

Update your linux distribution

apt-get update apt-get upgrade

Update your FQDN (fully qualified domain name)

/bin/hostname servername.example.com echo servername.example.com > /etc/hostname

REBOOT YOUR SERVER

Install LAMP server (You will be asked to enter a mysql database password)

sudo apt-get install lamp-server^

Edit your hosts file

sudo nano /etc/hosts

While editing your hosts file, add the following line:

IPaddress servername.example.com servername

@hectoriribarne

Enable ssl (Don't restart apache at this time. Wait until later when you will be told to do so in the slides)

a2enmod ssl

Enable rewrite, headers and expires modules

a2enmod rewrite a2enmod headers a2enmod expires

Enable mod_status

sudo nano /etc/apache2/httpd.conf

While editing your httpd.conf file, add the following lines: ExtendedStatus On <Location /server-status> SetHandler server-status Order Deny,Allow Deny from all Allow from 127.0.0.1

</Location>

@hectoriribarne

Install Apachetop to monitor Apache (More information can be found at

http://packages.ubuntu.com/lucid/apachetop)

sudo apt-get install apachetop

Update the apache2.conf file (don’t forget to change servername below)

sudo nano /etc/apache2/apache2.conf

While editing your httpd.conf file, add the following lines at the end: # Caching & cache headers <IfModule mod_headers.c> ExpiresActive On ExpiresDefault "access plus 300 seconds" ExpiresByType text/html "access plus 1 day" ExpiresByType text/css "access plus 1 day" ExpiresByType text/javascript "access plus 1 day" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType application/x-shockwave-flash "access plus 1 day" </IfModule> # 6 HOURS <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$"> Header set Cache-Control "public" Header set Cache-Control "max-age=21600" Header unset Last-Modified </FilesMatch> # 2 HOURS <FilesMatch "\.(html|htm|xml|txt|xsl|js|css)$"> Header set Cache-Control "max-age=7200, must-revalidate" </FilesMatch>

ServerName servername

@hectoriribarne

Finally! : Restart Apache

/etc/init.d/apache2 restart

Install mytop for monitoring MySQL databases (More information can be found at

http://packages.ubuntu.com/lucid/mytop)

aptitude install mytop

Install phpmyadmin to administer MySQL databases (1) Choose apache2 webserver,

2) Configure database for phpmyadmin with dbconfig-common = yes, 3) Enter password for database)

sudo apt-get install phpmyadmin

Install PHP command line interface

sudo apt-get install php5-cli

Remove deprecated hash and change it to a semicolon

sudo nano /etc/php5/cli/conf.d/mcrypt.ini

Edit mcrypt.ini file and change # to ; ; configuration for php MCrypt module

@hectoriribarne

Install PHP libraries and scripting capabilities

sudo aptitude update sudo aptitude install libssh2-1-dev libssh2-php sudo apt-get install php-pear php5-curl php5-dev php5-gd

Install PECL PHP Extension Community Library (at the cursor, hit enter)

pecl install -f ssh2

Some more PHP configs

echo 'extension=ssh2.so' > /etc/php5/conf.d/ssh2.ini sudo apt-get update sudo apt-get install php-apc echo 'extension=apc.so' > /etc/php5/conf.d/apc.ini sudo apt-get install rsync sudo pecl install uploadprogress echo 'extension=uploadprogress.so' > /etc/php5/conf.d/uploadprogress.ini

@hectoriribarne

Again: Restart Apache /etc/init.d/apache2 restart

Install Postfix mail transfer agent that routes and delivers mail ( 1)

General type of mail configuration = Internet Site, 2) servername.example.com ).

sudo apt-get install postfix

Configure Postfix ( 1) General type of mail configuration = Internet Site, 2)servername.example.com

, 3) left blank, 4) leave list of defaults, 5) No forced synchronous updates, 6) network blocks leave default, 7) mailbox file limit left at 0, 8) left + default value, 9) ipv4).

For more details on configuring Postfix, see https://help.ubuntu.com/community/Postfix

sudo dpkg-reconfigure postfix

Install build-essential for building debian packages. (More info can be found

at http://packages.ubuntu.com/lucid/build-essential)

sudo aptitude install build-essential

@hectoriribarne

Edit Apache PHP Resource Limits

sudo nano /etc/php5/apache2/php.ini

Update to the following (keep in mind that the memory limit can be set higher depending on the amount of memory on your server)

max_execution_time = 300

max_input_time = 300

memory_limit = 128M

Edit PHP command line interface Resource Limits

sudo nano /etc/php5/cli/php.ini

Update to the following (keep in mind that the memory limit can be set higher depending on the amount of memory on your server)

max_execution_time = 300

max_input_time = 300

memory_limit = 192M

@hectoriribarne

Install Git

apt-get update sudo apt-get install git-core

Create and configure Aegir user

ln -s /var/aegir/config/apache.conf /etc/apache2/conf.d/aegir.conf useradd -r -U -d /var/aegir -m -G www-data aegir echo 'aegir ALL=NOPASSWD: /usr/sbin/apache2ctl' >> /etc/sudoers

Obtain Key for installing Aegir echo "deb http://debian.koumbit.net/debian stable main" > /etc/apt/sources.list.d/koumbit-stable.list

wget http://debian.koumbit.net/debian/key.asc apt-key add key.asc apt-get update

Install latest stable version of Drush

wget http://mirror.pnl.gov/ubuntu//pool/universe/d/drush/drush_4.4-1_all.deb dpkg -i drush_4.4-1_all.deb

@hectoriribarne

@hectoriribarne

Aegir is installed . . .

Now what?

Execute automatic Aegir install (1) domain for aegir - aegir.example.com, 2) enter a database

password. After Aegir installs, it will provide you with a one time login where you will have to change your password for aegir.example.com )

apt-get install aegir

Login as the Aegir user

su -s /bin/sh aegir

Change to the Aegir directory

cd /var/aegir/platforms ls –al

Download the latest version of Drupal

drush dl

@hectoriribarne

@hectoriribarne

Community Aegir site:

http://community.aegirproject.org/

http://community.aegirproject.org/installing/debian

Presentation from John Studdard:

http://www.slideshare.net/jpstuddard/aegir-overview-florida-drupal-camp-2011

Videos from mig5 on installing Aegir

http://vimeo.com/17131725

http://vimeo.com/groups/webdesigntuts/videos/9127281

Blog posts from Victor Kane:

http://awebfactory.com.ar/node/427

http://awebfactory.com.ar/node/444

@hectoriribarne

Questions?

@hectoriribarne

Hector Iribarne

Twitter: @hectoriribarne