Hi Ken,
On Jun 28, 2007, at 3:09 PM, Ken Tabb wrote:
Thanks for the ideas Chuck. Thanks to your leads, I think I might
be onto something:
Firstly, to answer your points, Apache's httpd.conf has ServerName
set to the full canonical name of the site.
That, there, is probably your problem. That machine has a canonical
name and IP address. One that reverse DNS will lookup. Open a
Terminal and type
hostname
The result (which should not be a localhost or machine.local name) is
what you want to use as the ServerName in httpd.conf and as the host
name in JavaMonitor. If you don't do this, you might as well just
shave your head. It will be quicker and less painful than the route
you have chosen. :-) That this does not match the virtual host you
want to serve your app under is utterly irrelevant.
If this _is_ the name you are using, your server is probably too
fast. The WO services are starting before the networking stuff has
settled down. IIRC, the fix is to add a sleep command to start of
the script that launches the WO stuff. I have not had to do this
yet, so I don't recall the details.
Chuck
Monitor's host is also set to the same full canonical name. But the
host IP address (listed underneath the host name) was showing as
127.0.0.1. Whenever it's displayed as 127.0.0.1 in the Host page, I
got the behaviour described before:
- instances die according to Monitor
- but they are actually still alive and well on port 2001 (and 2002
for 2nd instance etc.)
- Monitor doesn't auto-recover the instance (even though Auto
Recover is set to be on)
- when you try to restart the instance (using green & red start/
stop button in Monitor), it says that the port 2001 is 'still' in
use (and it is, by the rogue instance that never died in the first
place).
- going to www.myserver.com:2001/cgi-bin/WebObjects/
HelloWorldWOApp.woa shows you the app. Going to the same address
without the :2001 (i.e. going through port 80) doesn't work
("requested app was not found on this server").
However, at one point tonight (in the UK by the way!), I deleted
everything within Monitor (as in all instances, all apps, and the
one and only host). I then rebooted the server, and via Monitor set
it all up again. This time the host was listed as the full
canonical name (again) but with the real IP address (not
127.0.0.1). At this point, instances started, and were being
managed properly/accurately by Monitor. I could even get to the
instances on port 80. I can't begin to describe to you my happiness
at this point (and indeed I think some hair even started growing
back).
I then restarted the server, to check that it would still work
while my back was turned. And it didn't... the host was once again
www.myserver.com, but 127.0.0.1, and I was getting instances dying
(which weren't really dying) as per above. Deleting and configuring
hosts within Monitor sadly lists them as 127.0.0.1 each time.
So what is the required wrist movement necessary to keep the real
IP address set in the Host page, do you reckon? Suffice it to say
there's only 1 WO Monitor / wotaskd on the subnet, and it's all on
this one machine.
Thanks in advance,
partially-haired Ken
p.s. I guess it's only sporting to point out that apache is serving
3 virtual hosts (which have always worked), but it's the main one
that's doing WO (or trying to)
On 28 Jun 2007, at 4:41 pm, Chuck Hill wrote:
So:
If I reboot the server, then the log file (/tmp/
kensGoingCrazyLog ) doesn't exist yet. Fair enough.
If I log into Monitor and start my HelloWorldWOApp from within,
it dies once, and doesn't attempt further reincarnations (it
stays off, even though Auto Recover is set to On). So at this
point there should be no instances running (it says 0 in Monitor
too).
However if I now 'sudo tail -f /tmp/kensGoingCrazyLog', I get
(names and IP addresses obscured to protect the innocent):
[2007-06-28 15:37:39 BST] <main> Creating LifebeatThread now
with: HelloWorldWOApp 2001 www.myserver.com/myServerIPAddress
1085 30000
Welcome to HelloWorldWOApp!
[2007-06-28 15:37:39 BST] <main> The URL for webserver connect is:
http://www.myserver.com/cgi-bin/WebObjects/
HelloWorldWOApp.woa/-2001
The URL for direct connect is:
http://www.myserver.com:2001/cgi-bin/WebObjects/HelloWorldWOApp.woa
[2007-06-28 15:37:39 BST] <main> null
[2007-06-28 15:37:39 BST] <main> Waiting for requests...
Sure enough if I go to either
www.myserver.com:2001
or
www.myserver.com:2001/cgi-bin/WebObjects/HelloWorldWOApp.woa
... it gives me HelloWorld with the NSTimestamp :o
Go back into Monitor, it still says nothing's running. In fact if
I try to start the instance that apparently died, I get (in red
text above the table with the Frankenstein On/Off switch etc):
www.myserver.com: HelloWorldWOApp-1 cannot be started because
port 2001 is still in use
... and going to port 2001 is still working at this point. The
instance still shows 1 death, and allegedly 'not running' even
though it is :-/
If I try to add another instance, exactly the same thing happens;
it claims the instance dies immediately, yet it's alive and
running directly on port 2002 (in the case of this second instance).
This sounds more like a monitor / wotask communication problem.
What is the host name in monitor?
Is this the canonical name for that machine?
Is this the same as the ServerName in Apache?
Is wotaskd running?
Is it a DirectConnectEnabled thing, do you reckon?!
No, but I would disable this for things running through monitor.
I have barely any hair left to be pulling out at this point...
Less to get cut then.
Chuck
On 27 Jun 2007, at 7:26 pm, Chuck Hill wrote:
Sounds like a permissions problem. Apps run from JavaMonitor
now run under appserveruser not root. See if this helps:
http://www.gvcsitemaker.com/gvc.webobjects/
faq&mode=single&recordID=19193&nextMode=list
On Jun 27, 2007, at 2:26 AM, Ken Tabb wrote:
Hi folks,
If you don't want to see a grown man cry, look away now!
It's been a while since I had to deploy a WOApp, so I'm a wee
bit rusty. I'm having a bit of jip deploying an app that works
fine in Development mode on my powerbook, but not fine
(instances die) in Deployment on the Mac OS X Server (10.4.10,
although 10.4.9 exhibited the same symptoms). I'm using Xcode
2.4.1 (on 10.4.10, ditto 10.4.9 did the same) to develop.
So I decided to simplify by deploying a HelloWorldWOApp, which
just says "HelloWorld" along with an NSTimestamp.
So I build the project as Deployment (sudo xcodebuild install -
configuration Deployment DSTROOT=/) on my powerbook, then copy
the .woa and .jar over into the web server's /Library/
WebObjects/Applications. This is all as user 'sadmin' (server
admin).
If I add the app via Monitor (/Library/WebObjects/Applications/
HelloWorldWOApp.woa/HelloWorldWOApp), that's fine. If I add
instances via Monitor, they die instantly (as in, within the
"Time allowed for startup" variable for that app in Monitor).
If instead I ssh into the server and type the following (as
user sadmin), the app works fine via direct connection
sudo /Library/WebObjects/Applications/HelloWorldWOApp.woa/
HelloWorldWOApp -WOPort 27961 -WOCachingEnabled YES -
WODebuggingEnabled NO -WOOutputPath /var/log/kenWOLog -
WOAutoOpenInBrowser NO -WOAutoOpenClientApplication NO -
WOLifebeatInterval 30 -WOLifebeatEnabled YES -
WOLifebeatDestinationPort 1085 -WOAdaptor WODefaultAdaptor -
WOWorkerThreadCount 8 -WOListenQueueSize 128 -
WOWorkerThreadCountMin 16 -WOWorkerThreadCountMax 256 -
NSProjectSearchPath \(\) -WOSessionTimeOut 3600 -
WOApplicationName HelloWorldWOApp -WOMonitorEnabled YES -
WONoPause YES
... I can go to http://www.myserver.com:27961/ and see the app
fine. This also works without the 'sudo' (i.e. as sadmin).
If I copy the above blurb into Monitor's "Additional Arguments"
section for new instances of my app (starting at the -WOPort
bit, and giving a different port number so that I can tell
which is which), they still die.
I've tried sudo chmod-ing -R go+rx /Library/WebObjects/
Applications, but it makes no difference.
I haven't built a 'WebServer' version (as there are no
WebServerResources either in the HelloWorldWOApp or my real
app) - should I have done this?! When I tried building with -
configuration WebServer on my powerbook, it didn't put anything
extra in HelloWorldWOApp.woa/Contents/, so I'm guessing that's
not the problem.
Other info that may be clues: Apache server (v1.3.x as per
MOSXS), Apache module running, non-standard apache document
root (i.e. it isn't /Library/WebServer/Documents, but apache
has always been fine with this, and I made sure to put the
right one into WebObjects' apache.conf). As I say, if there are
no WebServerResources being served, I'm guessing that's not why
the instances are dying anyhow).
Any help would be greatly appreciated. Feel free to ridicule me
as much as you like...
Thanks in advance,
Ken
. . . . . . . . . . . . . . . . . . . . . . . . . . .
D r. K e n T a b b
Mac & UNIX programmer
Neural network & computer vision researcher
University of Hertfordshire, UK
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-deploy mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-deploy/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]