(Last Updated On: March 16, 2019)

Welcome to our guide on how to install Open Web Analytics on RHEL 8 / CentOS 8. Open Web Analytics(OWA) is an open source web analytics software used to track and analyze websites and applications usage by end users. It enables developers and website owners to add analytics to web pages using simple PHP, Javascript, or REST based APIs.

OWA also comes with built-in support for tracking websites made with popular content management frameworks such as WordPress and MediaWiki. Follow steps provided here to install and configure Open Web Analytics on your RHEL 8 server.

Open Web Analytics Software requirements

The main software requirements of Open Web Analytics are:

  • Nginx/Apache web server
  • MariaDB database server
  • PHP with PCNTL and mysql extensions.

Step 1: Install Nginx/Apache Web Server

We need either Nginx or Apache web server to host OWA application. We had earlier written an article on how to install Apache web server on RHEL 8 / CentOS 8.

How to Install Apache with mod_ssl & mod_http2 on RHEL 8

Step 2: Install PHP and required extensions

The Open Web Analytics engine is mainly written in PHP and you’ll need to install it and some extensions prior to OWA setup. Follow our guide below to install PHP on RHEL 8 / CentOS 8.

How to Install PHP on RHEL 8 / CentOS 8

Ensure PCNTL and mysqlnd PHP extensions are installed.

sudo yum -y install php-mysqlnd php-pcntl

Verify PHP installation.

$ php -v
PHP 7.2.11 (cli) (built: Oct 9 2018 15:09:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Step 3: Install and Configure Database Server

You can choose to use MySQL or MariaDB database server. if you don’t have either installed, below guides should be helpful.

How to Install MySQL 8.0 on RHEL 8 / CentOS 8

How to Install MariaDB on RHEL 8 / CentOS 8

After Database server installation, create database and user for OWA.

$ mysql -u root -p
CREATE DATABASE owa;
GRANT ALL ON owa.* TO 'owa'@'localhost' IDENTIFIED BY 'StrongDBPassword';
FLUSH PRIVILEGES;
exit

Step 4: Install Open Web Analytics (OWA) on RHEL 8 / CentOS 8

Now that we have all the required dependencies installed, we can proceed to download and install Open Web Analytics. Check the Github releases page for the recent version.

sudo yum -y install wget
export VER="1.6.2"
wget https://github.com/padams/Open-Web-Analytics/archive/$VER.tar.gz

Uncompress Downloaded archive.

tar xvf $VER.tar.gz

Create owa directory inside /var/www/html directory.

sudo mkdir /var/www/html/owa

Move extracted contents to created directory.

cd Open-Web-Analytics*/
sudo mv * /var/www/html/owa

Set directory permissions to apache user and group.

sudo chown -R apache:apache  /var/www/html/owa/

Create and Apply SELinux policy

sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/owa(/.*)?"
sudo restorecon -Rv /var/www/html/owa

Restart httpd service and

sudo systemctl restart httpd

Step 5: Access Open Web Analytics (OWA) Web UI

Open your server IP and /owa path.

Click on “Let’s Get Started” to start the installation. Provide database details on the next page.

Follow next wizard to set the username and finish Open Web Analytics installation on RHEL 8 / CentOS 8.

Similar Articles:

How to install Matomo (Piwik) Web Analytics Tool on Ubuntu

How to Install Fathom website analytics tool on Ubuntu / CentOS / Arch Linux