diff --git a/manifests/init.pp b/manifests/init.pp index a3edf7b..a1c8dda 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -32,6 +32,7 @@ $enabled = true, $manage_apache = true, $manage_config = true, + $use_alias = true, $ip_access_ranges = ["${::network_eth0}/${::netmask_eth0}"], $preseed_package = $::phpmyadmin::params::preseed_package, $package_name = $::phpmyadmin::params::package_name, diff --git a/templates/config_header.inc.php.erb b/templates/config_header.inc.php.erb index 2264d16..e628caf 100644 --- a/templates/config_header.inc.php.erb +++ b/templates/config_header.inc.php.erb @@ -16,9 +16,9 @@ * This is needed for cookie based authentication to encrypt password in * cookie */ -include('/var/lib/phpmyadmin/blowfish_secret.inc.php'); -if (file_exists('/var/lib/phpmyadmin/config.inc.php')) { - include('/var/lib/phpmyadmin/config.inc.php'); +include('<%= "#{@data_dir}/blowfish_secret.inc.php" %>'); +if (file_exists('<%= "#{@data_dir}/config.inc.php" %>')) { + include('<%= "#{@data_dir}/config.inc.php" %>'); } $cfg['PropertiesIconic'] = <%= @properties_iconic %>; diff --git a/templates/phpMyAdmin.conf.erb b/templates/phpMyAdmin.conf.erb index 85ab402..4170cc4 100755 --- a/templates/phpMyAdmin.conf.erb +++ b/templates/phpMyAdmin.conf.erb @@ -7,8 +7,10 @@ # But allowing phpMyAdmin to anyone other than localhost should be considered # dangerous unless properly secured by SSL +<% if @use_alias -%> Alias /phpMyAdmin <%= @doc_path %> Alias /phpmyadmin <%= @doc_path %> +<% end -%> /> @@ -97,4 +99,4 @@ Alias /phpmyadmin <%= @doc_path %> SecRuleEngine Off -<% end %> \ No newline at end of file +<% end %>