Commit 4da218a6 authored by Adrian Rossouw's avatar Adrian Rossouw
Browse files

Merge branch 'master' into dev-services

parents d6ef6b71 b0d90139
......@@ -156,8 +156,12 @@ you can place include that file in your apache.conf/httpd.conf. We
prefer the former. In other systems there are similar ways to accomplish
this. Consult your OS's documentation if unsure.
If you are on a Debian-based system, you will also need to enable the
mod_rewrite module manually.
Shell commands as root::
a2enmod rewrite
ln -s /var/aegir/config/apache.conf /etc/apache2/conf.d/aegir.conf
......@@ -212,9 +216,9 @@ the official release.). You can modify which version to install by editing the
AEGIR_VERSION variable in the script.
The install script is shipped with other default settings that you will likely
need to change (such as the URL of the Aegir site) prior to running it.
need to change, especially the value of AEGIR_DOMAIN to match the URL of your site.
You can change which release to install or other parameters such as these
You can also change which release to install or other parameters such as these
through options passed to the script. Run "sh install.sh.txt -h" for more
information on the available options.
......
......@@ -171,5 +171,10 @@ To read :
Include /var/aegir/config/apache.conf
You will also need to create the following directories :
/var/aegir/config/platform.d
/var/aegir/config/apache.d
Now log into Aegir, and verify the hostmaster platform. This will generate
the correct apache.conf file and restart apache.
......@@ -22,7 +22,12 @@ endif;
LoadModule rewrite_module modules/mod_rewrite.so
</IfModule>
# virtual hosts
Include <?php print $config_path ?>/vhost.d/
# platforms
Include <?php print $config_path ?>/platform.d/
# other configuration, not touched by aegir
Include <?php print $config_path ?>/apache.d/
<?php print $extra_config; ?>
......@@ -139,6 +139,7 @@ fi
msg "Creating basic directory structure"
mkdir -p $AEGIR_HOME/config/vhost.d
mkdir -p $AEGIR_HOME/config/platform.d
mkdir -p $AEGIR_HOME/config/apache.d
mkdir -p $AEGIR_HOME/backups
chmod 0711 $AEGIR_HOME/config
chmod 0700 $AEGIR_HOME/backups
......@@ -207,8 +208,12 @@ NameVirtualHost *:80
LoadModule rewrite_module modules/mod_rewrite.so
</IfModule>
# virtual hosts
Include $AEGIR_HOME/config/vhost.d/
# platforms
Include $AEGIR_HOME/config/platform.d/
# other configuration, not touched by aegir
Include $AEGIR_HOME/config/apache.d/
EOF
fi
......
......@@ -447,10 +447,6 @@ function provision_find_packages() {
$packages['profiles'][$profile] = _provision_find_packages('profiles', $profile);
}
// Iterate through the sites, finding site specific packages
foreach (drush_get_option('sites', array()) as $site) {
$packages['sites'][$site] = _provision_find_packages('sites', $site);
}
return $packages;
}
......@@ -503,6 +499,11 @@ function provision_drupal_system_map() {
$packages['profiles'][$profile]->status = 1;
foreach (_provision_system_query("module") as $module) {
$frags = explode("/", $module->filename);
// ignore site-specific modules
if ($frags[0] == 'sites' && $frags[1] != 'all') {
continue;
}
$info_file = sprintf("%s/%s.info", dirname($module->filename), $module->name);
$module->info = provision_parse_info_file($info_file);
......@@ -516,7 +517,13 @@ function provision_drupal_system_map() {
drush_log(dt("Found !count modules", array('!count' => sizeof($packages['modules']))));
// XXX: mostly a copy-paste from above
foreach (_provision_system_query("theme") as $theme) {
$frags = explode("/", $theme->filename);
// ignore site-specific themes
if ($frags[0] == 'sites' && $frags[1] != 'all') {
continue;
}
$info_file = sprintf("%s/%s.info", dirname($theme->filename), $theme->name);
$theme->info = provision_parse_info_file($info_file);
_provision_cvs_deploy($theme);
......@@ -573,7 +580,7 @@ function _provision_drupal_find_modules($scope, $key = '') {
$source = str_replace("\r\n", "\n", $source);
$source = str_replace("\r", "\n", $source);
$function_matches = array();
preg_match_all('!function\s*&?([a-zA-Z0-9_]+)_update_([0-9]+)\(.*?\s*\{!', $source, $function_matches);
preg_match_all('!function\s*&?([a-zA-Z0-9_]+)_update_([0-9]+)\s*\(.*?\s*\{!', $source, $function_matches);
if (sizeof($function_matches[0])) {
$schema_version = max($function_matches[2]);
......
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php
# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
# There is no end quote below, for compatibility with Apache 1.3.
ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>
# Set the default handler.
DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
# PHP 4, Apache 1.
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
<FilesMatch \.php$>
# Do not allow PHP scripts to be cached unless they explicitly send cache
# headers themselves. Otherwise all scripts would have to overwrite the
# headers set by mod_expires if they want another caching behavior. This may
# fail if an error occurs early in the bootstrap process, and it may cause
# problems if a non-Drupal PHP file is installed in a subdirectory.
ExpiresActive Off
</FilesMatch>
</IfModule>
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
# allow files to be accessed without /sites/fqdn/
RewriteRule ^files/(.*)$ /sites/%{HTTP_HOST}/files/$1 [L]
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
......@@ -88,9 +88,14 @@ function drush_provision_drupal_post_provision_verify($url = NULL) {
* @see hook_provision_apache_dir_config()
*/
function provision_drupal_provision_apache_dir_config($data = null) {
$htaccess = file_get_contents(dirname(__FILE__) . "/provision_drupal_htaccess.tpl.php");
$htaccess = file_get_contents(drush_get_option('publish_path') . '/.htaccess');
$htaccess .= <<<EOF
<IfModule mod_rewrite.c>
# allow files to be accessed without /sites/fqdn/
RewriteRule ^files/(.*)$ /sites/%{HTTP_HOST}/files/$1 [L]
</IfModule>
# Do not read the platform's .htaccess
AllowOverride none
......
......@@ -28,10 +28,12 @@ function provision_ssl_provision_apache_vhost_config($url, $options) {
$config = new provisionConfig_ssl_vhost(drush_get_merged_options());
$config->write();
}
return array("php_value session.cookie_secure 1", "SSLEngine On");
} else {
return NULL;
$newoptions = $options;
$newoptions['site_port'] = 443;
$newoptions['extra_config'] = "php_value session.cookie_secure 1\nSSLEngine On\n";
provision_write_config(drush_get_option('vhost_path') . '/' . $url . '_443', _provision_apache_default_template(), $newoptions);
}
return NULL;
}
class provisionConfig_ssl_vhost extends provisionConfig {
......
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