Web test failing

The forum for help and support with FreeNATS as well as any useful hints and tips
Post Reply
paullanders
Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm

Web test failing

Post by paullanders » Tue Nov 17, 2009 8:43 pm

Hi Dave.

Our I.T. just upgraded our Exchange email servers to 2007. I previously was successfully checking the web interface with FreeNATS, but after the upgrade and the associated new URL I am unable to do a successful FreeNATS test. Here is the new URL:

https://mail.ttuhsc.edu/exchweb/bin/auth/owalogon.asp

Any help would be appreciated.

Thanks!

Paul

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: Web test failing

Post by dave » Fri Nov 20, 2009 8:56 am

Hi Paul,

Works fine from here though (times vary from 4s to 11s from Namibia) I notice I can't ping the host (assume that's not an issue or off for you).

Try the following:
- open a console on the FreeNATS box
- cd to the server/bin directory
- do (as root or via sudo): php tester.php [nodeid]
-- where nodeid is the id of your exchange server - see what the output is.

This is what I get:

Image

Cheers,

Dave.

paullanders
Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm

Re: Web test failing

Post by paullanders » Fri Nov 20, 2009 11:14 pm

Hi Dave.

OK, here's the results for the CLI test:

NodeID: ttuhsc_owa
Doing Local Tests
Test: wtime (https://mail.ttuhsc.edu/exchweb/bin/auth/owalogon.asp)
Result: -1
Eval: 2
Test: wtime (https://mail.ttuhsc.edu/exchweb/bin/auth/owalogon.asp) X2
Result: -1
Eval: 2
Recording Test
Nodeside Testing
Highest Alert Level: 2
Alert Count : 1
Alerts: TTUHSC OWA failed,

Finished Tests... Finishing Off
Summary: Tester 14114006 Highest Level 2, Alerts 1
NATS Stopped... Finished

Thanks!

Paul

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: Web test failing

Post by dave » Sun Nov 22, 2009 8:35 pm

Hi Paul,

Ok after a little digging I've traced this to how your newest IIS/OWA treats HTTP/1.0 web clients - it doesn't like them and returns a 400 bad request error.

It looks like you don't have cURL enabled in your environment so the default PHP HTTP/S wrapper for fopen is used. This is why it passed for me until I tried without cURL.

Even though fopen will request HTTP/S as HTTP/1.0 rather than HTTP/1.1 the MS side doesn't like 1.0 requests from clients it doesn't directly reckognise as 1.0 only compliant. This is a little of a WTF.

Anyway - I've now set the fopen test to spoof a user-agent of "MSIE 4.0b2" which was an HTTP/1.0 only compatible browser and IIS/OWA will reckognise and process as such.

This is added in 1.06.3a. Rather than making it environmental or anything it's set to use this always for fopen requests as it looks like some other MS stuff may exhibit the same behaviour.

http://www.purplepixie.org/freenats/rel ... on=1.06.3a

I hope this resolves your issue.

Kind regards,

Dave.

paullanders
Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm

Re: Web test failing

Post by paullanders » Mon Nov 23, 2009 4:43 pm

Hi Dave.

Looks like the update did not succeed. I think cp --reply=yes is deprecated and perhaps instead should be -f ?

Code: Select all

Installing/Upgrading ---
- Cleaning Up
/bin/mv server/web/firstrun.php server/web/firstrun-.php
- Upgrade
- Protecting Existing Config
/bin/mv server/web/include.php server/web/include-.php
/bin/mv server/bin/include.php server/bin/include-.php
/bin/mv server/base/config.inc.php server/base/config-.inc.php
- Copying Files
/bin/cp -Rf -v --reply=yes server/base/* /opt/freenats/server/base/
/bin/cp: unrecognized option '--reply=yes'
Try `/bin/cp --help' for more information.
/bin/cp -Rf -v --reply=yes server/web/* /opt/freenats/server/web/
/bin/cp: unrecognized option '--reply=yes'
Try `/bin/cp --help' for more information.
/bin/cp -Rf -v --reply=yes server/bin/* /opt/freenats/server/bin/
/bin/cp: unrecognized option '--reply=yes'
Try `/bin/cp --help' for more information.
- Cleaning Up
/bin/mv server/web/include-.php server/web/include.php
/bin/mv server/bin/include-.php server/bin/include.php
/bin/mv server/base/config-.inc.php server/base/config.inc.php
--- Complete
I didn't know about the web test using PHP cURL. I checked and sure enough php5-curl was not installed on my box. The moment I installed php5-curl the OWA test began working! I'm guessing that FreeNATS first checks for php's curl module and if it's not present/active it then uses fopen? I didn't see a system setting for this behavior so I'm guessing it's hard-coded?

BTW - will I need to do a schema upgrade when I update to 1.06.3a ?

Thanks again!

Paul

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: Web test failing

Post by dave » Mon Nov 23, 2009 7:38 pm

Hi Paul,

Hmm... Had totally missed that depreciation, thanks for catching it.

The reason --reply=yes was included was to cater for some environments which alias cp with cp -i. Actually the scripts now use /bin/cp directly rather than cp so avoiding any alias trouble. I have removed the --reply=yes and the cp commands are now in the form "cp -Rf -v $1 $2". This works on the FreeNATS VM (where cp is aliased to cp -i) and should be ok.

1.07.0a has this in - http://www.purplepixie.org/freenats/rel ... on=1.07.0a

Off the top of my head I think that the schema hasn't changed but I can't just diff or md5 the files as the mysqldump system I use has. Last time I told someone (maybe you) to not worry about it a field had changed and their system broke. To be on the safe side I would run a schema update.

Originally the web tests just used fopen() but that was found to be a bit slow and sometimes inconsistent with results. As you guessed the system is hard coded to use cURL if it is available otherwise just falling back on fopen(). cURL is the better option anyway.

Glad your test is no longer failing anyway and thanks again for the cp --reply catch.

Regards,

Dave.

paullanders
Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm

Re: Web test failing

Post by paullanders » Tue Nov 24, 2009 6:36 pm

Thanks, Dave! All is well after the upgrade. I played it safe and did a schema upgrade, but it turns out it was not required.

Still loving FreeNATS!

Paul

Post Reply