How to handle multiple sites?
tamhas - March 2, 2009 - 02:04
| Project: | BAWStats |
| Version: | 6.x-1.1 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I have three sites all running from the same Drupal code base under the same account with the same provider. I have implemented awstats independent of Drupal and have files like /var/log/httpd/bstw_access_log, /var/lib/awstats/awstats022009.bstw.txt, and /etc/awstats/awstats.bstw.conf to support the bstw.com site (one site is the default for this account and doesn't have those site-specific names). I'm guessing this is not going to work with the setup that I see for BAWSTATS.
Would I be correct that I am going to have to reconfigure awstats to put things in separate directories or I am out of luck? I'm not very comfortable doing that.

#1
I also have all sites with one code only, do you have then solved this task?
#2
No solution yet. It appears like the only answer is to reconfigure awstats to use separate directories instead of simple file names. Thus far, it hasn't been compelling to me to put in that effort ... in part since I don't have a clear idea of what advantage I will gain from the Drupal module.
#3
for example any single user of the site can see stats about him nodes and things only about them nodes, it's very nice, to show them big advantages to be in that site.
#4
OK, but that doesn't happen to apply to any of my sites since the only user contributed content is comments. Only the content or technical admins will be using the statistics for me.
#5
Sorry for the delay getting back to you on this. It should be fine for your three drupal sites to look at the same AWStats data directory (DirData in the .conf files). AWStats names files from different domains differently, so there is no problem sharing the directory.
@matteoraggi: BAWstats isn't so clever as to be able to show per-user information - it is really a very straight port of betterawstats.
Please let me know if this helps or not.
#6
But, how does one tell each site which files to look at?
#7
Is there any plan to have separate view permissions to each site? I know, it will require to create permissions dynamically, and it is not easy. If there is no plan to include this in the module, we will probably write it, as we are planning to use this module with this function.
#8
It is useful, but i'm not enough interested to build this module at this time, maybe from secon part of next year, who know? We'll see. If someone will develop this module I'll be happy to test it.
#9
@tamas (#6). Bawstats uses the stripped version of the site domain $_SERVER['HTTP_HOST'] to find the right file. For example, if your domain is www.bstw.com or bstw.com, it will look in the data directory for files named like awstats022009.bstw.com.txt.
Your files appear to be missing the .com part.
To fix this, I would suggest that in your awstats config file (/etc/awstats/awstats.bstw.conf), you set
SiteDomain="bstw.com"
If you've done this already, I'll need to think again.
#10
@shafter & matteoraggi: There are no such plans at the moment, and it does seem that it would be hard to create view permissions for each site. Also, would it lead to the permissions table getting very large in the case of there being many sites?
Anyway, I don't have the time to develop this myself, though I am open to patches. If you'd like to work more on this, please open a separate feature-request issue. It would also be good to define a bit more what you'd like to do.