forked from doka/install-aegir-on-ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-aegir-on-ubuntu.sh
139 lines (136 loc) · 4.21 KB
/
install-aegir-on-ubuntu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#! /bin/bash
#
# Aegir 1.x install script for Ubuntu servers
# (install-aegir-on-ubuntu.sh)
# on Github: https://github.com/doka/install-aegir-on-ubuntu
#
# This script assumes:
# - your hostname is: myhost.local (it will be the Aegir admin interface)
# - your IP address is: 192.168.1.101
# - you can use other hostname and network parameters, but your hostname has
# to be a full qualified domain name (FQDN)
#
# Prerequisites:
# - you run this script on a bare ubuntu server, only extra is OpenSSH server
#
# - you run this script with a user having sudo rights
#
# - you have set static IP address in /etc/network/interfaces like this:
# auto eth0
# iface eth0 inet static
# address 192.168.1.101
# network 192.168.1.0
# netmask 255.255.255.0
# gateway 192.168.1.1
#
# - change the hostname
# delete the old hostname, and write your hostname (myhost.local)
# into /etc/hostname
# echo 'myhost.local' | sudo tee /etc/hostname
#
# - update /etc/hosts
# add following line: 192.168.1.101 myhost.local
# echo '192.168.2.101 myhost.local' | sudo tee -a /etc/hosts
#
# - reboot your server!
#
# - copy this script to the ubuntu server and make it executable
# wget https://raw.github.com/doka/install-aegir-on-ubuntu/master/install-aegir-on-ubuntu.sh
# chmod 750 ./install-aegir-on-ubuntu.sh
#
#
# ***********************************
# set versions Aegir & Drush versions
DRUSH_VERSION="7.x-5.9"
#DRUSH_VERSION="7.x-4.4"
#
AEGIR_VERSION="6.x-2.0-rc3"
#AEGIR_VERSION="6.x-1.8"
#AEGIR_VERSION="6.x-1.7"
#AEGIR_VERSION="6.x-1.6"
#AEGIR_VERSION="6.x-1.5"
#AEGIR_VERSION="6.x-1.4"
#AEGIR_VERSION="6.x-1.3"
#AEGIR_VERSION="6.x-1.2"
#AEGIR_VERSION="6.x-1.1"
#AEGIR_VERSION="6.x-1.0"
# ***********************************
#
#
# 1. install software requirements by Aegir, but not preinstalled on a bare
# Ubuntu server. Set the root password for MySQL, and accept the defaults
# at postfix install (Internet site, ...)
#
# sudo apt-get update
# sudo apt-get upgrade
# sudo apt-get install apache2 php5 php5-cli php5-gd php5-mysql mysql-server postfix git-core unzip
#
#
# 2. LAMP configurations
#
# PHP: set higher memory limits
sudo sed -i 's/memory_limit = -1/memory_limit = 192M/' /etc/php5/cli/php.ini
#
# Apache
sudo a2enmod rewrite
sudo ln -s /var/aegir/config/apache.conf /etc/apache2/conf.d/aegir.conf
#
# MySQL: enable all IP addresses to bind
# sudo sed -i 's/bind-address/#bind-address/' /etc/mysql/my.cnf
# sudo service mysql restart
# MySQL: using secure install script instead
sudo mysql_secure_installation
#
#
# 3. Aegir install
#
# add Aegir user
sudo adduser --system --group --home /var/aegir aegir
sudo adduser aegir www-data
#
# sudo rights for the Aegir user to restart Apache
echo 'aegir ALL=NOPASSWD: /usr/sbin/apache2ctl' | sudo tee /tmp/aegir
sudo chmod 440 /tmp/aegir
sudo cp /tmp/aegir /etc/sudoers.d/aegir
#
# generate SSH keys for the aegir user
sudo su -s /bin/sh - aegir -c "ssh-keygen -t rsa"
# Drush install
#
sudo su -s /bin/sh - aegir -c "
wget http://ftp.drupal.org/files/projects/drush-$DRUSH_VERSION.tar.gz ;
gunzip -c drush-$DRUSH_VERSION.tar.gz | tar -xf - ;
rm drush-$DRUSH_VERSION.tar.gz ;
"
sudo ln -s /var/aegir/drush/drush /usr/local/bin/drush
#
# install provision backend by drush
echo "installing provision backend ..."
sudo su -s /bin/sh - aegir -c "drush dl --destination=/var/aegir/.drush provision-$AEGIR_VERSION"
#
# install hostmaster frontend by drush, incl drush_make
echo "installing frontend: Drupal 6 with hostmaster profile ..."
sudo su -s /bin/sh - aegir -c "drush hostmaster-install"
echo "
Aegir install ready, above you have the login link!
"
#
echo "
#
# Checkpoint / But not yet finished!
#
# The installation has provided you with a one-time login URL to stdout
# (see above), or via an e-mail. Use this link to login to your new Aegir site
# for the first time.
#
# 1. Do not forget to add all the domains you are going to manage by Aegir,
# to your /etc/hosts files on every boxes your are using!
#
# 2. Copy your public id to remote servers, if you use any remote servers:
# ssh-copy-id <myhost.local>
# ssh <myhost.local>
#
# 3. You can switch to the aegir user by:
# sudo su -s /bin/bash - aegir
#
"