Config-files include from private directory

Hello together

I’ve just installed piwik successfully on my Webspace.

Is it possible to include the config-files (config.ini.php & global.ini.php) from a directory outside the public directory?

So, that the directory of the config-files would be:
Old: /home/www/webxxx/html/piwik/config
New: /home/www/webxxx/files/piwik/config

Regards,
Jeffrey

Yes. Use bootstrap.php.

See: http://dev.piwik.org/trac/wiki/API/IncludePiwikInYourProject

Hello vipsoft

thx for your fast answer!

Sry, I’ve expressed myself wrong. I would like to more secure piwik by moving the config-files of piwik to a private directory outside the public html directory.

Is that possible?

Regards,
Jeffrey

I’m posting from my phone so my response was perhaps too terse.

The answer is YES. Use bootstrap.php to define PIWIK_USER_PATH to point to where you moved both the config and tmp folders. This is explained in:

http://dev.piwik.org/trac/wiki/API/IncludePiwikInYourProject

So, I did:

  1. make the file bootstrap.php in the piwik root directory
  2. copy the /config and the /tmp folder to /home/www/webxxx/files/piwik (with file same file rights)
  3. fill the bootstrap.php with:
<?php define('PIWIK_USER_PATH', "/home/www/webxxx/files/piwik"); ?>

But now, I get the error message “unable to read resource: “CoreHome/templates/header.tpl”” when I like to open Piwik.

What did i false ?

Regards,
Jeffrey

Do you have open basedir restrictions?

Yes, there are some, but I don’t know which in specific.
The php safe mode is off

Update: I sent you the PHPinfo as a PM. I hope this help to find the solution.

Ah. Ok. This is now fixed in SVN: http://dev.piwik.org/trac/changeset/1752

Hello vipsoft

thx for your fast help.
The change of view.php was the solution. Now it works correctly!

I wish you a happy new year :=)

Regards,
Jeffrey