From 01fc5b781d785222e18019d0485ae8160d097c3c Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Mon, 6 Feb 2012 14:39:25 -0800 Subject: [PATCH] Fixing up apache log locations for rhel. --- conf/horizon/000-default.tpl | 4 ++-- devstack/components/horizon.py | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/conf/horizon/000-default.tpl b/conf/horizon/000-default.tpl index e77c4fcb..219b7c0e 100644 --- a/conf/horizon/000-default.tpl +++ b/conf/horizon/000-default.tpl @@ -26,9 +26,9 @@ allow from all - ErrorLog /var/log/apache2/error.log + ErrorLog %ERROR_LOG% LogLevel warn - CustomLog /var/log/apache2/access.log combined + CustomLog %ACCESS_LOG% combined diff --git a/devstack/components/horizon.py b/devstack/components/horizon.py index 3983a5f8..aedbd622 100644 --- a/devstack/components/horizon.py +++ b/devstack/components/horizon.py @@ -39,8 +39,8 @@ HORIZON_APACHE_CONF = '000-default' #http://wiki.apache.org/httpd/DistrosDefaultLayout APACHE_CONF_TARGETS = { - settings.UBUNTU11: ['/', 'etc', 'apache2', 'sites-enabled', '000-default'], - settings.RHEL6: ['/', 'etc', 'httpd', 'conf.d', '__horizon-default.conf'], + settings.UBUNTU11: '/etc/apache2/sites-enabled/000-default', + settings.RHEL6: '/etc/httpd/conf.d/__horizon-000-default.conf', } CONFIGS = [HORIZON_PY_CONF, HORIZON_APACHE_CONF] @@ -60,6 +60,16 @@ APACHE_RESTART_CMD = ['service', '%SERVICE%', 'restart'] APACHE_START_CMD = ['service', '%SERVICE%', 'start'] APACHE_STOP_CMD = ['service', '%SERVICE%', 'stop'] APACHE_STATUS_CMD = ['service', '%SERVICE%', 'status'] +APACHE_LOG_LOCATIONS = { + settings.RHEL6: { + 'ERROR_LOG': '/var/log/httpd/error_log', + 'ACCESS_LOG': '/var/log/httpd/access_log', + }, + settings.UBUNTU11: { + 'ERROR_LOG': '/var/log/apache2/error.log', + 'ACCESS_LOG': '/var/log/apache2/access.log', + } +} #users which apache may not like starting as BAD_APACHE_USERS = ['root'] @@ -95,9 +105,8 @@ class HorizonInstaller(comp.PythonInstallComponent): def _get_symlinks(self): src = self._get_target_config_name(HORIZON_APACHE_CONF) - tgt = APACHE_CONF_TARGETS[self.distro] links = dict() - links[src] = sh.joinpths(*tgt) + links[src] = APACHE_CONF_TARGETS[self.distro] return links def _check_ug(self): @@ -194,6 +203,7 @@ class HorizonInstaller(comp.PythonInstallComponent): mp['GROUP'] = group mp['HORIZON_DIR'] = self.appdir mp['HORIZON_PORT'] = self.cfg.get('horizon', 'port') + mp.update(APACHE_LOG_LOCATIONS[self.distro]) else: #Enable quantum in dashboard, if requested mp['QUANTUM_ENABLED'] = "%s" % (settings.QUANTUM in self.instances)