Installing PIWIK and Upgrading PHP

Tags linux

Audience

staff 

Overview

This guide provides detailed steps for installing and testing PIWIK, upgrading PHP, and setting up Python on a Windows Server 2012 R2 environment. It covers the installation process using IIS Manager, verifying configurations, and ensuring compatibility with Matomo. Additionally, it includes instructions for installing Python to facilitate IIS log imports into PIWIK and lists recommended third-party plugins to enhance tracking, security, and performance.

 

Steps for Installing/Testing PIWIK & Upgrading PHP.

 

System requirements:
Windows Server 2012 R2Hardware platform that can support Windows Server 2012 R2/Virtual EnvironmentIIS 6 or above

  1. Logon to the server with administrator rights.
  2. Search for VC redistributable 2015 x86 or click this link: (https://www.microsoft.com/en-us/download/details.aspx?id=48145). Even though the OS may be 64bit you MUST use the x86 version.
  3. Download and save the file. Run the file to install.
  4. Open [Server Manager] and select "Add Roles and Features"
  5. Under Server Roles select "Web Server (IIS)" Nothing else.
  6. When the install is finished close the window and open IIS Manager
  7. On the left side Locate the server and click it.
  8. On the right side you will see an Icon "Get New Web Platform Components" click that and it will take you to the Microsoft website to download the package.
  9. Locate the GREEN {FREE DOWNLOAD} button to download the package.
  10. Save the file on the local hard drive. I used the desktop
  11. Now you can close the browser windows and IIS Manager.
  12. Run the downloaded file "wpilauncher.exe".
  13. When the Program opens you will see a search box on the top right side. Type in the box "PIWIK" without the quotes. And press enter.
  14. You will see only one result with a date of 11/2/2015. Click ADD and on the bottom click "Install".
  15. You will be prompted for a SQL [sa] account password. Use our standard administrator account password.
  16. The next screen identifies what software programs will be downloaded and installed. Click "I Accept"
  17. The process will take some time depending on your Internet Speed.
  18. The next screen displays the PIWIK configuration page. We use all the defaults. Click "Continue".
  19. The last screen displays the results from the install. Click "Finish"
  20. When asked to copy the results to the clipboard select the "copy to clipboard option and save the results in a .txt file. You will need this information when setting up PIWIK.
  21. If everything installed correctly it will attempt to open the main page for the PIWIK program. If you receive the main page you have successfully installed PIWIK. DO NOT configure PIWIK from the "localhost" site. Change the site name to the actual site name then setup. The reason for this is that code that is created is done using the site you are running the setup from. So if you are running from localhost, then the code will reference localhost and the website would be unable to communicate data correctly.

Steps for Upgrading/Installing a newer version of PHP

  1. Logon to the server with administrator rights.
  2. Open IIS Manager
  3. On the left side Locate the server and click it.
  4. On the right side you will see an Icon "Get New Web Platform Components"
  5. When the Program opens you will see a search box on the top right side. Type in the box "PHP" without the quotes. And press enter.
  6. Locate the version of PHP you desire to install. For our purposes we are upgrading to the most recent version 7.0.0. Select PHP 7.0.0 (x64). Click Add. This will install both x86 and x64 versions
  7. Once you have clicked Add you are ready to install. Click Install and the program will download all the required options. Some of these will not properly install, but those options we do NOT require (PHP manager for IIS). It will install (Windows Cache Extension 2.0 for PHP 7.0 (x64)).
  8. The installation process is complete and now we need to tell the website to use it.
  9. Using IIS Manager Highlight the website on the left side.
  10. Locate the "Handler Mappings" on the right and double click it.
  11. You should see multiple PHP entries. The newest one should be labeled "PHP_via_FastCGI". To verify this double click that entry and look at the Executable path. It should point to the new PHP folder you just installed. If the path is correct click "OK" if it is not correct modify it to point to where you installed PHP.
  12. The most important step is to modify the order in which the handlers are used. On the right side you will see an option for "View Ordered List". Click that to view the current order.
  13. We must move the NEW PHP entry higher than the previous PHP entries. This will force PIWIK to use the newer version.
  14. After you are done making changes we need to check that PIWIK is properly using the new PHP version.
  15. Using a browser of your choice Open the PIWIK site you have created.
  16. Login with administrator access to PIWIK.
  17. On the top right hand corner locate the spoke wheel to access the administrator functions.
  18. Onn the left bottom side you will see the option for a "System Check". Click that option.
  19. The very first line should identify your PHP version.







Steps for Installing Python
Phython is used in importing IIS log files into the PIWIK sites. Phython must first be installed to import.

  1. Go to the website listed and download Phython.
    1. https://www.python.org/downloads/
    2. Ensure you download the version for your system (I.E. Windows 2.7.11)
  2. The install process will ask you to confirm a couple settings
    1. Install for All Users, click NEXT
    2. Leave the path alone, click NEXT
    3. Ensure you add the Phython to the PATH, click NEXT
    4. Click FINISH


Plugins to be used
For best performance and a more detailed identification of visitor activities the below third party plugins were added to the normal default PIWIK installation.

  1. AdminNotification: Allows for a message to be placed on all user dashboards. This can be used to pass technical information concerning scheduled maintenance.
  2. BotTracker: Detects bots & spiders and counts their visits without tracking them in the visitor log.
  3. CustomDimensions: Extend Piwik to your needs by defining and tracking Custom Dimensions in scope Action or Visit.
  4. FreeMobileMessaging: Mobile Messaging Plugin: Free Mobile support.
  5. IP2Location: Use IP2Location geolocation database to lookup for accurate visitor location in Piwik.
  6. Ip2Hostname: Piwik plugin to get the hostname from the visitor IP.
  7. LogViewer: View Log messages logged by PIWIK.
  8. LoginLDAP: Login plugin with LDAP authentication. Provides an alternative to the standard Piwik Login plugin.
  9. PerformanceInfo: Piwik plugin to check if the settings are good for security/performance.
  10. PlatformsReport: New report in Visitors > Platforms that aggregates visits based on device type, OS version & browser version.
  11. ReferrersManager: This plugin allows to view and manage search engines and social networks that are recognized with Piwik.
  12. ReportPublisher: Publish Piwik reports to external systems using various protocols. Please consult the changelog for available protocols.
  13. SecurityInfo: Based on PhpSecInfo from the PHP Security Consortium, this plugin provides security information about your PHP environment and offers suggestions for improvement. It is a tool in a multilayered security approach. It does not replace secure development practices nor audit the code/application.
  14. TrackingCodeCustomizer: The provided values will replace the defaults in the generated tracking code (leave blank to use defaults). Viewing https://github.com/piwik/piwik/blob/master/core/Tracker/TrackerCodeGenerator.php is recommended to deconstruct how the tracking code is built.
  15. TreemapVisualization: This Piwik plugin adds a new report visualization: the treemap.
  16. kDeBug: Activate or deactivate DEBUG tracking mode with a simple click.

 

Feedback and Concerns:

If you have any feedback regarding this article, please reach out to hsitkb@pitt.edu.  You can also leave a comment below as well.