Commit d2b98045 authored by Adrian Rossouw's avatar Adrian Rossouw

Merge branch 'master' into dev-services

Conflicts:
	install.sh.txt
	platform/verify.provision.inc
	provision.drush.inc
parents 986b9b6a bdf897f0
......@@ -40,14 +40,14 @@ enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
EOF
yum install httpd postfix cvs sudo unzip mysql-server php php-mysql
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 www-data
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
......@@ -75,12 +75,27 @@ have not already added a DNS record for this. On OS X:
http://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/
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
3. Install the Aegir files
==========================
There is an install script part of the hostmaster profile that takes care of
installing the right packages and preparing the Drupal frontend install for
you. That script needs to be run as the aegir user created above. This file
is available alongside this one or can be downloaded through the web at:
http://git.aegirproject.org/?p=provision.git;a=blob_plain;f=install.sh.txt;hb=HEAD
Place it somewhere the aegir user can execute it, i.e in /tmp
Shell commands::
su aegir -c "sh install.sh.txt -w apache"
su aegir -c "sh /tmp/install.sh.txt -w apache"
service httpd restart
......@@ -101,6 +116,14 @@ 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:
......
.. -*- 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. Install the Aegir files
4. Follow the install wizard
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 +mysql5
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).
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
/opt/local/apache2/bin/apachectl restart
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. Install the Aegir files
==========================
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"
do the following instead.
Shell commands::
su - aegir
Password: (you know the drill)
sh /path/to/install.sh.txt
sudo /usr/sbin/apachectl restart
exit
Now you really can just follow the rest of INSTALL.txt and it should
work.
......@@ -68,6 +68,12 @@ Since Aegir strongly depends on Drush, we therefore depend on PHP 5.2 or
above. You also need to have the commandline version of PHP to run Drush
properly and the MySQL extensions.
Note that Drupal's support for PHP 5.3 is still under development.
Currently, using PHP 5.3 will cause (innocuous) warnings on every page
load. As a result, we suggest using PHP 5.2 for the time-being.
See http://drupal.org/node/360605 (amongst other issues) for details.
Database server
---------------
......@@ -164,7 +170,7 @@ Shell commands as root::
a2enmod rewrite
ln -s /var/aegir/config/apache.conf /etc/apache2/conf.d/aegir.conf
That user needs to have sudo access. The wizard will explain you how to
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.
......
......@@ -38,7 +38,7 @@ Shell commands::
export AEGIR_VERSION=HEAD
export DRUPAL_DIR=/var/aegir/hostmaster-$AEGIR_VERSION
export OLD_DRUPAL_DIR=/var/aegir/hostmaster-0.4-alpha6
export DRUSH_VERSION=All-versions-3.0-rc4
export DRUSH_VERSION=All-versions-3.0
export DRUSH_MAKE_VERSION=6.x-2.0-beta6
This document also assumes drush is installed properly and we use an
......
......@@ -5,7 +5,10 @@
*/
function provision_backupmigrate_provision_apache_dir_config($data = null) {
return <<<EOF
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule sites/%{SERVER_NAME}/files/backup_migrate - [F]
RewriteRule files/backup_migrate - [F]
</IfModule>
EOF;
}
......@@ -28,7 +28,7 @@ function drush_provision_drupal_provision_delete() {
_provision_recursive_delete(d()->root . '/sites/' . d()->uri);
// we remove the aliases even if redirection is enabled as a precaution
// if redirection is enabled, keep silent about errors
_provision_drupal_delete_aliases(drush_get_option('aliases', array()), drush_get_option('redirection'));
_provision_drupal_delete_aliases(drush_get_option('aliases', array(), 'site'), drush_get_option('redirection'));
drush_set_option('installed', FALSE, 'site');
}
if (d()->type === 'platform') {
......
......@@ -102,6 +102,7 @@ function install_send_welcome_mail($url, $account, $profile, $language, $client_
}
function install_mail($key, &$message, $params) {
global $profile;
switch ($key) {
case 'welcome-admin':
// allow the profile to override welcome email text
......
......@@ -53,6 +53,7 @@ function install_send_welcome_mail($url, $profile, $language, $client_email) {
function install_mail($key, &$message, $params) {
global $profile;
switch ($key) {
case 'welcome-admin':
// allow the profile to override welcome email text
......
<?php
/**
* Rename command implementation
*
* This command when called will
* 1. Make a backup of the current site, before modifications are made.
* 2. Execute 'provision deploy' to build the new site using the backup of the old site.
* 3. Delete the old site.
*
*/
/**
* Make sure we have a valid site being renamed, and that the site being renamed exists
*/
function drush_provision_drupal_provision_rename_validate($url = null, $new_url = null, $platform = null) {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
}
/**
* Make a backup before making any changes, and add extract the file we are restoring from
*/
function drush_provision_drupal_pre_provision_rename($url, $new_url, $platform = null) {
drush_invoke('provision-backup', $url);
}
/**
* Remove the extracted site directory
*/
function drush_provision_drupal_pre_provision_rename_rollback($url, $new_url, $platform = null) {
d()->service('file')->unlink(drush_get_option('backup_file'))
->succeed('Removed unused rename site package')
->fail('Could not remove unused site package');
}
/**
* Switch the rename directories around now that we have the new db installed
*/
function drush_provision_drupal_provision_rename($url, $new_url, $platform = null) {
# note that we reset the aliases so they don't conflict with the original site
drush_backend_invoke('provision-deploy', array(
$new_url,
drush_get_option('backup_file'),
'root' => $platform,
'aliases' => drush_get_option('aliases'),
'redirection' => drush_get_option('redirection'),
'web_host' => drush_get_option('web_host'),
'web_ip' => drush_get_option('web_ip'),
'db_host' => drush_get_option('db_host')
));
}
function drush_provision_drupal_post_provision_rename($url) {
/* @TODO: sort this out.. to do a drush_backend_invoke means
* that drush_save_config($context) gets called.. somehow?
* and it tries to write to the drushrc.php of the old site
* that's been deleted
*/
drush_invoke("provision-delete", $url);
}
......@@ -90,14 +90,18 @@ function drush_provision_drupal_post_provision_verify() {
* @see hook_provision_apache_dir_config()
*/
function provision_drupal_provision_apache_dir_config($data = null) {
$htaccess = file_get_contents(d()->root . '/.htaccess');
$htaccess .= <<<EOF
$htaccess = <<<EOF
<IfModule mod_rewrite.c>
RewriteEngine on
# allow files to be accessed without /sites/fqdn/
RewriteRule ^files/(.*)$ /sites/%{HTTP_HOST}/files/$1 [L]
</IfModule>
EOF;
$htaccess .= file_get_contents(d()->root . '/.htaccess');
$htaccess .= <<<EOF
# Do not read the platform's .htaccess
AllowOverride none
......
......@@ -35,8 +35,6 @@
* unlock - Unlock a platform so that sites can be provisioned on it.
*
* login_reset - Generate a one-time login reset URL.
*
* Not implemented yet :
* rename - Change the url of a site. This requires moving of files, and numerous other issues.
*/
......@@ -208,6 +206,13 @@ function provision_drush_command() {
'example.com' => dt('The url of the site being migrated.')),
);
$items['provision-rename'] = array(
'description' => 'Rename a site.',
'arguments' => array('domain.com' => dt('The domain to rename. Any outstanding updates will be run.'),
'new.domain.com' => dt('The new domain name to use.')),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
return $items;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment