Open Web Analytics (OWA): Install & Launch on Your Server
Traducciones al EspañolEstamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Open Web Analytics (OWA) is an open-source alternative to commercial web analytics software. Use it to track and analyze traffic on your websites and applications. OWA analytics can easily be added to pages with simple Javascript, PHP, 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.
Before you Begin
This guide assumes that you have your Linode already set up and running, that you have followed:
- The Getting Started guide.
- The Securing Your Server guides.
- That the Linode’s hostname is set and has a FQDN.
Note
The steps required in this guide require root privileges. Be sure to run the steps below as root or with the
sudo
prefix. For more information on privileges see our Users and Groups guide.Your server must be configured with a fully qualified domain name (FQDN) and not just an IP address. If needed, you can use the address provided in the Networking tab next to your public IP address.
Make sure your system is up-to-date:
CentOS
yum update
Debian & Ubuntu
apt-get update && apt-get upgrade
Install the supporting software packages:
CentOS
yum install httpd php php-mysql mysql-server mariadb-server
Note
This command is designed to work with CentOS 6, which uses MySQL as the default database and CentOS 7 which uses MariaDB. You will get a notice when installing that the other package is not available.Debian & Ubuntu
apt-get install apache2 php5 php5-mysql mysql-server
CentOS users will need to enable and activate the
httpd
andmariadb
services:CentOS 7
systemctl enable mariadb systemctl start mariadb systemctl enable httpd systemctl start httpd
CentOS 6
chkconfig mysqld on service mysqld start chkconfig httpd on service httpd start
Debian and Ubuntu users will need to restart the Apache2 daemon:
service apache2 restart
Set up MySQL
Run
mysql_secure_installation
to secure your database:mysql_secure_installation
You should answer yes to most of the prompts. CentOS users, make sure to set a strong password for the root user since it is initially blank. This is the root user for
mysql
and is not related to the system’s root user.Enter the MySQL CLI:
mysql -u root -p
You’ll need to enter the password you set in the step above, or when you installed
mysql-server
.Create a database named
owadb
:1
CREATE DATABASE owadb;
Create a user named
owadbuser
. Replace the example password,owadbpassword
, with a strong password of your choice. This information will be needed later to configure OWA.1
GRANT ALL PRIVILEGES ON owadb.* TO owadbuser@localhost IDENTIFIED BY 'owadbpassword';
Exit the MySQL CLI:
1
FLUSH PRIVILEGES;
quit
OWA
Install
Navigate to your document root folder for your webserver, usually
/var/www/html
by default.:cd /var/www/html
Download the OWA package:
wget https://github.com/padams/Open-Web-Analytics/archive/1.5.7.tar.gz
Note
Version 1.5.7 is the current version and may be different by the time you read this. Please check The Open Web Analytics site for the latest information.Unpack the downloaded file:
tar xf 1.*.tar.gz
Change ownership of the
owa
folder to the Apache daemon user:CentOS
chown -R apache:apache Open*
Debian & Ubuntu
chown -R www-data:www-data Open*
Recommended: Rename the OWA folder:
mv Open-Web-Analytics-1.5.7 owa
Delete the tar file:
rm -rf 1.*.tar.gz
Configure
Navigate to the OWA installation page in your web browser. Replace
your.domain
with your Linode’s IP address or FQDN:http://your.domain/owa/
After clicking on Let’s Get Started, you should see a configuration page for your OWA installation. OWA will automatically fill in the first field with the path to your OWA installation. You will need to fill in the other fields on the page with the information you set in the MySQL CLI:
Click Continue….
Create a user account and define a domain to track. You will log in to see your OWA statistics through this user account.
Caution
This process will display your password in plaintext once complete. Be careful if performing these steps in a public location.
Using OWA
You will need to create site profiles and add JavaScript or PHP code to your website pages to use OWA.
Log in to your OWA installation. In your browser go to:
http://your.domain/owa/index.php
The first time you login OWA will present you with a tracking tag (a code snippet) for the domain you defined when you created your user account. This code should be added to the html pages of the site you wish to track.
Once the tracking tag has been added to your website pages, analysis data can be viewed under the “Reporting” section (click the button at the top of the page) which will take you to the Sites Roster page.
To add more sites to track, click “Add New” at the top left of the page.
On the resulting page you will see near the top a section named “Add a New Tracked Site Profile”. Enter the domain name of the site you want to track and click Save Profile. The other two fields are for your information only and are, therefore, optional.
Caution
You must click “Save Profile” before trying to enter any of the settings below this button. Failure to do so will result in a blank white page and your new site not being added. Recovery simply requires a click of the back button in your browser.Click on “Reporting” in the top left corner to return to the Sites Roster page. In the list of tracked sites, find your new site and click “Get Tracking Code”.
Copy the tracking code in the language of your choice (JavaScript or PHP) and paste the code into your websites' pages. Now whenever someone loads a page with the tracking code, OWA will know about it and the data will show up in the reports.
Click “View Reports” in the Sites Roster page and begin happy analyzing!
More Information
You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.
This page was originally published on