Setting up cron fails

This is the error report:

Querying Piwik API at:
Running Piwik 1.10.1 as Super User: Marbot
ERROR: The Piwik URL 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>
<H1>Authorization Required</H1>
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)

Require valid-user
Allow from
Satisfy Any

That way, everybody has to login except localhost.

Thank you for the tip. Just by reading the instructions on I would believe that this should work. However, reality is different. This setting allows everybody to access the login page for Piwik. :frowning:

Hmm, a quick test in a directory with such an .htaccess file works for me:

AuthType Basic
  AuthName "Restricted"
  AuthUserFile .passwd
  Require user test
  Order allow,deny
  Allow from
  Satisfy any

If I access 127.0.01, I can access the folder. If I access the IP, I am asked for a password. Should work.

Other idea:
Create a second instance of piwik but bind it only to localhost.

Btw. this might be interesting for you too in that regard:,99506

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! :slight_smile:

I don’t know if you’re still trying to solve this problem, but the following worked for me:

Restrict outside access

AuthGroupFile /dev/null
AuthType Basic
AuthUserFile /path/to/user/.htpasswd/public_html/stats/.htpasswd
AuthName “name”

<Files “*”>
Require valid-user

In order to run archive.php as a cron job:

<Files “*”>
Order allow,deny
Allow from x.x.x.x #IP address of your server
Satisfy any

It’s important to have this after the previous rule.

<Files ~ “^piwik.(js|php)|robots.txt$”>
Allow from all
Satisfy any

I’ve tried, and that didn’t work. Then I’ve changed it to the actual IP address of the server, and now it works.