Commit be8cb1d3 authored by anarcat's avatar anarcat

Merge branch 'upstream' into debian

parents ccef09a4 1cc9ddf0
The Aegir system
================
This is the backend of the Aegir hosting system.
The Aegir hosting system allows developers and site administrators to
automate many of the common tasks associated with deploying and
managing large websites. Aegir makes it easy to install, upgrade,
deploy, and backup an entire network of Drupal sites.
The front end and back end are designed to be run separately, and each
front end will also be able to drive multiple back ends.
This is the backend of the Aegir hosting system. The front end and
back end are designed to be run separately, and each front end will
also be able to drive multiple back ends.
The most up to date information regarding the project and its goals
can be found on the Aegir website and the community portal:
......@@ -12,17 +16,19 @@ can be found on the Aegir website and the community portal:
http://aegirproject.org
http://community.aegirproject.org
To install Aegir, you should follow the INSTALL.txt document in docs/.
The HINTS_<arch>.txt files can be useful if you have a specific
architecture, as out of the box, the examples for INSTALL.txt are for
Debian systems.
To install Aegir, you should follow the instructions at:
To upgrade Aegir, follow the UPGRADE.txt document in docs/.
http://community.aegirproject.org/installing
To upgrade Aegir, follow the instructions at:
The core of the documentation in docs/ should be sufficient to get you
started. If you have further questions or are having trouble with Aegir,
head for the documentation:
http://community.aegirproject.org/upgrading
http://community.aegirproject.org/notebook
If you have further questions or are having trouble with Aegir,
check out additional documentation at:
Other documentation for developers is also available in docs/.
http://community.aegirproject.org/handbook
Other documentation for developers is also available at:
http://community.aegirproject.org/developing
......@@ -4,6 +4,6 @@ api = 2
projects[drupal][type] = "core"
projects[hostmaster][type] = "profile"
projects[hostmaster][download][type] = "get"
projects[hostmaster][download][url] = "http://files.aegirproject.org/hostmaster-0.4-beta2.tgz"
projects[hostmaster][download][directory_name] = "hostmaster"
projects[hostmaster][download][type] = "git"
projects[hostmaster][download][url] = "http://git.drupal.org/project/hostmaster.git"
projects[hostmaster][download][tag] = "6.x-1.0-rc2"
......@@ -71,7 +71,7 @@ class provisionService_db extends provisionService {
function suggest_db_name() {
$uri = $this->context->uri;
$suggest_base = substr(str_replace(array('.', '-'), '' , ereg_replace('^www\.', '', $uri)), 0, 16);
$suggest_base = substr(str_replace(array('.', '-'), '' , preg_replace('/^www\./', '', $uri)), 0, 16);
if (!$this->database_exists($suggest_base)) {
return $suggest_base;
......
......@@ -41,6 +41,9 @@ function drush_dns_provision_zone($action, $zone, $name = null, $type = null, $d
break;
case 'rr-add':
$record = d()->service('dns')->config('zone', $zone)->record_get($name);
if (!is_array($record[$type])) {
$record[$type] = array();
}
$record[$type] = array_merge($record[$type], array($destination));
$status = d()->service('dns')->config('zone', $zone)->record_set($name, $record)->write();
break;
......@@ -281,7 +284,7 @@ class provisionService_dns extends provisionService {
if ($status) {
drush_log(dt("creating zone configuration on slaves"));
$status = $this->_each_server("create_zone", $zone);
$status = $this->_each_server("create_zone", array($zone));
}
return $status;
}
......@@ -295,7 +298,7 @@ class provisionService_dns extends provisionService {
if ($status) {
drush_log(dt("deleting zone configuration from slaves"));
$status = $this->_each_server("delete_zone", $zone);
$status = $this->_each_server("delete_zone", array($zone));
}
return $status;
}
......@@ -319,6 +322,7 @@ class provisionService_dns extends provisionService {
$host = $this->context->uri;
$zone = $this->context->dns_zone;
$sub = $this->context->dns_zone_subdomain;
$aliases = $this->context->aliases;
}
else {
return drush_set_error('DRUSH_DNS_NO_ZONE', "Could not determine the zone to create");
......@@ -337,6 +341,12 @@ class provisionService_dns extends provisionService {
}
$this->config('zone', $zone)->record_set($sub, array('A' => $ips));
foreach ($aliases as $alias) {
if ($this->guess_zone($alias) == $zone) {
$this->config('zone', $zone)->record_set($this->guess_zone($alias, 'subdomain'),
array('CNAME' => array($zone . '.')));
}
}
$this->create_zone($zone);
$this->create_config('host');
......@@ -360,14 +370,21 @@ class provisionService_dns extends provisionService {
$host = $this->context->uri;
$zone = $this->context->dns_zone;
$sub = $this->context->dns_zone_subdomain;
$aliases = $this->context->aliases;
}
else {
return drush_set_error('DRUSH_DNS_NO_ZONE', "Could not determine the zone to create");
}
// remove the records from the zone store
$this->config('zone', $zone)->
record_set($sub, array('A' => null))->write();
$this->config('zone', $zone)->record_set($sub, array('A' => NULL));
foreach ($aliases as $alias) {
if ($this->guess_zone($alias) == $zone) {
$this->config('zone', $zone)->record_set($this->guess_zone($alias, 'subdomain'),
array('CNAME' => NULL));
}
}
$this->config('zone', $zone)->write();
}
}
......
.. -*- mode: rst; fill-column: 78; -*-
.. This document is formatted using the ReST syntax.
===============================================
Aegir -- CentOS installation instructions hints
===============================================
This is a helper file to the canonical INSTALL.txt. It is aimed at
helping you install Aegir on CentOS. It simply lists commands that
diverge from the base INSTALL.txt in a concise document that will be
easy to maintain in the long term.
It is recommended that the INSTALL.txt document is consulted before
going ahead with this install.
We reuse the same process describe in that document:
1. Install requirements
2. Configure system requirements, which include:
* create a Aegir user
* configure Apache, MySQL, DNS, etc
3. Run the install script
1. Install software requirements
================================
You should use the repos "utter ramblings" repos (which feature PHP
5.2) at: http://www.jasonlitka.com/yum-repository/
Shell commands::
rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
cat >> /etc/yum.repos.d/utterramblings.repo <<EOF
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL\$releasever/\$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
EOF
yum install httpd postfix sudo unzip mysql-server php php-mysql
2. Configure system requirements
================================
Shell commands::
useradd --home-dir /var/aegir aegir
gpasswd -a aegir apache
chmod -R 755 /var/aegir
# Include the Aegir configs
ln -s /var/aegir/config/apache.conf /etc/httpd/conf.d/aegir.conf
service mysqld start
# Optional: set the mysql root password
mysqladmin password $password
mysql -uroot -p
The last two lines can also be (better) accomplished using the
mysql_secure_installation script.
The aegir user needs to have sudo access. The wizard will explain how to
do this, but you can already just add the relevant line to your sudoers
file.
/etc/sudoers configuration::
aegir ALL=NOPASSWD: /usr/sbin/apachectl
The default sudo configuration in CentOS requires sudo to run in a real
TTY which will make verify and install tasks failed with the message:
"Web server could not be restarted. Changes might not be available
until this has been done"
For sudo to behave properly, you should also comment out the following line
in your /etc/sudoers file:
Defaults requiretty
3. Run the install script
=========================
This section deals with the actual installation of Aegir.
There is an install script that takes care of installing the right packages and
preparing the backend and frontend install for you. That script needs to be run
as the aegir user created above. This file is available in Provision or can be
downloaded through the web at:
http://git.aegirproject.org/?p=provision.git;a=blob_plain;f=install.sh.txt;hb=HEAD
By default, the install script will install the "correct" version of Aegir
(ie. if it was downloaded through git, it will install the version from the
git master branch. If you downloaded an official release, it should install
the official release.). You can modify which version to install by editing the
AEGIR_VERSION variable in the script.
Shell commands::
su -s /bin/sh aegir -c "sh install.sh.txt aegir.example.com"
Note you must run this as root or prefix with sudo.
Be sure to change 'aegir.example.com' to match the URI of your site.
You can append '--client_email=you@example.com' if you wish to receive the
traditional Drupal 'Welcome' e-mail upon completion of the installation.
This e-mail address will also be used as the default e-mail address of the
first user and client in Aegir, but can be changed later.
4. Common issues
================
There are various caveats on running Aegir on CentOS.
You may need to adjust CentOS's firewall settings to allow HTTP
traffic on port 80. If you installed CentOS with a UI, enable
"Firewall settings -- WWW (HTTP)".
Alternatively, another solution may be to edit /etc/sysconfig/iptables
and add a rule accepting traffic on the relevant interface on port 80.
Afterwards, you can restart the firewall with this command:
Shell commands::
service iptables restart
Also, in some configurations, it seems necessary to restart crond for
the user crontab changes to take effect (very bizarre). For that, use:
Shell commands::
service crond restart
See http://drupal.org/node/632308 if you have more information about
this issue.
.. -*- mode: rst; fill-column: 78; -*-
.. This document is formatted using the ReST syntax.
=================================================
Aegir -- Mac OS X installation instructions hints
=================================================
This is a helper file to the canonical INSTALL.txt. It is aimed at
helping you install Aegir on Mac OS X. It simply lists commands that
diverge from the base INSTALL.txt in a concise document that will be
easy to maintain in the long term.
It is recommended that the INSTALL.txt document is consulted before
going ahead with this install.
We reuse the same process describe in that document:
1. Install requirements
2. Configure system requirements, which include:
* create a Aegir user
* configure Apache, MySQL, DNS, etc
3. Run the install script
1. Install software requirements
================================
While Mac OS X comes with Apache & PHP (and even MySQL on the Server
version), the version of PHP shipped with 10.6 Snow Leopard is 5.3.x
and thus may not work with Aegir (as of the 0.4alpha-era) and various
other software. If you're running 10.5 Leopard, it may work out of the
box, but I haven't tested it.
There are several different ways to get Apache, PHP 5.2, and MySQL 5
onto a Mac OS X machine. I give detailed instructions for MacPorts
below, but if that's a bit more than you're ready to bite off right
now, feel free to use an alternative approach.
One such alternative is MAMP. There is a good but outdated HOWTO for
installing Aegir on Mac OS X 10.6 (Snow Leopard) using MAMP located
here: http://groups.drupal.org/node/30270
MAMP stands for Mac, Apache, MySQL, and PHP and is the Mac equivalent
of "LAMP". It is a self-contained package of all of these programs
with a nice graphical installer and control panel. You can find it
here: http://www.mamp.info/
MAMP is pretty straightforward, but it's also not very flexible
(IMHO). While certainly not without its own headaches, MacPorts is a
decently powerful way to sanely manage a healthy stack of open source
UNIX software on your Mac. Since this is what I use, I'm going to
assume MacPorts is in use for the rest of this HINTS file. I have also
only tested this on Mac OS X 10.6 Snow Leopard.
If you don't yet have MacPorts installed, go here to get it:
http://www.macports.org/install.php
Once it's installed, quit and re-launch your Terminal before
continuing. Otherwise MacPorts won't yet be in your PATH.
The first two commands below are optional but recommended.
Shell commands::
sudo port selfupdate
sudo port upgrade outdated
sudo port install apache2 mysql5-server git-core unzip php52 php5-posix \
php5-gd php5-apc +mysql5
php5-apc is optional, but highly recommended as it will significantly increase
PHP performance.
Watch the output of the last port command carefully, as there are
usually some boring tasks for you to perform once the install is
done. You'll be wishing you were running Ubuntu/Debian and apt-get by
the time you're done.
2. Configure system requirements
================================
Next we'll create the aegir user and add it to the _www group. This
part is very different on Mac OS X than Linux or most other
Unices. Must be a NeXTism. The command we will use he is "dscl", which
is a short for Directory Service Command Line. In OSX 10.3 and
earlier, that command is "nicl" (short for Net Info Command Line). It is also
possible to create the user using the "Workgroup Manager" utility included with
OS X Server. To obtain Workgroup Manager for the OS X Client, download the
"Server Admin Tools" from Apple. For example, for Mac OS X 10.6, the admin tools
can be found at:
http://support.apple.com/downloads/Server_Admin_Tools_10_6
Shell commands::
sudo dscl . -create /Users/aegir NFSHomeDirectory /var/aegir
Now you need to find the next spare UID to assign the user.
Here's how you find out on your system:
Shell commands::
sudo dsexport users.out /Local/Default dsRecTypeStandard:Users
Then open the file users.out in a text editor, search for the highest
5xx user ID and add 1 to it (in your brain, not in the file). So if
you find 506 but no 507, use 507. When you're done, delete users.out
to be safe.
Shell commands::
sudo rm users.out
Now assign this UID to the aegir user, replacing "5xx" with the UID.
Shell commands::
sudo dscl . -create /Users/aegir UniqueID 5xx
Set a secure password for the aegir user, as it needs shell access.
Shell Commands::
sudo passwd aegir
Create the aegir home directory and set its permissions.
Shell Commands::
sudo mkdir /var/aegir
sudo chown aegir /var/aegir
sudo chgrp _www /var/aegir
Add the aegir user to the _www group. This is the group Apache runs as.
Shell Commands::
sudo dscl . -append /Groups/_www GroupMembership aegir
Give the aegir user the ability to restart Apache.
Shell Commands::
sudo mv /usr/sbin/apachectl /usr/sbin/apachectl-apple
sudo ln -s /opt/local/apache2/bin/apachectl /usr/sbin/apachectl
sudo visudo
Go to the last line of the file and add the following.
Sudoers file content::
aegir ALL=NOPASSWD: /usr/sbin/apachectl
Save the file and exit your text editor.
Next configure Apache to include the Aegir config.
Shell Commands::
echo "Include /var/aegir/config/apache.conf" >> /opt/local/apache2/conf/httpd.conf
Configuring your MySQL database and user accounts is the same as in
the INSTALL.txt file. But you probably want to add the path to its
executables to your user's PATH and the aegir user's PATH.
Shell Commands::
echo 'export PATH=/opt/local/lib/mysql5/bin:$PATH' >> ~/.profile
su - aegir
Password: (the password you setup earlier)
echo 'export PATH=/opt/local/lib/mysql5/bin:$PATH' >> ~/.profile
exit
3. Run the install script
=========================
Now follow the instructions of section 3 of INSTALL.txt, except for
when it tells you to run "su -s /bin/sh aegir -c "sh install.sh.txt
aegir.example.com" do the following instead.
Shell commands::
su - aegir
Password: (you know the drill)
sh /path/to/install.sh.txt aegir.example.com
sudo /usr/sbin/apachectl restart
exit
Be sure to change 'aegir.example.com' to match the URI of your site.
You can append '--client_email=you@example.com' if you wish to receive the
traditional Drupal 'Welcome' e-mail upon completion of the installation.
This e-mail address will also be used as the default e-mail address of the
first user and client in Aegir, but can be changed later.
.. -*- mode: rst; fill-column: 78; -*-
.. This document is formatted using the ReST syntax.
================================================
Aegir -- Solaris installation instructions hints
================================================
This is a helper file to the canonical INSTALL.txt. It is aimed at helping you
install Aegir on Solaris. It simply lists commands that diverge from the base
INSTALL.txt in a concise document that will be easy to maintain in the long
term.
It is recommended that the INSTALL.txt document is consulted before going
ahead with this install.
We reuse the same process describe in that document:
1. Install requirements
2. Configure system requirements, which include:
* create a Aegir user
* configure Apache, MySQL, DNS, etc
3. Run the install script
1. Install software requirements
================================
TODO: Show how to install:
* Apache2
* git
* sudo
* mysql
* PHP 5.2
* wget
unzip and sendmail should be part of the base Solaris install. Other
applications should be available on the companion CDs or:
http://www.sunfreeware.com/
In particular, git can be compiled easily by exporting the following
environment::
export CFLAGS="-I/usr/sfw/include -I/opt/sfw/include"
export LD_LIBRARY_PATH="/usr/sfw/lib:/opt/sfw/lib:$LD_LIBRARY_PATH"
Then the compile instructions bundled with git should just be followed
plainly.
XXX: I had trouble installing the binaries, as git expects ginstall to be
available in the path. I ended up adding the source directory in the path,
which works fine for most uses.
2. Configure system requirements
================================
Shell commands::
groupadd aegir
useradd -g aegir -G webservd -d /var/aegir -s /bin/bash -c "Aegir sandbox" aegir
chown aegir:aegir /var/aegir
echo "Include /var/aegir/config/apache.conf" >> /etc/apache2/httpd.conf
MySQL commands::
# Replace 'aegir_password' with the chosen password for 'aegir' mysql account
CREATE DATABASE aegir;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, \
CREATE TEMPORARY TABLES, LOCK TABLES ON aegir.* TO \
'aegir'@'localhost' IDENTIFIED BY 'aegir_password';
# Create a mysql super user (with GRANT OPTION)
# Replace 'aegir_root_password' with a new password
GRANT USAGE,CREATE USER ON *.* TO 'aegir_root'@'localhost' \
IDENTIFIED BY 'aegir_root_password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `site\_%`.* TO 'aegir_root'@'localhost';
3. Run the install script
=========================
Download the install.sh script per the instructions in Step 3 of the canonical
INSTALL.txt file, with modifications below.
Shell commands::
su - aegir
bash install.sh.txt aegir.example.com
Be sure to change 'aegir.example.com' to match the URI of your site.
You can append '--client_email=you@example.com' if you wish to receive the
traditional Drupal 'Welcome' e-mail upon completion of the installation.
This e-mail address will also be used as the default e-mail address of the
first user and client in Aegir, but can be changed later.
4. Common issues
================
Drush issue
-----------
Solaris suffers from the dreaded execution issues of drush:
http://drupal.org/node/637574
http://drupal.org/node/586466
Those can be worked around by hardcoding the --php executable on the
commandline path. Adding the proper shebang header and using a proper PATH
that includes the PHP executable also helps.
Cron issues
-----------
I had numerous problems setting up a proper cron job, as Solaris' crond seems
pretty anal about what it accepts. The only way I could get it to work was to
create a wrapper shell script that would be called using the simplest cron
tab.
Crontab entry::
* * * * * /var/aegir/dispatch.sh
Content of dispatch.sh::
#!/usr/bin/bash
HOME=/var/aegir
LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/lib/sparcv9:/opt/mysql/mysql/lib:/usr/sfw/lib:/usr/sfw/lib/gcc:/opt/sfw/lib
PATH=/usr/bin:/opt/mysql/mysql/bin:/usr/sfw/bin:/opt/sfw/bin:/opt/SUNWspro/bin:/usr/local/bin:/opt/csw/bin
export HOME
export LD_LIBRARY_PATH
export PATH
php '/var/aegir/drush/drush.php' --php=/usr/local/bin/php '@hostmaster' hosting-dispatch
.. -*- mode: rst; fill-column: 78; -*-
.. This document is formatted using the ReST syntax.
=================================
Aegir Installation Instructions
=================================
------------------------------------------------------------------------------
This document describes briefly how to install a multi-platform, single-server
Aegir Drupal provisionning system.
------------------------------------------------------------------------------
Aegir installation seems difficult at first, but once you get around it, it's
fairly simple. It's 3 basic steps::
1. Install requirements
2. Configure system requirements, which include::
* create a Aegir user
* configure Apache, MySQL, DNS, etc
3. Run the install script.
Those steps are detailed below. The following instructions provide example
commands for a Debian-like distribution, but should be fairly easy to adapt to
your environment. In fact, this document is meant as a canonical reference
that should work on every platform and that can be used for people porting
Aegir to new platforms or installing on alien platform for which Aegir is not
yet packaged.
Platform-specific cheat sheets are also available for other platforms in
HINTS_*.txt files alongside this document. Those files are basically a
bullet-point summary of the steps required for the installation. In case of
conflict between INSTALL.txt and other documentation, INSTALL.txt should be
considered the canonical source of information.
Also note that those instructions setup a complete Aegir system. If you want
to only setup a new server, it should be sufficient to install requirement
(step 1) and configure them (step 2). You will just need the --backend-only flag
to avoid installing the frontend on the server.
1. Install software requirements
================================
This section describes what is expected of the servers Aegir is running on.
Aegir must run some UNIX flavour because the majority of functionality in this
system occurs in the back-end, through command line scripting. There are also
several features (such as symlinks), that are not available to users on
Windows. There are no plans currently to add windows