Live Server Stats

This section contains scripts that hMailServer has contributed with. hMailServer 5 is needed to use these.
mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-11-29 02:05

I installed this on IIS6 on win2k server and i'm getting this error...Im new to perl i know php but not perl can anyone help...Do you have to also install awstats to get this live stats thing to work? I will post a copy of my config file, i just want the stats to show locally not live on the web...

Error index.cgi
"CGI Error"
"The specified CGI application misbehaved by not returning a complete set of HTTP headers."

Config File...
hMail Live Config File

... NOTICE ...

There is no warrenty, expressed or implied, with this software.
You can see the code, it is your responsibility to make sure it's fit for purpose and suits your needs.
I am not responsible for anything that happens to your machine!

Do not edit anything before the '=' sign and must have space after.
Do not change the order of lines or add any additional lines.

CHECK THE FORUM!

hMail Live Config Version = 2


... Configuration ...

Installed URL = http://server/mailstats

hMail Database Server = 127.0.0.1
hMail Database Port = 3306
hMail Database Name = mail
hMail Database User = root
hMail Database Password = XXXX
Data Storage Drive = C:

... Delivery Logging ...

Database Log Enabled = no
AWStats Locations = D:/Logs/Mail/hmailserver_awstats.log

Delivery Database Server = 127.0.0.1
Delivery Database Port = 3306
hMail Database Name = dbname
hMail Database User = dbuser
hMail Database Password = dbpassword

Max Record Age (Days) = 365

Archive Original Logs = Yes

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-11-29 18:43

Hi,

No, you don't need AWStats, it just reads the same data files from hMailServer.
Error index.cgi
"CGI Error"
"The specified CGI application misbehaved by not returning a complete set of HTTP headers."
Thats a Perl install error. Make sure you have all the modules installed that are needed via PPM - see http://forum.ianbradshaw.co.uk/viewtopic.php?f=8&t=20 for the listing.

Also, if you try and run index.cgi from the command line ... i.e. get a dos prompt up and go to your web dir .. then run 'perl index.cgi' .. it will output some more detailed error info .. if it looks like html then its an IIS config issue .. so we'll look at that next .. most likely a module missing though.

S.

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-11-29 23:53

Yep you were right i didn't have all the modules installed...Now i do and now its saying "config file version error"

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-11-29 23:55

Heres the command line error...

C:\Inetpub\wwwroot\MailStats>perl index.cgi
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains:
C:/Perl/site/lib C:/Perl/lib .) at (eval 7) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: CSV, DBM, ExampleP, File, Gofer, ODBC, Oracle, Proxy, SQLite,
Sponge.
at index.cgi line 68

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-11-30 03:11

Hi,

hmm ... config file looks ok.

Theres a module missing still for MySQL ... do a ppm search for dbd-mysql ... I thought this came as a default, but apparently not! ... the command line error is looking for a MySQL driver thats not installed.

See if you get the config file error after installing that ... I suspect you will tho as its an early check it does from memory ... not had time to do anything to the code for a while so its got a bit hazy as to the order of things it does.

If it still config errors but works from command line then we'll have a look at config file ... its sensitive to case and line number (crap code I know ... next thing I need to do when I get chance is clean it up).

Cheers

S.

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-11-30 05:21

Ya i saw that too and installed the DBD-mysql but i still get "config file version error" Here is the command prompt after installing the module. I even tried to reinstall it.

C:\Inetpub\wwwroot\MailStats>perl index.cgi
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains:
C:/Perl/site/lib C:/Perl/lib .) at (eval 7) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: CSV, DBM, ExampleP, File, Gofer, ODBC, Oracle, Proxy, SQLite,
Sponge, mysqlPP.
at index.cgi line 68

When i try to do the hello world script it says im not authorized to view that page if that helps...I have added index.cgi to the list of pages to serve and the .cgi extension in IIS pointing to perl.exe with all the % stuff...I copied it exactly from the .pl module that installed with the .msi installer from perl.

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-11-30 12:52

Hi,

Perls still not happy ... grant the IUSR_XXX access to the 'c:\perl' folder ... looks like an IIS permissions thing on the perl install.

Is the config file still in the same dir structure as the zip file? (although it could all just be due to permission on the perl dir).

