Problem since new version


(cout12) #1

Hello

I use one database hosted on a server by itself and each website has its own domains.com/piwik using the database hosted on the other server. I do this to avoid linking my websites to each other to people who look at my code.

Since the new version it doesnt seem to work. When I install a piwik on the same database it wont let me reuse the same tables. It always asks me to overwrite them.


(vipsoft) #2

Don’t rerun the installer. You’re getting that because there’s no config file in whatever website’s directory you’re working in.

Can you use soft-links? If so, you can soft-link to a shared piwik folder from each website’s directory.

If not, take a look at Include & Customize Piwik for your Project - Analytics Platform - Matomo Assuming you don’t have open_basedir restrictions, you would unzip piwik into each website’s directory. Then create a bootstrap.php file in each, and define PIWIK_USER_PATH and PIWIK_INCLUDE_PATH to point to the shared piwik folder.


(cout12) #3

I think i could use soft links. I dont know how though.

I also dont know what a bootstrap.php file is or where to put it


(vipsoft) #4

For soft-links, you’ll need shell access. If you’re using Apache, you also have to configure to FollowSymLinks.

Let’s say you have 3 websites located in these folders:


/home/cout12/public_html/website1
/home/cout12/public_html/website2
/home/cout12/public_html/website3

Let’s also say you already installed Piwik into website1:


/home/cout12/public_html/website1/piwik

Now, create softlinks, e.g.,


$ cd ~/public_html/website2; ln -s ~/public_html/website1/piwik
$ cd ~/public_html/website3; ln -s ~/public_html/website1/piwik


(cout12) #5

The thing is my piwik is hosted on a different hosting account. And I have many different hosting accounts. From what the Arvixe support told me it is not possible to create soft-links from one account to another.

What are my other options?


(vipsoft) #6

You could simply:

unzip Piwik into each hosting account’s website folder.
copy the config/config.ini.php file over to each website’s piwik/config/ folder.

But there are some downsides:

  • set up something like rsync to keep the config/ and tmp/cache/tracker/ folders synchronized across hosting accounts
  • for a software update, you have to manually update the software on the other hosting accounts (or again, use something like rsync)

Another option would be to copy piwik.js and libs/PiwikTracker/PiwikTracker.php to each hosting account’s website folder.
Then create a proxy script (called “piwik.php”) that forwards the tracking request to the real “piwik.php” on whatever hosting account hosts your Piwik installation, e.g.,


<?php
require_once 'PiwikTracker.php';

$idsite = $_GET['idsite'];
$trackerUrl = 'http://website1.example.com/piwik/piwik.php';
$tokenAuth = 'XXXXXXXXXX';

$tracker = new PiwikTracker();
$tracker->setIp($_SERVER['REMOTE_ADDR']);
$tracker->sendRequest($trackerUrl . '?' . $_SERVER['QUERY_STRING']);


(Matthieu Aubry) #7

vipsoft, the fact that now we don’t ask for ‘overwriting’ - could it be a side effect of changing the number of tables minimum to pass the test?