Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-04-19, 19:53:17

Author Topic: Awstats + GeoIP  (Read 30677 times)

0 Members and 1 Guest are viewing this topic.

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Awstats + GeoIP
« on: 2013-07-18, 21:57:45 »
In Awstats 90% of my (Domains/Countries) is Unknown from [ip] and other (10%) are from [net], [com], [de] and [uk]

This issue is related to DNSLookup.

First I edit '/home/apache/etc/conf/httpd.conf' for add "HostnameLookups On" on it but I lend that enabled DNSLookup will reduce dramatically AWStats update process speed. So I try enable geoip plugin on my Awstats.

I edit '/usr/local/lxlabs/kloxo/file/awstats.model.conf' and add below line on it:
LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat"

Before that I must install GeoIP on kloxo-mr.

In php5.4 I try 'yum install php54-pecl-geoip' and:
Code: [Select]
Downloading Packages:
php54-pecl-geoip-1.0.8-3.ius.el6.x86_64.rpm                                |  13 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : php54-pecl-geoip-1.0.8-3.ius.el6.x86_64                                        1/1
  Verifying  : php54-pecl-geoip-1.0.8-3.ius.el6.x86_64                                        1/1

Installed:
  php54-pecl-geoip.x86_64 0:1.0.8-3.ius.el6

Complete!
In secondary php I try 'sh /script/lxphp-module-install php52-pecl-geoip' but:
Code: [Select]
No Match for argument php52-pecl-geoip
Nothing to download
rpm2cpio: *.rpm: No such file or directory
cpio: premature end of archive
Now how can I install GeoIP for secondary php and what path should I enter instead "/pathto/GeoIP.dat" for php5.4 and secondary php?
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Awstats + GeoIP
« Reply #1 on: 2013-07-18, 22:44:13 »
I've was never able to install any additional modules for secondary php :/

This seems to compiled and does not accept any additional modules installed via yum.

Solution ?

Compile php52 on a different machine with modules you need then copy all files to your Kloxo-MR folder.
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Awstats + GeoIP
« Reply #2 on: 2013-07-19, 00:24:12 »
Quote from: "Spacedust"
I've was never able to install any additional modules for secondary php :/

This seems to compiled and does not accept any additional modules installed via yum.

Solution ?

Compile php52 on a different machine with modules you need then copy all files to your Kloxo-MR folder.
Have you try 'sh /script/lxphp-module-install'?.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Re: Awstats + GeoIP
« Reply #3 on: 2013-07-19, 00:41:21 »
Quote from: "MRatWork"
Have you try 'sh /script/lxphp-module-install'?.

Quote from: "WISTFUL"
In secondary php I try 'sh /script/lxphp-module-install php52-pecl-geoip' but:
Code: [Select]
No Match for argument php52-pecl-geoip
Nothing to download
rpm2cpio: *.rpm: No such file or directory
cpio: premature end of archive

Also 'sh /script/lxphp-module-install php52-geoip' has same result.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Awstats + GeoIP
« Reply #4 on: 2013-07-19, 00:43:48 »
It doesn't work - and it's really annoying :/
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Re: Awstats + GeoIP
« Reply #5 on: 2013-07-19, 00:49:00 »
1. What is default directory of modules for primary and secondary php in kloxo-mr?
After 'yum install php54-pecl-geoip', below files added in my kloxo:
/usr/local/lxlabs/ext/php/etc/php.d/geoip.ini
/usr/local/lxlabs/ext/php/lib/geoip.so

2. If client use secondary php, Is secondary php based module requirement for running Awstats for it?

3. What path should I enter instead "/pathto/GeoIP.dat" (LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat") in '/usr/local/lxlabs/kloxo/file/awstats.model.conf'?
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline WISTFUL

  • Senior Member
  • *
  • Posts: 247
  • Karma: +0/-0
    • View Profile
Re: Awstats + GeoIP
« Reply #6 on: 2013-07-19, 01:08:41 »
#sh /script/lxphp-module-install

- Check '/usr/local/lxlabs/ext/php/error.log' after testing with
  'lxphp.exe -m'
Code: [Select]
[18-Jul-2013 19:05:45] PHP Warning:  PHP Startup: geoip: Unable to initialize module
Module compiled with module API=20100525, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
 in Unknown on line 0
- Certain modules need 'extension=/usr/local/lxlabs/ext/php/lib/xxx.so'
  rather than 'extension=xxx.so' inside their ini file on
  '/usr/local/lxlabs/ext/php/etc/php.d')
Code: [Select]
[18-Jul-2013 19:01:52] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lxlabs/ext/php/lib//usr/local/lxlabs/ext/php/lib/geoip.so' - /usr/local/lxlabs/ext/php/lib//usr/local/lxlabs/ext/php/lib/geoip.so: cannot open shared object file: No such file or directory in Unknown on line 0
« Last Edit: 1970-01-01, 01:00:00 by Guest »
.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Awstats + GeoIP
« Reply #7 on: 2013-07-19, 01:20:12 »
You have wrong geoip.so version. Delete /usr/local/lxlabs/ext/php/lib//usr/local/lxlabs/ext/php/lib/geoip.so and /usr/local/lxlabs/ext/php/etc/php.d/geoip.ini first. And then install php52-geoip with 'sh /script/lxphp-module-install php52-pecl-geoip'.

I am not sure pecl module running well on lxphp.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Awstats + GeoIP
« Reply #8 on: 2013-07-19, 01:24:18 »
Module installed, but not listed in php -m. Why ?

lxphp.exe -m
[PHP Modules]
bcmath
bz2
ctype
curl
date
dba
dom
exif
filter
ftp
gd
gettext
gmp
hash
iconv
imap
ionCube Loader
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
ncurses
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
posix
readline
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SourceGuardian
SPL
SQLite
standard
sysvsem
sysvshm
tidy
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend Optimizer
zip
zlib

[Zend Modules]
SourceGuardian
Zend Optimizer
the ionCube PHP Loader
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Awstats + GeoIP
« Reply #9 on: 2013-07-19, 01:25:49 »
./etc/php.d/geoip.ini
./usr/lib64/php/modules/geoip.so
./usr/share/doc/php52-pecl-geoip-1.0.8
./usr/share/doc/php52-pecl-geoip-1.0.8/ChangeLog
./usr/share/doc/php52-pecl-geoip-1.0.8/README
./usr/share/pear/.pkgxml/php52-pecl-geoip.xml
60 blocks
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Awstats + GeoIP
« Reply #10 on: 2013-07-19, 01:35:18 »
Same to me:

Code: [Select]
[18-Jul-2013 21:32:01] PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
[18-Jul-2013 21:32:32] PHP Warning:  PHP Startup: geoip: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
 in Unknown on line 0
[18-Jul-2013 21:32:32] PHP Warning:  PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
 in Unknown on line 0
[18-Jul-2013 21:32:32] PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
[18-Jul-2013 21:32:32] PHP Warning:  PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
 in Unknown on line 0
[18-Jul-2013 21:32:32] PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Awstats + GeoIP
« Reply #11 on: 2013-07-19, 01:37:30 »
Quote from: "Spacedust"
./etc/php.d/geoip.ini
./usr/lib64/php/modules/geoip.so
./usr/share/doc/php52-pecl-geoip-1.0.8
./usr/share/doc/php52-pecl-geoip-1.0.8/ChangeLog
./usr/share/doc/php52-pecl-geoip-1.0.8/README
./usr/share/pear/.pkgxml/php52-pecl-geoip.xml
60 blocks
Hi, this directories refer to primary php.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Awstats + GeoIP
« Reply #12 on: 2013-07-19, 01:39:33 »
Remember, lxphp only using by kloxo and as secondary php when website using secondary.

Website, webmail, cp, disable and default using primary php.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Awstats + GeoIP
« Reply #13 on: 2013-07-19, 01:41:29 »
So lxphp-module-install installs something wrong.
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Awstats + GeoIP
« Reply #14 on: 2013-07-19, 01:52:34 »
The only solution is to:

- take another machine with any php version
- download php52 modules manually with wget
- install them with rpm -UvH --force --no-deps filename.rpm
- copy old modules from /usr/lib64/php/modules from test machine to /usr/local/lxlabs/ext/php/lib on production machine
- make sure that revalant files exists in /usr/local/lxlabs/ext/php/etc/php.d exists

works for me !
« Last Edit: 1970-01-01, 01:00:00 by Guest »

 


Top 10 Social Networking:    Facebook    Twitter    LinkedIn    Pinterest    Google Plus    Tumblr    Instagram    VK    Flickr    Vine

Page created in 0.031 seconds with 18 queries.

web stats analysis