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