Commit d1274217 authored by drumm's avatar drumm Committed by Neil Drumm

Move http server verify up a class. Use the correct file service. More cluster multiplexing.

parent 79327dc1
...@@ -40,39 +40,20 @@ class provisionService_http_apache extends provisionService_http { ...@@ -40,39 +40,20 @@ class provisionService_http_apache extends provisionService_http {
} }
function create_server_config() { function create_server_config() {
d()->service('file')->create_dir($this->apache_site_conf_path, dt("Virtual host configuration"), 0700); $this->server()->service('file')->create_dir($this->apache_site_conf_path, dt("Virtual host configuration"), 0700);
d()->service('file')->create_dir($this->apache_platform_conf_path, dt("Platforms configuration"), 0700); $this->server()->service('file')->create_dir($this->apache_platform_conf_path, dt("Platforms configuration"), 0700);
d()->service('file')->create_dir($this->apache_conf_path , dt("Apache configuration"), 0700); $this->server()->service('file')->create_dir($this->apache_conf_path , dt("Apache configuration"), 0700);
d()->service('file')->sync($this->apache_conf_path); $this->server()->service('file')->sync($this->apache_conf_path);
$config = new provisionConfig_apache_server($this->context); $config = new provisionConfig_apache_server($this->context);
return $config->write(); return $config->write();
} }
function delete_server_config() { function delete_server_config() {
$config = new provisionConfig_apache_server($this->context); $config = new provisionConfig_apache_server($this->context);
$config->unlink(); $config->unlink();
} }
function verify() {
switch (d()->type) {
case 'server':
$this->create_server_config();
break;
case 'platform':
$this->create_platform_config();
break;
case 'site':
$this->create_site_config();
break;
}
$this->parse_configs();
}
function parse_configs() { function parse_configs() {
// This is required to be configurable, due to the fact that different // This is required to be configurable, due to the fact that different
// hosts might need to do this differently. // hosts might need to do this differently.
...@@ -95,7 +76,7 @@ class provisionConfig_apache_server extends provisionConfig_apache { ...@@ -95,7 +76,7 @@ class provisionConfig_apache_server extends provisionConfig_apache {
public $description = 'apache server configuration file'; public $description = 'apache server configuration file';
function filename() { function filename() {
return $this->config_path . '/' . 'apache.conf'; return $this->config_path . '/apache.conf';
} }
function process() { function process() {
......
...@@ -16,13 +16,45 @@ class provisionService_http_cluster extends provisionService_http { ...@@ -16,13 +16,45 @@ class provisionService_http_cluster extends provisionService_http {
} }
} }
function verify() {
$this->parse_configs();
}
function parse_configs() { function parse_configs() {
foreach ($this->servers as $server) { foreach ($this->servers as $server) {
$server->service('http')->parse_configs(); $server->service('http')->parse_configs();
} }
} }
function create_site_config() {
foreach ($this->servers as $server) {
$server->service('http')->create_site_config();
}
}
function delete_site_config() {
foreach ($this->servers as $server) {
$server->service('http')->delete_site_config();
}
}
function create_platform_config() {
foreach ($this->servers as $server) {
$server->service('http')->create_platform_config();
}
}
function delete_platform_config() {
foreach ($this->servers as $server) {
$server->service('http')->delete_platform_config();
}
}
function create_server_config() {
foreach ($this->servers as $server) {
$server->service('http')->create_server_config();
}
}
function delete_server_config() {
foreach ($this->servers as $server) {
$server->service('http')->delete_server_config();
}
}
} }
...@@ -27,6 +27,24 @@ class provisionService_http extends provisionService { ...@@ -27,6 +27,24 @@ class provisionService_http extends provisionService {
$this->setProperty('web_maintenence_url', $this->master_url .'/hosting/maintenance'); $this->setProperty('web_maintenence_url', $this->master_url .'/hosting/maintenance');
} }
function verify() {
switch ($this->server()->type) {
case 'server':
$this->create_server_config();
break;
case 'platform':
$this->create_platform_config();
break;
case 'site':
$this->create_site_config();
break;
}
$this->parse_configs();
}
/** /**
* Ask the web server to check for and load configuration changes. * Ask the web server to check for and load configuration changes.
*/ */
......
...@@ -83,6 +83,7 @@ class provisionConfig { ...@@ -83,6 +83,7 @@ class provisionConfig {
} }
function write() { function write() {
drush_log(get_class($this));
$filename = $this->filename(); $filename = $this->filename();
// Make directory structure if it does not exist. // Make directory structure if it does not exist.
if (!$this->owner()->service('file')->exists(dirname($filename))->status()) { if (!$this->owner()->service('file')->exists(dirname($filename))->status()) {
......
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