Forums / Setup & design / Apache/View count : Incompatible with host config

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

eZ debug

Timing: Jan 19 2025 00:56:53
Script start
Timing: Jan 19 2025 00:56:54
Module start 'content'
Timing: Jan 19 2025 00:56:54
Module end 'content'
Timing: Jan 19 2025 00:56:54
Script end

Main resources:

Total runtime0.7755 sec
Peak memory usage4,096.0000 KB
Database Queries203

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 590.2344180.8125
Module start 'content' 0.00720.6515 771.0469585.7266
Module end 'content' 0.65870.1167 1,356.7734341.3672
Script end 0.7754  1,698.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4988210.0002
Check MTime0.00150.1895210.0001
Mysql Total
Database connection0.00080.103010.0008
Mysqli_queries0.696489.79792030.0034
Looping result0.00210.26782010.0000
Template Total0.742995.820.3714
Template load0.00170.215620.0008
Template processing0.741295.577320.3706
Template load and register function0.00010.012610.0001
states
state_id_array0.00170.217410.0017
state_identifier_array0.00090.110320.0004
Override
Cache load0.00140.1791400.0000
Sytem overhead
Fetch class attribute can translate value0.00100.131430.0003
Fetch class attribute name0.00110.137580.0001
XML
Image XML parsing0.00360.464730.0012
class_abstraction
Instantiating content class attribute0.00000.0023120.0000
General
dbfile0.00490.6295350.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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