Apache/View count : Incompatible with host config

Author Message

H-Works Agency

Tuesday 03 March 2009 4:26:36 am

Hello,

I am trying to make view_count work but its not easy.

The problem is that my apache server logs node url_alias instead of "hard" ezpublish url's (ex: "content/view/full/2") so the cronjob doesn't count them.

How can i make apache log the correct url ? What am i missing here ?

Thanx in advance for anyhelp.

EZP is Great

Ivo Lukac

Tuesday 03 March 2009 5:52:04 am

Hi Martin,

It should work with url_aliases also. Trick is to correctly set SitePrefix[] variable in logfile.ini according to apache access log.

For example if you have siteaccess 'foo':
SitePrefix[]=foo\/

(slash needs to be escaped with backslash)

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

H-Works Agency

Tuesday 03 March 2009 6:43:50 am

Hello Ivo,

Thanx for your answer but my log aren't considered when they use the "url_alias".

When i use the "content/view/full/2" for exemple my view count is updated but not when i use the url_alias.

Are you shure we can use the url_alias ? Is there a special format to respect for the apache log file ?

EZP is Great

H-Works Agency

Tuesday 03 March 2009 7:54:37 am

Ok you are right view_count can work with url_alias.

My problem seems related to the fact that my website uses the hostname siteaccess config (and not the siteprefix) so my url are not recognized correctly in the cronjob.

Given this hostname config, do you know how should i configure the logfile.ini ?

Thanx in advance

EZP is Great

Ivo Lukac

Wednesday 04 March 2009 3:08:49 am

Hm, I have several webs with this working ok, but none of them is hostname based siteaccess so maybe there is some problem with it.

There is an simiral open issue:
http://issues.ez.no/IssueView.php?Id=13516&activeItem=2

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

H-Works Agency

Wednesday 04 March 2009 3:21:20 am

Yes i fact its the same issue.

The final word is that updatecountview default cronjob isn't compatible with a host access config.

You have to create your own cronjob with $fristElement = $array[1] instead of [0]

Would have been nice from EZTeam to document this issue to prevent time waist digging code.

Thanx

EZP is Great

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:11:10
Script start
Timing: Jan 18 2025 19:11:10
Module start 'layout'
Timing: Jan 18 2025 19:11:10
Module start 'content'
Timing: Jan 18 2025 19:11:11
Module end 'content'
Timing: Jan 18 2025 19:11:11
Script end

Main resources:

Total runtime1.1582 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0083 588.0469152.6406
Module start 'layout' 0.00830.0057 740.687539.4922
Module start 'content' 0.01391.1413 780.1797580.6328
Module end 'content' 1.15520.0029 1,360.812516.1250
Script end 1.1581  1,376.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3539160.0003
Check MTime0.00180.1583160.0001
Mysql Total
Database connection0.00100.084310.0010
Mysqli_queries1.058291.3645660.0160
Looping result0.00130.1131640.0000
Template Total1.103695.320.5518
Template load0.00220.191220.0011
Template processing1.101395.091920.5507
Template load and register function0.00020.013310.0002
states
state_id_array0.00500.430810.0050
state_identifier_array0.00350.302320.0018
Override
Cache load0.00170.1462400.0000
Sytem overhead
Fetch class attribute can translate value0.00170.145720.0008
Fetch class attribute name0.00290.249880.0004
XML
Image XML parsing0.00270.231820.0013
class_abstraction
Instantiating content class attribute0.00000.0026120.0000
General
dbfile0.00130.1105240.0001
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs