Quantcast
Channel: Piwik Forums - Support & Bugs
Viewing all articles
Browse latest Browse all 4243

Piwik on Nginx vhost and import logs (no replies)

$
0
0
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;              
          }
    }


/usr/local/openresty/nginx/conf# python /var/www/piwik/misc/log-analytics/import_logs.py --url=xxx.xx.xx.xxx /usr/local/openresty/nginx/logs/access.log --log-format-name=common_complete --idsite=4 --enable-http-redirects --enable-http-errors           
0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
Parsing log /usr/local/openresty/nginx/logs/access.log...
213 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
213 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
213 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
213 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
Fatal error: <!DOCTYPE html>
[...] some html code [...]
You can restart the import of "/usr/local/openresty/nginx/logs/access.log" from the point it failed by specifying --skip=0 on the command line.

usr/local/openresty/nginx/conf# python /var/www/piwik/misc/log-analytics/import_logs.py --url=xxx.xx.xx.xxx /usr/local/openresty/nginx/logs/access.log --log-format-name=common --idsite=4 --enable-http-redirects --enable-http-errors         
0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
Parsing log /usr/local/openresty/nginx/logs/access.log...

Logs import summary
-------------------

    0 requests imported successfully
    0 requests were downloads
   219 requests ignored:
   219 invalid log lines
        0 requests done by bots, search engines, ...
        0 HTTP errors
        0 HTTP redirects
        0 requests to static resources (css, js, ...)
        0 requests did not match any known site
        0 requests did not match any requested hostname

Website import summary
----------------------

    0 requests imported to 1 sites
        1 sites already existed
        0 sites were created:

    0 distinct hostnames did not match any existing site:



Performance summary
-------------------

    Total time: 0 seconds
    Requests imported per second: 0.0 requests per second

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 :

2013-09-18 17:18:52,463: [DEBUG] Accepted hostnames: all
2013-09-18 17:18:52,463: [DEBUG] Piwik URL is: the_server_name_of_my_website_Ive_defined_in_my_nginxconf
2013-09-18 17:18:52,463: [DEBUG] No token-auth specified
2013-09-18 17:18:52,463: [DEBUG] No credentials specified, reading them from "/var/www/piwik/config/config.ini.php"
2013-09-18 17:18:52,464: [DEBUG] Using credentials: (login = MyLogin, password = 9d8d020065aeb95ee8433cdab8b5c68c)
2013-09-18 17:18:52,574: [DEBUG] Error when connecting to Piwik: HTTP Error 503: Service Unavailable
2013-09-18 17:18:54,580: [DEBUG] Error when connecting to Piwik: HTTP Error 503: Service Unavailable
2013-09-18 17:18:56,587: [DEBUG] Error when connecting to Piwik: HTTP Error 503: Service Unavailable
Fatal error: Service Unavailable

Also, I don't know if that really matter but I have this on piwik webiste:
Erreur:
Try #1: LOAD DATA INFILE : SQLSTATE[HY000]: General error: 13 Can't get stat of '/var/www/piwik/tmp/assets/piwik_option-9949d66490105cf7288b71d6e095f860.csv' (Errcode: 13),
Try #2: LOAD DATA LOCAL INFILE : SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version[42000]



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

Thanks in advance

Viewing all articles
Browse latest Browse all 4243

Trending Articles