~hashbrowncipher/percona-monitoring-plugins/lvm-snapshots-cruft

« back to all changes in this revision

Viewing changes to docs/cacti/installing-templates.rst

  • Committer: Roman Vynar
  • Date: 2014-03-20 07:59:24 UTC
  • Revision ID: roman.vynar@percona.com-20140320075924-l5h9uwzl6zzpxd5e
Fix for bug #1295006 Introduce more secure location of PHP script configs to harden a Cacti setup

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
--------------------
153
153
 
154
154
If you don't want to store the configuration options directly into the PHP
155
 
script file, you can create another file with the same name and the filename
156
 
extension ``.cnf``.  Place this in the same directory as the PHP script file,
157
 
and ensure it is valid PHP.  This file will be included by the PHP script file,
 
155
script file or you want to preserve your settings after the package update,
 
156
you can create another file with the same name and the filename
 
157
extension ``.cnf``.  Place this under ``/etc/cacti/`` and ensure it is valid PHP.
 
158
This file will be included by the PHP script file,
158
159
so you can define the same configuration options there that you might define in
159
160
the PHP script file.  For example, you might create
160
 
``scripts/ss_get_mysql_stats.php.cnf`` with the following contents::
 
161
``/etc/cacti/ss_get_mysql_stats.php.cnf`` with the following contents::
161
162
 
162
163
   <?php
163
164
   $mysql_user = "root";
179
180
 
180
181
Securing Your Setup
181
182
-------------------
182
 
Ensure that any files under  ``scripts/`` are not accessible from Web.
 
183
You can also place ``.cnf`` file in the same directory as the PHP script file
 
184
(just to keep the backward compatibility)
 
185
but this is a security risk as ``scripts/`` folder falls under the web directory.
 
186
So ``/etc/cacti/`` is the recommended location for ``.cnf`` file.
 
187
In any case, ensure that any files under ``scripts/`` are not accessible from Web.
183
188
Check out :ref:`Hardening Cacti setup <hardening_cacti_setup>` guide.
184
189
 
185
190
Passing Command-Line Arguments