[Solved] (tu) Piwik on Nginx vhost and import logs

Hello all,

I’ve just installed Piwik on a Nginx vhost. I’ve set Piwik to the url of my server, by default (= I access to my Piwik going to the IP of my server).
I want Piwik to import logs from my other vhost.I get troubles importing logs.

Of course, logs of Piwik are in a different folder than my other vhosts logs.

Here is my Nginx conf


worker_processes 2;
user www-data;

events {
    worker_connections 1024;
}

http {
     log_format vhosts '$host $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';


  server {

    error_page 405 = $uri;
    error_page 404 = myerrorpage.html;
    server_name piwik.myhost.com;
    root /var/www/piwik/;
    index index.php; 
    listen 80;
    allow all;
    access_log /var/www/piwik/log/access.log;

          location ~ \.php$ {
            fastcgi_pass   unix:/var/run/php5-fpm.sock;
            try_files $uri = 404;
            fastcgi_index  index.php;
            fastcgi_param SCRIPT_FILENAME /var/www/piwik/index.php;
            include fastcgi_params;              
            }

    }


     server {

    access_log /usr/local/openresty/nginx/logs/access.log vhosts;
    error_log /usr/local/openresty/nginx/logs/error.log;
    error_page 405 = $uri;
    error_page 404 = myerrorpage.html;
    server_name mywebsite.myhost.com;
    root /var/www/main-page/;
    index index.html;
    listen 80;
    allow all;

          location ~ \.php$ {
          fastcgi_pass   unix:/var/run/php5-fpm.sock;
            try_files $uri = 404;
            fastcgi_index  index.html;
            fastcgi_param SCRIPT_FILENAME /var/www/main-page/format.php;
            include fastcgi_params;              
          }
    }


2013-09-19 17:56:13,781: [DEBUG] No token-auth specified
2013-09-19 17:56:13,781: [DEBUG] No credentials specified, reading them from "/var/www/piwik/config/config.ini.php"
2013-09-19 17:56:13,782: [DEBUG] Using credentials: (login = Mathieu, password = 9d8d020065aeb95ee8433cdab8b5c68c)
2013-09-19 17:56:13,788: [DEBUG] Error when connecting to Piwik: HTTP Error 503: Service Unavailable
2013-09-19 17:56:15,794: [DEBUG] Error when connecting to Piwik: HTTP Error 503: Service Unavailable
2013-09-19 17:56:17,800: [DEBUG] Error when connecting to Piwik: HTTP Error 503: Service Unavailable

Note: I use the python script with --url=xxx.xx.xx.xxx which is my server containing a few vhost.
This is also the url of my Piwik installation.
But when I tried to set --url=the_server_name_of_my_website_Ive_defined_in_my_nginxconf I get an :

Does anyone have any idea about how to solve this problem please ?

Thanks in advance

Up !
I resolved my 503 error disabling the squid proxy.
Now I see some HTML when trying to import my logs.
Help please :frowning:


2013-09-19 18:39:55,101: [DEBUG] cannot parse tracker response, should be valid JSON
2013-09-19 18:39:55,101: [DEBUG] Error when connecting to Piwik: <urlopen error <!DOCTYPE html>

It looks like Piwik API is returning some error HTML ? check error logs ?

Solved: I re-installed my Piwik from GIT (v 2.0) and the log importer is working almost properly (nothing added in DB).
This problem is solved.
The next problem is this one : 301 Moved Permanently