summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Rossouw2010-07-14 08:00:38 +0200
committerAdrian Rossouw2010-07-14 08:00:38 +0200
commit22d78ef5e060b14a0780c60e567931b103886e3d (patch)
treeedd9f1de1a7db62e904dd8009751101af4614f0f
parent6d1b8c709e40ef700868523f63c9bb2b90d84baa (diff)
Use wildcard vhosts if no IP's are defined. Failing that use the first IP for all standard non SSL vhosts.dev-ssl
-rw-r--r--http/apache/server.tpl.php4
-rw-r--r--http/http.drush.inc11
-rw-r--r--http/http.ssl.inc7
3 files changed, 13 insertions, 9 deletions
diff --git a/http/apache/server.tpl.php b/http/apache/server.tpl.php
index 0654ed4..3b25afd 100644
--- a/http/apache/server.tpl.php
+++ b/http/apache/server.tpl.php
@@ -1,8 +1,8 @@
# Aegir web server configuration file
-NameVirtualHost *:<?php print $http_port; ?>
+NameVirtualHost <?php print $ip_address . ':' . $http_port; ?>
-<VirtualHost *:<?php print $http_port; ?>>
+<VirtualHost <?php print $ip_address . ':' . $http_port; ?>>
ServerName default
Redirect 404 /
</VirtualHost>
diff --git a/http/http.drush.inc b/http/http.drush.inc
index 23d3776..3675ba4 100644
--- a/http/http.drush.inc
+++ b/http/http.drush.inc
@@ -35,8 +35,15 @@ class provisionService_http_public extends provisionService_http {
// We assign this generic catch all for standard http.
// The SSL based services will override this with the
// correct ip address.
- $data['ip_address'] = '*';
-
+ if (sizeof($this->server->ip_addresses)) {
+ // Use the first IP address for all standard virtual hosts.
+ $data['ip_address'] = $this->server->ip_addresses[0];
+ }
+ else {
+ // If no external ip addresses are defined, we fall back on *:port
+ // There will be no SSL , so that's fine.
+ $data['ip_address'] = '*';
+ }
// TODO: move away from drush_get_context entirely.
if ($config == 'site') {
diff --git a/http/http.ssl.inc b/http/http.ssl.inc
index 2637f4d..90b088c 100644
--- a/http/http.ssl.inc
+++ b/http/http.ssl.inc
@@ -170,7 +170,7 @@ class provisionService_http_ssl extends provisionService_http_public {
// try to assign one
foreach ($server->ip_addresses as $ip) {
- if (!provisionService_http_ssl::get_ip_certificate($ip)) {
+ if (!provisionService_http_ssl::get_ip_certificate($ip, $server)) {
touch("{$path}/{$ssl_key}__{$ip}.receipt");
return $ip;
}
@@ -317,10 +317,7 @@ class provisionConfig_http_ssl_site extends provisionConfig_http_site {
$ip_addresses = drush_get_option('site_ip_addresses', array(), 'site');
if ($this->ssl_enabled && $this->ssl_key) {
- $path = dirname($this->data['ssl_cert']);
-
- $this->clear_certs();
-
+ $this->clear_certs($this->ssl_key);
}
elseif ($ip = $ip_addresses[$this->data['server']->name]) {
if ($ssl_key = provisionService_http_ssl::get_ip_certificate($ip, $this->data['server'])) {