This is the error report:
Querying Piwik API at: http://piwik.example.org/index.php
Running Piwik 1.10.1 as Super User: Marbot
ERROR: The Piwik URL http://piwik.example.org/index.php does not seem to be pointing to a Piwik server. Response was '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<TITLE>401 Authorization Required</TITLE>
This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.<P>
How do I provide the credentials? Help is most welcome. Cheers
Cron does not handle HTTP_AUTH authentication at this stage
Thank you for your reply.
If you have added authentication through .htaccess you could try something like this: (untested)
Allow from 127.0.0.1
That way, everybody has to login except localhost.
Thank you for the tip. Just by reading the instructions on apache.org I would believe that this should work. However, reality is different. This setting allows everybody to access the login page for Piwik.
Hmm, a quick test in a directory with such an .htaccess file works for me:
Require user test
Allow from 127.0.0.1
If I access 127.0.01, I can access the folder. If I access the IP, I am asked for a password. Should work.
Create a second instance of piwik but bind it only to localhost.
Btw. this might be interesting for you too in that regard:
Sadly, this does not work. I still get the authorisation error from cron. I cannot really believe that I should be the only one who is trying to set up piwik with access authorisation. However, it seems to be like it.
Hi Marbot, you’re not the only one who is using piwik with access authorisation!
I don’t know if you’re still trying to solve this problem, but the following worked for me:
Restrict outside access
In order to run archive.php as a cron job:
Allow from x.x.x.x #IP address of your server
It’s important to have this after the previous rule.
<Files ~ “^piwik.(js|php)|robots.txt$”>
Allow from all
I’ve tried 127.0.0.1, and that didn’t work. Then I’ve changed it to the actual IP address of the server, and now it works.