S.

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-11-30 16:05

So i granted iusr rights to the c:/perl but still no go...weird

I got the hello world script to work by adding iusr rights to the index.cgi...

I granted all the rights to the hmaillive directory also...it still says config file version error

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Live Server Stats

Post by ^DooM^ » 2009-11-30 19:24

Did you allow recursive updates to the permissions so all files have correct rights?
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Live Server Stats

Post by ^DooM^ » 2009-11-30 19:30

Sheff I have finally got round to trying this. Will it work with ActivePerl 5.10.1.1006 or do we need 5.8 as your pre-req's say?
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-11-30 19:43

@Doom - *dance* - I've only used it with 5.8.x ... it should work with 5.10.x in theory, if you can find all the modules for 5.10 (historically I've had probs finding the ones I want so have never moved up to 5.10).

@Matt - What Doom says ... it probably can't read the file as the config looks correct.

S.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Live Server Stats

Post by ^DooM^ » 2009-11-30 19:54

I'll go with 5.8 then will make things easier ;)
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Live Server Stats

Post by ^DooM^ » 2009-11-30 22:34

ok test done now to config stats.

Code: Select all

Hello World!

You have reached http://192.168.2.11/index.cgi

Your IP Address is 192.168.2.21
Have a nice day!
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-11-30 23:30

Ya everything has all the proper rights...im using perl 5.8 i got the hello world script to work but i just cant get this config error to go away it keeps saying it cannot find dbd-mysql in command line but its there i have reinstalled that module twice.

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-11-30 23:40

definately seems to be some sort of perl missing module / permissions thing ... got to get it to run from the command line first, then sort out IIS ... try deleting the c:\perl directory and reinstalling.

Guess you've rebooted to get the perl paths in the env stuff working properly?

S.

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-11-30 23:46

ya i have tried everything i can think of...i guess i will reinstall and report my findings.

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-12-01 03:38

Run this from a DOS prompt and check the modules all doing happy from there.
check.zip
(614 Bytes) Downloaded 376 times
if that runs ok, then stick this one in your web root and try
check_web.zip
(800 Bytes) Downloaded 355 times
should return with

http://hmaillive.ianbradshaw.co.uk/check.cgi

S.

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-12-01 03:56

*** MISSING *** DBD::MySQL


You have 1 modules missing.

C:\>perl check.pl
Installed ... CGI
Installed ... DBI
Installed ... Filesys::DfPortable
Installed ... Time::HiRes
Installed ... Date::Calc
Installed ... Number::Format
Installed ... Win32::SystemInfo
Installed ... Math::Round
Installed ... Win32::SystemInfo
Installed ... Win32::SystemInfo::CpuUsage
Installed ... Net::DNS
Installed ... Net::DNSBLLookup
Installed ... CGI
*** MISSING *** DBD::MySQL


You have 1 modules missing.

The only module i see in the ppm is dbd:mysqlPP and its installed theres no just dbd:mysql

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-12-01 04:01

Ok i found the missing module i did not know you can select other repositories, this is my first expierience with perl...but after installing the proper module and getting the all clear from the check file, still get the "Config file version error"

C:\>perl check.pl
Installed ... CGI
Installed ... DBI
Installed ... Filesys::DfPortable
Installed ... Time::HiRes
Installed ... Date::Calc
Installed ... Number::Format
Installed ... Win32::SystemInfo
Installed ... Math::Round
Installed ... Win32::SystemInfo
Installed ... Win32::SystemInfo::CpuUsage
Installed ... Net::DNS
Installed ... Net::DNSBLLookup
Installed ... CGI
Installed ... DBD::MySQL


All modules installed ... your good to go!

C:\>

Here is the config file...
hMail Live Config File

... NOTICE ...

There is no warrenty, expressed or implied, with this software.
You can see the code, it is your responsibility to make sure it's fit for purpose and suits your needs.
I am not responsible for anything that happens to your machine!

Do not edit anything before the '=' sign and must have space after.
Do not change the order of lines or add any additional lines.

CHECK THE FORUM!

hMail Live Config Version = 2


... Configuration ...

Installed URL = http://server/mailstats

hMail Database Server = 127.0.0.1
hMail Database Port = 3306
hMail Database Name = mail
hMail Database User = root
hMail Database Password = XXXXXXX
Data Storage Drive = C:

... Delivery Logging ...

Database Log Enabled = No
AWStats Locations = D:/Logs/Mail/hmailserver_awstats.log

Delivery Database Server = 127.0.0.1
Delivery Database Port = 3306
hMail Database Name = dbname
hMail Database User = dbuser
hMail Database Password = dbpassword

Max Record Age (Days) = 365

Archive Original Logs = Yes
Last edited by mattfox27 on 2009-12-01 04:04, edited 1 time in total.

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-12-01 04:02

go to ppm preferences and add some of the repositories there ... I've got bribes, touchelle and uwinnipeg selected as well as the default ... one of those should have it.

S.

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-12-01 04:03

ah .. sorted!

does the cgi one run from web browser?

S.

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-12-01 04:15

hmm ...

out of curiosity ...

http://forum.ianbradshaw.co.uk/viewtopic.php?f=6&t=54

try that one ... its just a direct zip of whats on my server at the moment. Just noticed I'd corrected the last few lines of the config file to the proper descriptions ... tho it shouldnt make a diff you never know ... ... ... !

S.

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-12-01 05:01

Which CGI one?

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-12-01 05:06

check_web.zip a couple of posts up

S.

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-12-01 23:11

Here is check.cgi results...

C:\>perl check.cgi
Content-type: text/html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or
g/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<p>Installed ... CGI<br>Installed ... DBI<br>Installed ... Filesys::DfPortable<b
r>Installed ... Time::HiRes<br>Installed ... Date::Calc<br>Installed ... Number:
:Format<br>Installed ... Win32::SystemInfo<br>Installed ... Math::Round<br>Insta
lled ... Win32::SystemInfo<br>Installed ... Win32::SystemInfo::CpuUsage<br>Insta
lled ... Net::DNS<br>Installed ... Net::DNSBLLookup<br>Installed ... CGI<br>Inst
alled ... DBD::MySQL<br><p>All modules installed ... your good to go!</p></p>
</html>

C:\>

I also tried the other zip that contained your updated version and i still get the config file version error...so wierd

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-12-01 23:23

stick the cgi on your web server and access it via web broswer rather than command line - i.e. http://yourdomain.com/check.cgi

Have you tried the newer hmlive that I just copied direct off my server incase?

S.

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-12-02 04:50

Ya the check.cgi works on both web and dos all modules installed...Is there any settings in hmailserver or mysql that need to be set? I'm using the root account on mysql.

Installed ... CGI
Installed ... DBI
Installed ... Filesys::DfPortable
Installed ... Time::HiRes
Installed ... Date::Calc
Installed ... Number::Format
Installed ... Win32::SystemInfo
Installed ... Math::Round
Installed ... Win32::SystemInfo
Installed ... Win32::SystemInfo::CpuUsage
Installed ... Net::DNS
Installed ... Net::DNSBLLookup
Installed ... CGI
Installed ... DBD::MySQL


All modules installed ... your good to go!

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-12-02 04:58

Ok heres something wierd i'm trying to put it in its own directory...http://server/mailstats but if i put all the source stuff just into the wwwroot it works so just http://server works. Then if i make a folder wwwroot/mailstats and put it all in there then it doesn't work. Should it be able to work from a folder inside wwwroot?

Also when i can get it to work not all of the features work...destination, date&time, spam they all say CGI error

User avatar
mattg
Moderator
Moderator
Posts: 21103
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Live Server Stats

Post by mattg » 2009-12-02 06:33

mattfox27 wrote:Should it be able to work from a folder inside wwwroot?
Yes

You haven't added perl to the whole server, just to one (the root) directory I'd guess.
(In IIS Administration).
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

mattfox27
Normal user
Normal user
Posts: 69
Joined: 2009-11-26 01:00

Re: Live Server Stats

Post by mattfox27 » 2009-12-02 06:36

I'm not sure...i let the MSI installer do the work then i just added the .cgi extension how would i add perl to other directories?

User avatar
mattg
Moderator
Moderator
Posts: 21103
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Live Server Stats

Post by mattg » 2009-12-02 08:57

Where did you add the cgi extension?

