From ae89a368c3cb4572a4d4f920329c72b8805423ce Mon Sep 17 00:00:00 2001 From: Matthew Oliver Date: Sun, 12 Jan 2014 18:29:25 +1100 Subject: [PATCH] Adding apache redirect for the cacti url. As cacti is currently simply being installed via the package manager, there is no vhosts file. I have added the apache rewrite rule to apache.conf file that comes with the ubuntu/ debian package. When accessing the root of the cacti site (cacti.openstack.org) you will now be redirected to cacti.o.o/cacti/graph_view.php. I.E: RewriteRule ^/$ /cacti/graph_view.php [R,L] Note, in new deployments the guest user needs to be enabled otherwise all you'll see is a login screen. Change-Id: I5242c9daf2ef105b2f685f9f6b2dc4509f9c5dc2 --- .../openstack_project/files/cacti/apache.conf | 30 +++++++++++++++++++ modules/openstack_project/manifests/cacti.pp | 13 ++++++++ 2 files changed, 43 insertions(+) create mode 100644 modules/openstack_project/files/cacti/apache.conf diff --git a/modules/openstack_project/files/cacti/apache.conf b/modules/openstack_project/files/cacti/apache.conf new file mode 100644 index 0000000000..361facfa30 --- /dev/null +++ b/modules/openstack_project/files/cacti/apache.conf @@ -0,0 +1,30 @@ +# ************************************ +# Managed by Puppet +# ************************************ + +Alias /cacti /usr/share/cacti/site + +RewriteEngine on +RewriteRule ^/$ /cacti/graph_view.php [R,L] + + + Options +FollowSymLinks + AllowOverride None + order allow,deny + allow from all + + AddType application/x-httpd-php .php + + + php_flag magic_quotes_gpc Off + php_flag short_open_tag On + php_flag register_globals Off + php_flag register_argc_argv On + php_flag track_vars On + # this setting is necessary for some locales + php_value mbstring.func_overload 0 + php_value include_path . + + + DirectoryIndex index.php + diff --git a/modules/openstack_project/manifests/cacti.pp b/modules/openstack_project/manifests/cacti.pp index 9ee3f7db8a..a467b431f8 100644 --- a/modules/openstack_project/manifests/cacti.pp +++ b/modules/openstack_project/manifests/cacti.pp @@ -11,10 +11,23 @@ class openstack_project::cacti ( include apache + a2mod { 'rewrite': + ensure => present, + } + package { 'cacti': ensure => present, } + file { '/etc/apache2/conf-available/cacti.conf': + ensure => present, + source => 'puppet:///modules/openstack_project/cacti/apache.conf', + mode => '0644', + owner => 'root', + group => 'root', + require => Package['cacti'], + } + file { '/usr/local/share/cacti/resource/snmp_queries': ensure => directory, owner => 'root',