14.8 C
Texas
Muhammad Nabeel
Network and System Administrator

Install Open Web Analytics on RHEL / CentOS 8

Open Web Analytics (OWA) is an open-source web analytics software created by Peter Adams. OWA is written in PHP and uses a MySQL database, which makes it compatible for running with a LAMP solution stack on various web servers. OWA is comparable to Google Analytics, though OWA is server software anyone can install and run on their own host, while Google Analytics is a software service offered by Google. So, OWA supports tracking with WordPress and MediaWiki, two popular web site frameworks. This application helps you keep track of and observe the influx of views on your website. The program also tracks your competitors and their company’s growth compared to yours.

So get ready and in this guide, you will learn how to install OWA on your server and set up your own web analytics tool.

Step 1: Install Apache, PHP

First, Install Apache webserver. As the root user, run the following commands

dnf install httpd -y
- Advertisement -

Now start and enable apache service on boot.

systemctl start httpd

systemctl enable httpd

Adding Apache ports in the firewall.

firewall-cmd --add-port={80/tcp,443/tcp} --permanent
firewall-cmd --reload

Then, install PHP

dnf install php php-common php-pecl-apcu php-curl php-gd php-xml php-json php-pcntl php-zip php-cli php-pear php-pdo php-mysqlnd php-pgsql php-gd php-mbstring php-opcache php-xml -y

Install MYSQL

dnf install mysql-server -y

Start and enable MYSQL service on boot.

systemctl start mysqld
systemctl enable mysqld

Secure the MYSQL installation using the mysql_secure_installation script:

mysql_secure_installation

Set root password? [Y/n] Y
New password: password
Re-enter new password: password
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

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

Then, log into the MySQL console using below command and type your password when asked.

mysql -u root -p

now create a new database

CREATE DATABASE openweb;

Now create a new MySQL user and grant it privileges on the created database. You can replace username and password with the username and password of your own choice.

CREATE USER ‘database_user’@’localhost’ IDENTIFIED BY ‘user_password’;
GRANT ALL PRIVILEGES ON database_name.* TO ‘database_user’@’localhost’;

Exit the MySQL console.

exit

Step 2: Install Open Web Analytics

First, install wget.

dnf install wget -y

Create owa directory ins /var/www/html/ path

mkdir /var/www/html/owa

Switch into owa directory

cd /var/www/html/owa

After that, Download Open Web Analytics (OWA)

wget https://github.com/padams/Open-Web-Analytics/archive/1.6.2.tar.gz

Uncompress Downloaded archive and move its content in owa directory.

tar xvf 1.6.2.tar.gz
cd Open-Web-Analytics*/
mv * /var/www/html/owa
cd ..
ls

Now set appropriate permissions for apache on owa directory.

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

Create and activate SELinux policy

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

So, restart Apache service

systemctl restart httpd

Step 3: Access Open Web Analytics (OWA) Web Interface

Open your browser and browse the path http://SERVER-IP/owa

Click on “Let’s Get Started” and proceed to installation. Enter database details on the next page.

Now type your domain name and set login credentials for OWA and click “Continue”

Then you will see below screen with success and your login information. Click on “Login and generate a site tracker”

So, you will be redirected to the login page, enter your login details

Finally, you will see below the dashboard of OWA (Open Web Analytics)

That’s it!

Also, you can read our post about CentOS

Please share and join our Telegram Channel.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article