You say earlier Win 2K server but IIS 6.0
IIS 6,0 shipped with Server 2003 if memory serves, and server 2000 shipped with IIS 4.0 I recall

Which is correct?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Live Server Stats

Post by ^DooM^ » 2009-12-02 10:34

I'm running it in a subfolder on my little test machine off root and it works well.

http://www.hellscream.org.uk/mailstats/index.cgi
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-12-02 13:20

@doom : You need to have your installed url in the config as 'Installed URL = http://www.hellscream.org.uk/mailstats' to get the graphs to work I think as it checks referrer URL when generating them to stop them being run offsite (hence you just get all the graph url back rather than a graph).

*edit* ... 'http://192.168.2.111/graph.cgi?' its probably working for you on the LAN via local IP access (tho might still be failing without the sub dir).

@mattg : Server 2003 has IIS 6, not sure what came with 2000.

@mattfox : This looks like a perl / permissions thing on the server tbh ... can't see anything wong with the scripts or they'd be screwed for everyone. Any that error, run from command line and see what its saying, the IIS messages aren't good!

Cheers

S.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Live Server Stats

Post by ^DooM^ » 2009-12-02 13:23

I was getting the graph stuff when i was local as well. I'll switch the config to external domain and see if that fixes.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Live Server Stats

Post by ^DooM^ » 2009-12-02 13:26

Nope still broken chap.

Edit* it's working now i added the folder to installed url. I assumed wrongly that this was just for the domain name. maybe should put a note about that in the config.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-12-02 14:55

cool :)

yeah ... summat about full external url ... will do for next version.

S.

User avatar
mattg
Moderator
Moderator
Posts: 21103
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Live Server Stats

Post by mattg » 2009-12-02 14:56

sheffters wrote:@mattg : Server 2003 has IIS 6, not sure what came with 2000.
Yes, that's nearly what I said. :mrgreen:
mattfox27 wrote:I installed this on IIS6 on win2k server and i'm getting this error...
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2009-12-02 14:58

mattg wrote:
mattfox27 wrote:I installed this on IIS6 on win2k server and i'm getting this error...
ah ... got ya ... sorry ... mentally busy at work and not had much sleep ... :)

S.

User avatar
mattg
Moderator
Moderator
Posts: 21103
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Live Server Stats

Post by mattg » 2009-12-02 15:20

No stress mate.
Getting ready for bed myself... (GMT +10)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

DanCML
Normal user
Normal user
Posts: 103
Joined: 2009-07-08 17:56

Re: Live Server Stats

Post by DanCML » 2009-12-08 15:30

mattg wrote:You say earlier Win 2K server but IIS 6.0
IIS 6,0 shipped with Server 2003 if memory serves, and server 2000 shipped with IIS 4.0 I recall
Windows 2000 shipped with IIS5 :)
XP Pro 32-bit has IIS5.1, XP Pro 64-bit has IIS6
Vista and Windows 2008 have IIS7
Windows 2008 R2 and Windows 7 have IIS7.5

IIS3 and IIS4 were never shipped pre-installed in Microsoft OS. Windows NT 4 had IIS2, to get IIS3 you had to install NT Service Pack 3, and to get IIS4 you had to install the NT 4 Option Pack.

My first IIS server was on NT3.51, prior to that I ran EMWACS on NT 3.5. I'm now into my 15th year of running web servers (currently IIS5 and II6 for work relates sites, and Apache2 for my personal projects) ... :P

User avatar
sheffters
Senior user
Senior user
Posts: 453
Joined: 2009-07-01 20:46
Contact:

Re: Live Server Stats

Post by sheffters » 2010-02-03 19:04

Hi,

Due to personal stuff I've had to get rid of my servers ... I've attached the latest version of HML incase anyone is still interested.

Will hopefully get back online in a couple of months, but till then, I've got no servers with fixed IPs.

Cheers

S.
hMail Live v0.2.3.zip
hMail Live 0.2.3
(242.8 KiB) Downloaded 599 times

terrencejun
New user
New user
Posts: 5
Joined: 2011-05-12 11:37

Re: Live Server Stats

Post by terrencejun » 2011-05-12 11:43

hi,

i facing this error when browse it "Config File Version Error" there is some 1 facing the same thing before but i cant see any solution there... :(

Post Reply