logs and webalizer for each domain/user

Problems with the Windows version of XAMPP, questions, comments, and anything related.

logs and webalizer for each domain/user

Postby HugoCarvalho » 21. December 2008 23:15

Hi,

Today i've been trying to put this working. It seems to be fine, i just don't know what to do to execute the 'webalizer.php' (that will update the stats...)
what i did:
on httpd-vhosts.conf i put:
"<VirtualHost *:80>
DocumentRoot "D:\.........\domains\~hcserver\public_html"
ServerName ...
ServerAlias ...
ServerAdmin admin@....
Alias /stats "D:/....../domains/~hcserver/webalizer/"
LogFormat "%h %l %u %t \"%r\" %>s %b" common
ErrorLog "D:/....../domains/~hcserver/logs/error.log"
CustomLog "D:/..../domains/~hcserver/logs/web.log" common
</VirtualHost>"
(and others)

folder ...\domains is like this:
+ ~domain name
++ public_html
++ public_ftp
++ webalizer
++ logs

+ ~hcserver
++ public_html
++ public_ftp
++ webalizer
++ logs


(...)

The logs work perfectly :)
The problem is "updating" the webalizer stats...
inside logs will be: error.log and web.log
inside webalizer will be:
ctry_usage ... daily_usage... *.hist ... hourly_usage ... index .... url_200812 .... usage ... usage_200812

and in webalizer folder \webalizer are the "normal" files.. the batch.. the .exe ...
then i edited the webalizer.bat:
@echo off
webalizer.exe -c server_webalizer.conf
for %%i in ("domain_*.conf") DO webalizer.exe -c %%i


so, it would open every domain .conf
i created then, the domain_domainname.conf files with:
OutputDir D:/hcserver/domains/~hcserver/webalizer/
LogFile D:/hcserver/domains/~hcserver/logs/web.log
HistoryName D:/hcserver/domains/~hcserver/webalizer/hcserver.ath.cx.hist
Incremental No
IncrementalName D:/hcserver/domains/~hcserver/webalizer/hcserver.ath.cx.current
HostName hcserver.ath.cx
PageType htm*
PageType cgi
DNSChildren 10
Quiet Yes
DailyGraph Yes
DailyStats Yes
HourlyGraph Yes
HourlyStats Yes
TopReferrers 30
AllReferrers yes
AllSites no
AllURLs yes
AllAgents no
AllSearchStr no
AllUsers no



It works perfecly if i open in CMD the webalizer.bat file....
but i know the webalizer.php opens that .bat file too...
So, what you think would be the best way to execute that php to "update" the stats (because it's on a diffent folder)?
HugoCarvalho
 
Posts: 3
Joined: 20. February 2007 17:57

Re: logs and webalizer for each domain/user

Postby Sharley » 22. December 2008 00:14

Not sure if this will help but may seed a different angle to research.

In your .\xampp\apache\conf\extra\httpd-xampp.conf file this is how the default XAMPP installation uses\locates Webalizer.
Code: Select all
   Alias /webalizer "C:/xampp/webalizer/"
    <Directory "C:/xampp/webalizer">
      <IfModule php5_module>
         <Files "webalizer.php">
            php_admin_flag safe_mode off
         </Files>
      </IfModule>
        AllowOverride AuthConfig
        Order allow,deny
        Allow from all
    </Directory>
I have not tried this but if you use the above as an example to create an addition to your vhost container, with some experimentation, then one would assume it would satisfy your needs.

Are you using XAMPP as the folder trees look very much like a regular Apache server.

A Folder (directory) outside the htdocs (default XAMPP DocumentRoot) require permissions to be set in a <Directory> directive to override the very restrictive default settings in the .\xampp\apache\conf\httpd.conf file or there will be no access to that folder by the Apache server, for obvious security reasons - notice in the above code that the webalizer folder is outside the htdocs folder and so requires the necessary permissions to allow Apache to write to that folder.

Hope this will be of some help in solving your particular issue.

Good luck.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: logs and webalizer for each domain/user

Postby HugoCarvalho » 22. December 2008 01:00

Sharley wrote:Not sure if this will help but may seed a different angle to research.

In your .\xampp\apache\conf\extra\httpd-xampp.conf file this is how the default XAMPP installation uses\locates Webalizer.
Code: Select all
   Alias /webalizer "C:/xampp/webalizer/"
    <Directory "C:/xampp/webalizer">
      <IfModule php5_module>
         <Files "webalizer.php">
            php_admin_flag safe_mode off
         </Files>
      </IfModule>
        AllowOverride AuthConfig
        Order allow,deny
        Allow from all
    </Directory>
I have not tried this but if you use the above as an example to create an addition to your vhost container, with some experimentation, then one would assume it would satisfy your needs.

Are you using XAMPP as the folder trees look very much like a regular Apache server.

A Folder (directory) outside the htdocs (default XAMPP DocumentRoot) require permissions to be set in a <Directory> directive to override the very restrictive default settings in the .\xampp\apache\conf\httpd.conf file or there will be no access to that folder by the Apache server, for obvious security reasons - notice in the above code that the webalizer folder is outside the htdocs folder and so requires the necessary permissions to allow Apache to write to that folder.

Hope this will be of some help in solving your particular issue.

Good luck.

Thanks for the reply :)
yes, i'm using XAMPP, but changed it a little bit (e.g.: the folder structure/htdocs)
i haven't tried yet, but i think i need both folders,
the d:\hcserver\webalizer and, --> that would save the*.conf files, the .exe and .bat
d:\hcserver\domains\~domain\webalizer --> would show the stats (*.html , images... )
that was my ideia... :)

