How to install Logaholic on CentOS

Logaholic is a web analytics software that provides reliable information on traffic, content, keywords, etc. from the websites installed on your CentOS VPS.

This installation guide assumes that Apache, MySQL and PHP are already installed and configured on your server. At the time of this writing, the latest stable version is Logaholic 6.0 and requires:

  • PHP 5 or higher with cURL and Zip extensions enabled. The output_buffering setting must be disabled and allow_url_fopen and display_errors settings must be enabled in php.ini
  • Apache or Nginx web server
  • MySQL 5.0 or higher installed on your Linux VPS.

Let’s start by installing Logaholic SHE (self-contained edition). Download the latest version of Logaholic available at ‘http://www.logaholic.com/download/‘to the server and extract it using the following commands:

cd /opt/
wget -O logaholic.tar.gz http://www.logaholic.com/download.php?file=logaholic_she_600.tar.gz
tar -xvzf logaholic.tar.gz
mkdir -p /var/www/html/logaholic
mv logaholic_she_600/logaholic /var/www/html

Download GeoLite Legacy Database from http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz and then extract and copy this file to directory ‘/ var / www / html / logaholic / components / geoip / ‘ on server:

wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
mv GeoLiteCity.dat /var/www/html/logaholic/components/geoip/

Change the file permissions so your web server can write to the ‘/ var / www / html / logaholic’ directory and subdirectories:

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

Edit the Apache config file (default ‘/etc/httpd/conf/httpd.conf’) and define the Apache log file in the following format:

CustomLog /your_path/access_log "%h %l %u %t "%r" %s %b "%{Referer}i"
"%{User-Agent}i""

In general, this is enough:

CustomLog /your_path/access_log "combined"

Please note that each Apache virtual host must have its own log file. Find your PHP configuration file using the following command:

#php -i | grep php.ini
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini

Modify the ‘php.ini’ file and add / change the following lines:

allow_url_fopen = On 
display_errors = On 
output_buffering = off

Create a new Apache virtual host directive. For example, edit the Apache config file (‘/etc/httpd/conf/httpd.conf’ by default) and uncomment the following line:

#NameVirtualHost *:80

Then, add the following lines at the end:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/logaholic/
ServerName yourdomain.ru
ServerAlias www.yourdomain.ru
<Directory /var/www/html/logaholic/>
    Options FollowSymLinks
    AllowOverride All
</Directory>
    ErrorLog logs/yourdomain.ru-error_log
    CustomLog logs/yourdomain.ru-access_log combined
</VirtualHost>

Restart the Apache web server again for the changes to take effect:

service httpd restart

Create a new MySQL database for Logaholic on the server:

mysql -u root -p
mysql> CREATE DATABASE logaholicdb;
mysql> GRANT ALL PRIVILEGES ON logaholicdb.* TO 'logaholicuser'@'localhost' IDENTIFIED BY 'свой-пароль' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> quit

Remember to replace your-password with a strong password.

Set MySQL server timezone:

mysql -u root -p
mysql> SET GLOBAL time_zone="-06:00";
mysql> FLUSH PRIVILEGES;
mysql> quit

We populate the time zone tables using the following command:

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

Open http://yourdomain.com/install.php in your web browser and follow the simple instructions: enter your database parameters and administrator login credentials, and then click the “Save” button. If all settings in “Database Options” “Mysql Settings”, “File Access Verification” and “PHP Settings” should be highlighted in green, click the “Continue” button.

All. The Logaholic installation is complete. Log in to the admin area at http://yourdomain.com/login.php and go to the “global settings” tab to configure post-installation tasks like adding a password, etc.

Sidebar