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.

CommentFileSizeAuthor
#17 bawstats_access.tar_.gz1.31 KBderuitern

Comments

matteoraggi’s picture

I also have all sites with one code only, do you have then solved this task?

tamhas’s picture

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.

matteoraggi’s picture

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.

tamhas’s picture

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.

egfrith’s picture

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.

tamhas’s picture

But, how does one tell each site which files to look at?

shafter’s picture

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.

matteoraggi’s picture

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.

egfrith’s picture

@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.

egfrith’s picture

Version: 6.x-1.0-2 » 6.x-1.1

@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.

deruitern’s picture

Category: support » feature

I'm working on a "bawstats_access" module that provides a freeform list user profile field and limits the user's report access to only domains that they are configured for. I took a bit of a different approach than using roles/permissions as I'm working on a web reporting portal and need a solution that will work for hundreds of websites/customers. I should have something working this week. Would anyone be interested in testing and providing feedback?

egfrith’s picture

Hello deruitern,

although I haven't time for testing at the moment, I've been emailed by someone who is interested (and possibly working on) a very similar idea, so I've pointed them in this direction. Once the code has been through a round of testing, if the concept seems to work, and the code is fairly clean and general, I'd be happy to test it myself and put bawstats_access.module in the bawstats directory.

matteoraggi’s picture

I?m interested to test it if followed with instructions, for sure!

deruitern’s picture

Sounds great! I'm a little behind schedule with some other work at the moment, but I will have a rough draft by the end of the weekend. I have a working copy, just need to clean some things up first.

martoni’s picture

Hi deruitern!

I'm also very interested in testing and/or developing a feature very similar to this. Please contact me if I can do anything in connection your module or patches. (You can also contact me using the contact possibilities of Drupal site, and I'll give you my email address.)

The cooperation between us is very welcomed.

Cheers,
Ivan

egfrith’s picture

This all sounds very positive. Please do feel free to use this thread to post code to or exchange patches and give reviews &c.

deruitern’s picture

StatusFileSize
new1.31 KB

Attached is a rough draft of the bawstats_access module discussed on comment #11, if anyone is still interested. When the module is enabled, any user with 'administer site statistics' and 'administer users' permissions should see a fieldset for assigning permissions on the user registration and user edit pages. Sorry for the delay.

egfrith’s picture

Thanks very much for this deruitern; I'm just back from holiday, and I'll try to take a look at it later this week.

egfrith’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Well, my "next week" has turned into 14 years. I'm closing this, but feel free to reopen if any of you are still around! Bawstats is now just about working with Drupal 8/9/10.