d:\hcserver\webalizer :
Code: Select all
 Directory of D:\hcserver\webalizer

21-12-2008  19:55    <DIR>          .
21-12-2008  19:55    <DIR>          ..
21-12-2007  02:01         2.974.071 bgd.dll
21-12-2007  02:01            19.074 CHANGES
21-12-2007  02:01            18.329 COPYING
21-12-2007  02:01             1.348 Copyright
21-12-2007  02:01             4.363 country-codes.txt
21-12-2008  19:56             2.276 ctry_usage_200812.png
21-12-2008  19:56             2.535 daily_usage_200812.png
21-12-2007  02:01             8.542 DNS.README
21-12-2008  19:14               493 domain_eyeos.conf
21-12-2008  19:14               498 domain_hackshell.conf
21-12-2008  19:15               561 domain_hcserver.conf          --> those individual domain conf file
21-12-2008  19:15               481 domain_inforgen.conf
21-12-2008  19:15               486 domain_mastergipy.conf
21-12-2008  19:15               593 domain_traptospodcasts.conf
21-12-2008  19:56             1.605 hourly_usage_200812.png
21-12-2008  19:56             3.964 index.html
21-12-2007  02:01            10.165 INSTALL
21-12-2007  02:01            89.927 README
21-12-2007  02:01             7.812 README.FIRST
21-12-2007  02:01            26.801 sample.conf
21-12-2008  19:12            25.437 server_webalizer.conf
21-12-2008  19:56             2.072 usage.png
21-12-2008  19:56            32.858 usage_200812.html
21-12-2008  19:17               104 webalizer.bat
21-12-2007  02:01           114.688 webalizer.exe
21-12-2008  19:56                30 webalizer.hist
21-12-2007  02:01               524 webalizer.php
21-12-2007  02:01            77.824 zlib1.dll


d:\hcserver\domains\~domain\webalizer:
Code: Select all

 Directory of D:\hcserver\domains\~hcserver\webalizer

21-12-2008  19:56             2.276 ctry_usage_200812.png
21-12-2008  19:56             2.543 daily_usage_200812.png
21-12-2008  19:56                32 hcserver.ath.cx.hist
21-12-2008  19:56             1.596 hourly_usage_200812.png
21-12-2008  19:56             3.828 index.html
21-12-2008  19:56             3.964 url_200812.html
21-12-2008  19:56             2.109 usage.png
21-12-2008  19:56            49.081 usage_200812.html



But maybe would work if i put the webalizer.php on the folder d:\hcserver\domains\~domain\webalizer ?
the problem.. is it "secure" to put the .bat and .exe file for everyone?
HugoCarvalho
 
Posts: 3
Joined: 20. February 2007 17:57

Re: logs and webalizer for each domain/user

Postby Sharley » 22. December 2008 01:31

HugoCarvalho wrote:...the problem.. is it "secure" to put the .bat and .exe file for everyone?

You can deny access to certain file types in your server configuration as this example in the httpd.conf file for denying access to the .ht* range of files clearly shows:
Code: Select all
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch>
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: logs and webalizer for each domain/user

Postby HugoCarvalho » 22. December 2008 01:35

Sharley wrote:
HugoCarvalho wrote:...the problem.. is it "secure" to put the .bat and .exe file for everyone?

You can deny access to certain file types in your server configuration as this example for denying access to the .ht* range of files clearly shows:
Code: Select all
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch>

ok, i'll try and then i say something.
thanks :)
HugoCarvalho
 
Posts: 3
Joined: 20. February 2007 17:57

Re: logs and webalizer for each domain/user

Postby Sharley » 22. December 2008 01:53

Again not sure if it helps but may seed some more ideas.
Webalizer FAQ wrote:17. How can I easily process multiple virtual hosts?

There are many ways to process multiple virtual hosts on the same machine. The easiest way I have found, provided that each host generates it's own log file, is as follows:

1. Create a central directory for your configuration files. (I use /etc/webalizer)
2. Make a configuration file for each virtual host and place them in the central directory. Each configuration file should have at least the HostName (domain), OutputDir and LogFile configuration settings specified. You probably will want to specify other settings specific to the domain, such as HideReferrer, HideSite and maybe some others as well. Name the file the same as the domain name, and end it with a .conf extension, so you can easily tell what vhost the configuration is for.
3. To process all your virtual sites with a single command, a simple shell command can now be used:

for i in /etc/webalizer/*.conf; do webalizer -c $i; done

After you have it set up, to add a new host, all you need to do is create a new configuration file and put it in the directory. It will be automatically picked up the next time you run the command.
From this site http://www.webalizer.org/faq.html

One assumes that each individual Webalizer *.conf file will then be configured for each vhost and in place of a *nix shell command perhaps the bat file command may be created/modified to do all the processing.

This poster seems to have followed the FAQ with some useful additions perhaps, but again you may have to adapt/interpret from a *nix environment to a Windows environment.
http://forums.fedoraforum.org/showthread.php?t=204652

Again, good luck.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 197 guests