{"componentChunkName":"component---node-modules-gatsby-theme-blog-core-src-templates-post-query-js","path":"/fix-piwik-after-dsm6-update/","result":{"data":{"site":{"siteMetadata":{"title":"one melo a day","social":[{"name":"twitter","url":"https://twitter.com/melo0187"},{"name":"github","url":"https://github.com/melo0187"}]}},"blogPost":{"__typename":"MdxBlogPost","id":"452c8961-03cc-5f64-bb2b-1eb34800b2de","excerpt":"How to fix Piwik after updating to DSM 6","body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"layout\": \"post\",\n  \"title\": \"DSM 6 Adventures: Fixing Piwik\",\n  \"author\": \"melo\",\n  \"date\": \"2016-05-15T15:35:45.000Z\",\n  \"categories\": [\"analytics\", \"DiskStation\", \"Technical\"],\n  \"slug\": \"fix-piwik-after-dsm6-update\",\n  \"excerpt\": \"How to fix Piwik after updating to DSM 6\",\n  \"draft\": false,\n  \"meta_title\": \"DSM 6 Adventures: Fixing Piwik\"\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"I was and still am using \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://melo.myds.me/wordpress/piwik-and-wordpress-on-synology-dsm\"\n  }), \"Piwik to track my blog\\u2019s visits\"), \". However, updating to DSM 6 messed with the Piwik installation and I had to tinker a little to get it back running. If you care how I restored Piwik after the DSM 6 update, read on.\"), mdx(\"h2\", {\n    \"id\": \"piwiks-unfinished-update\"\n  }, \"Piwik\\u2019s Unfinished Update\"), mdx(\"p\", null, \"Once the DSM 6 update finished, I wasn\\u2019t able to access the Piwik web interface anymore. When trying to, I was greeted by a file not found (HTTP 404) error page instead. Reason for this was that the  \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"https://melo.myds.me/piwik\"), \"  URL was redirected to another address looking something like this:  \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"https://melo.myds.me/piwik/index.php?module=CoreUpdater&attr=\"), \" . There is something obviously wrong with that URL and so the 404 error seems legit. Getting around this issue was easy. I simply removed the last, undefined URL parameter and accessed this URL  \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"https://melo.myds.me/piwik/index.php?module=CoreUpdater\"), \"  instead. What this does is start the DB upgrade process. Once this process is done, Piwik is up and running again and can be used through its web interface as usual. However, the GeoIP location provider installed before the DSM update is not installed anymore. Reason being is that the GeoLite database was deleted. So I had to download the GeoLite database file and move it into  \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"/volume1/web/piwik/misc/\"), \"  to get more accurate locations tracked again.\"), mdx(\"h2\", {\n    \"id\": \"re-enable-tracking\"\n  }, \"Re-Enable Tracking\"), mdx(\"p\", null, \"The one site I track visits for with Piwik is this very blog. I do so with the use of the \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://wordpress.org/plugins/wp-piwik/\"\n  }), \"WP-Piwik plugin\"), \". Although I finished the Piwik update and Piwik itself was running again, tracking my blog visits was still not working. The reason for this is a combination of two things:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"I used Piwik\\u2019s js/index.php tracking code (find out more \", mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"http://demo.piwik.org/js/README\"\n  }), \"here\"), \")\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Synology\\u2019s NGINX config does not allow access to  \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"https://melo.myds.me/piwik/js/index.php\"), \" \")), mdx(\"p\", null, \"After failing to rewrite the NGINX configuration for Piwik myself, I turned to Synology support and got this answer:\"), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, \"After some investigation with our development team, we\\u2019ve confirmed it\\u2019s a new issue caused by the nginx in current version. We will fix the issue then release the new version of package as soon as possible.\")), mdx(\"p\", null, \"I am still waiting for an update to take care of this issue. As of today (the 15th of May 2016) the problem still persists. As a workaround I had no other option than changing WP-Piwik\\u2019s settings and use Piwik\\u2019s default tracking code, which uses the tracking code accessed through  \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"https://melo.myds.me/piwik/piwik.php\"), \" . This way I loose the benefits that come with using the js/index.php approach, but at least I can track my blog visits again!\"), mdx(\"h3\", {\n    \"id\": \"update-10th-of-june\"\n  }, \"Update: 10th of June\"), mdx(\"p\", null, \"Synology released updates for both the Web Station and their Piwik package. I do not know which of the two packages actually solves the problem, but after applying these updates I am now able to access piwiks tracking code in js/index.php.\"), mdx(\"h2\", {\n    \"id\": \"end-of-journey\"\n  }, \"End of Journey\"), mdx(\"p\", null, \"This was the third and final post in my DSM 6 Adventures series. Everything I used to do with my DiskStation on DSM 5.2 is now working again and DSM 6 itself is running without any issues and sports some nice new features. Speaking of new features: In my next post I will describe the use of the new Let\\u2019s Encrypt integration for easy certificate creation in combination with the new reverse proxy feature. This allows for easy HTTPS access to your DiskStation, even for your applications running on Tomcat, without the hassle of manual procedures.\"));\n}\n;\nMDXContent.isMDXComponent = true;","slug":"/fix-piwik-after-dsm6-update/","title":"DSM 6 Adventures: Fixing Piwik","tags":[],"keywords":[],"date":"May 15, 2016"},"previous":{"__typename":"MdxBlogPost","id":"813587e7-b54b-5e14-82e0-f7d624874c71","excerpt":"The Tomcat configurations you can lose during the DSM 6 Update","slug":"/tomcat-configs-to-backup-for-dsm6-update/","title":"DSM 6 Adventures: Restoring Tomcat","date":"May 01, 2016"},"next":{"__typename":"MdxBlogPost","id":"cc61ba89-f4d5-568a-900c-3dbf978095ae","excerpt":"How to use DSM 6 reverse proxy for easy HTTPS access to Tomcat","slug":"/reverse-proxy-tomcat-for-https/","title":"Reverse Proxy Tomcat for easy HTTPS","date":"May 27, 2016"}},"pageContext":{"isCreatedByStatefulCreatePages":false,"id":"452c8961-03cc-5f64-bb2b-1eb34800b2de","previousId":"813587e7-b54b-5e14-82e0-f7d624874c71","nextId":"cc61ba89-f4d5-568a-900c-3dbf978095ae"}}}