LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-03-2004, 01:50 PM   #1
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Rep: Reputation: 30
Webalizer on virtual hosts?


Hi All,

I run a small server from my house and host several virtual domains as well as my main domain.

I have had webalizer working with no problem for some months now, but it only gives me data for my main domain name.

I recently tried to set it up so that I can have a webalizer html page on each virtual domain, giving individual stats for each of the virtual domains.

All went ok, after I copied the webalizer.conf edited it for my other domains and the processed the webalizer.conf files in /etc/webalizer/ (which I created to hold the different webalizer .conf script for each domain.

The problem is when I go to, www.myvirtualdomain.com/usage all the webalizer stuff comes up but with the stats from my main domain, (www.mymaindomain.com) as well as the few from the myvirtualdomain.com. This is obviously pointless for what I am trying to achieve.

I am beginning to wonder if it is possible with webalizer at all. It would seem logical that it could be done, but I am stumped on trying to figure out how...

Anyone had any success with setting up webalizer to display -uncombined data for virtual hosts?

Any help appreciated.

Lucas
 
Old 06-03-2004, 01:54 PM   #2
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Yes, I am doing it. I also experienced the same problem. The problem is... you cannot run Webalizer on live active logs. You should run it on a log that has been already archived and compressed and is not being written to by apache. If you are running logrotate on the apache logs, you should choose to run Webalizer on access_log.1.gz which should be the log file from the previous night. This way, you are only 1 day behind, which is usually fine for most people. Webalizer will recognize it as zipped, decompress the log and process it.
 
Old 06-03-2004, 04:33 PM   #3
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
Hi,

Thanks for the hint.

However, I have been trying to get it to work now with

/var/log/httpd/myvirtualdomain.org-access_log.1

instead of

/var/log/httpd/myvirtualdomain.org-access_log

But when I do the command:

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

It does not seem to build/ generate the output anymore. I get only the following:

DNS Lookup (10): 1 addresses in 0.08 seconds
Using DNS cache file /var/lib/webalizer/dns_cache.db
Creating output in /var/www/myvirtualdomain.org/usage/
Hostname for reports is 'myvirtualdomain.org'
History file not found...
Reading previous run data.. /var/lib/webalizer/webalizer.current
79 records (79 ignored) in 0.04 seconds

When i change back to using
/var/log/httpd/myvirtualdomain.org-access_log in my virtualdomain.conf file it generates the ../usage files but still with the same problem as before...

Any ideas?

Thanks

Lucas
 
Old 06-03-2004, 04:34 PM   #4
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
could it be the

/var/log/httpd/myvirtualdomain.org-access_log.1 log file has too few entries to process??
 
Old 06-03-2004, 04:37 PM   #5
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
Also,

do you have to run you main domain webalizer on non active logs also (ie access_log.1)? Or does this only need to be done with virtual host log files?

Thanks again

Lucas
 
Old 06-03-2004, 05:05 PM   #6
EyesOnly
Member
 
Registered: Aug 2003
Location: The Netherlands
Distribution: SlackWare
Posts: 202

Rep: Reputation: 30
Well,
i have a small homeserver whit several virtual hosts too, and all have there own accesslog, generated whit webalizer.

I have a separate access-log for every virtualhost, and each access-log is processed by webalizer, so i got a access-log page for each virtual host.
(it is done on the normal logfiles, not using logrotate on them)

so, yes, it is possible
 
Old 06-03-2004, 09:28 PM   #7
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Hmmm... I'm not sure what's wrong with your output. The command you're running looks very similar to mine. Here's mine...

Code:
#!/bin/sh

for i in /etc/webalizer/*.conf
do
/usr/bin/webalizer -c $i
done
Also, here is a sample of one of my .conf files. Maybe you need to ensure that all of these arguments are there.

Code:
## Webalizer Config File
LogFile			/home/dmji/www/logs/access.log.1.gz
OutputDir		/home/dmji/www/html/stats
HistoryName		/home/dmji/www/html/stats/webalizer.hist
IncrementalName	/home/dmji/www/html/stats/webalizer.current
Incremental		yes
HostName		www.dmji.com
PageType		htm*
PageType		php*
PageType		pl
PageType		cgi
Quiet			yes
HideURL			*.gif
HideURL			*.GIF
HideURL			*.jpg
HideURL			*.JPG
HideURL			*.png
HideURL			*.PNG
And yes, it's true... I have heard many stories saying that you CAN run Webalizer on live (currently in use) log files, but the author of the package explicitly says NOT to do this, so I'm going to trust his judgment.
 
Old 06-04-2004, 01:17 PM   #8
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
Thanks for your replies.

It seems something strange is going on.

I reviewed the information on the webalizer faq and discovered that I should have got rid of the default webalizer.conf, and replace the main domain /etc/webalizer.conf file with /etc/webalizer/mymaindomain.conf, I did this.

So now I have three conf files in /etc/webalizer for three different main/ virtual hosts.

mymaindomain.conf
myvirtualdomain.conf
myvirtualdomain2.conf

I selected the relevant *-access_log.1 files for each domain in each .conf file.

But when enter the command

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

I only get results in /var/www/html/usage, however they have been working and processing for ages through cron every day, so I am not sure if it is still infact wroking after changing webalizer.conf to etc/webalizer/mymaindomain.conf. It seems to be, but to soon to tell.....

But the strange thing is if I change the name of mymaindomain.conf to mymaindomain.temp so it is not activated when starting webalizer, to try and narrow down the problem, I get nothing from the two virtual hosts... nothing at all? No creating /var/www/myvirtualdomain/ no nothing?? When I do the
#for i in /etc/webalizer/*.conf; do webalizer -c $i; done command

When I change the logfile entry in the .conf files back to the live logs ie LOGFILE /var/log/httpd/myvirtualdomain.com-access_log (instead of *access_log.1) and then type the command

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

I get successful messages and indeed when I go to check www.myvirtualdomain.com/usage webalizer html pages come up, but they are still diplaying the data from www.mymaindomain as well as the data from www.myvirtualdomain.com??

When I change the .conf files back to reading *access_log.1 then delete the /var/www/*/usage files, and try the webalizer command again, again nothing happens?

How can webalizer be processing the information form mymaindomain.com and myvirtualdomain.com when I have only selected the /var/log/httpd/myvirtualdomain-access_log.conf in /etc/webalizer/myvirtualdomain.conf??

Anyone got any further ideas?
 
Old 06-04-2004, 01:54 PM   #9
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
I removed the /var/www/*/usage directories and got the following error:

# for i in /etc/webalizer/*.conf; do webalizer -c $i; done
Webalizer V2.01-10 (Linux 2.4.20-30.9smp) English
Using logfile /var/log/httpd/myvirtualdomain.com-access_log.1 (clf)
Error: Can't change directory to /var/www/myvirtualdomain.com/usage/
Webalizer V2.01-10 (Linux 2.4.20-30.9smp) English
Using logfile /var/log/httpd/myvirtualdomain2.com-access_log.1 (clf)
Error: Can't change directory to /var/www/myvirtualdomain2.com/usage/
 
Old 06-04-2004, 02:39 PM   #10
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
I dont know what's going on with that error about "can't change directory"... maybe there is a permissions problem on that directory??? Are you running these commands as root?

For the individual .conf files... do you have all the same directives that I do in mine?? Like "incremental" "outputdir" etc etc. I think you really need those. I'm not sure because I don't think I've seen any of your conf files yet.

I hate to point you elsewhere for help, but I recommend getting on the mailing list for Webalizer. The author of the package is very heavily involved with the mailing list for his software, so I'm sure you'll be getting the best help possible.
 
Old 06-05-2004, 11:29 AM   #11
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
OK, thanks for your help anyway..

Have emailed the webalizer guy and am now just awaiting a response.

Will post the solution if I figure it out.

Lucas
 
Old 06-05-2004, 12:01 PM   #12
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Errr... you may not have much luck emailing the author directly. It seems that for some reason on the internet in general, emailing the author of a package directly doesn't get you very far. Most likely they will not answer. Better to join the list and post your question.
 
Old 06-05-2004, 12:34 PM   #13
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
Oh, thanks for the tip

Alas, I just checked the mailing list and it is down http://www.mrunix.net/webalizer/mailinglist.phtml


The error I was getting before was because of file permission, because I created .../usage without chowning it to webalizer... doh!

Anyway no I am getting some sort of action. But there still seems to be a fundamental problem somewhere.

If I use *access_log.1 I get the correct output from the webalizer command in the console, but nothing is created in the .../usage/ file??

If I use *access_log I get the correct pages being built in .../usage/ but they are from the main logs not the virtual host logs?

The only thing I seem to be able to think of next is .hist files.

Do you need different .hist and .current files files for every virtual host?

Here is the part of the display after running the webalizer command:

Webalizer V2.01-10 (Linux 2.4.20-30.9smp) English
Using logfile /var/log/httpd/myvirtualdomain.com.au-access_log.1 (clf)
Using DNS cache file /var/lib/webalizer/dns_cache.db
Creating output in /var/www/myvirtualdomain.com.au/usage/
Hostname for reports is 'www.myvirtualdomain.com.au'
Reading history file... /var/lib/webalizer/webalizer.hist
Reading previous run data.. /var/lib/webalizer/webalizer.current
96 records (96 ignored) in 0.03 seconds
Webalizer V2.01-10 (Linux 2.4.20-30.9smp) English
Using logfile /var/log/httpd/access_log.1 (clf)

But contrary to what it says above the /var/www/myvirtualdomain.com.au/usage/ file is not being created??

Here is my /etc/webalizer/virtualdomain.conf

LogFile /var/log/httpd/myvirtualdomain.com.au-access_log.1
OutputDir /var/www/myvirtualdomain.com.au/usage/
HistoryName /var/lib/webalizer/webalizer.hist
Incremental yes
IncrementalName /var/lib/webalizer/webalizer.current
HostName www.myvirtualdomain.com.au
PageType htm*
PageType cgi
PageType php*
PageType pl
DNSCache /var/lib/webalizer/dns_cache.db
Quiet no
HideURL *.gif
HideURL *.GIF
HideURL *.jpg
HideURL *.JPG
HideURL *.png
HideURL *.PNG
HideURL *.ra
SearchEngine yahoo.com p=
SearchEngine altavista.com q=
SearchEngine google.com q=
SearchEngine eureka.com q=
SearchEngine lycos.com query=
SearchEngine hotbot.com MT=
SearchEngine msn.com MT=
SearchEngine infoseek.com qt=
SearchEngine webcrawler searchText=
SearchEngine excite search=
SearchEngine netscape.com search=
 
Old 06-06-2004, 08:59 AM   #14
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
Hoorah!

The webalizer author did get back to me and solved the problem too.

It turns out that my errors were as follows:

1. All my log files were in /var/log/httpd. Each virtual host actually needs its own file to keep the logs in, eg /var/log/httpd/vhosts/virtualhost1/virtualhost1.com-access_log

2. I was using one history and one current file for all virtual hosts, they each need one, eg /etc/webalizer/virtualhost1/webalizer.hist

3. Each .conf file needs to be in its own file, and needs to be processed seperately.

Just for interests sake, it seems you can use access_log just as well as access_log.1

Thanks for everyones help.

Now time to get cron working with webalizer again....
 
Old 06-06-2004, 12:01 PM   #15
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Hey, thanks for reporting back and letting us know how you solved your problem. That's good news! I guess it never occurred to me that you were storing all of your log files in the same place. I put all of mine in each user's home directory so they will have access to the log files so they can troubleshoot their own problems as they arise.

Quote:
Just for interests sake, it seems you can use access_log just as well as access_log.1
Can you clarify? Are you saying the author has said it's ok to run the webalizer on live log files??? Just a couple of months ago on the list, this subject came up and the author said not to run the webalizer on live logs... looking back at the message now, he also said that this was in the event you were running it in incremental mode. Maybe this is the only exception.

http://groups.yahoo.com/group/webalizer/message/2610

Regardless, thanks for telling us how it turned out and good luck with everything!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 06:29 AM
virtual hosts, virtual ip's? kuplo Linux - Newbie 3 11-29-2005 08:44 PM
webalizer setup for virtual hosts intranet_man Linux - Security 1 03-03-2005 12:00 PM
Setting up webalizer for virtual host hct224 Linux - Newbie 18 11-10-2004 03:31 PM
Configuring Webalizer for virtual sites. dmedici Fedora 0 07-22-2004 03:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration