Deploying WO on Windows

31
Deploying WO on Windows Markus Stoll junidas GmbH, Stuttgart

Transcript of Deploying WO on Windows

Page 1: Deploying WO on Windows

Deploying WO on WindowsMarkus Stolljunidas GmbH, Stuttgart

Page 2: Deploying WO on Windows

• customer requirement

• Windows integration

• WebObjects 4.x migration / mixed deployment

• Why not?

Windows deployment, why?

Page 3: Deploying WO on Windows

WebObjects on Windows

• Setup explained, Demos

• Common pitfalls

• Tools and techniques for Debugging

• URLs for stuff you need

• Q&A

Page 4: Deploying WO on Windows

Windows prerequisites

• Windows Server 2003, 2008 (and 2012), 64/32 Bit

• (Windows 7)

• Install all updates / service packs

• Install Java RE (current 64 Bit)

• Turn off Firewall

• Install Notepad++

Page 5: Deploying WO on Windows

WO prerequisites

• Install WebObjects 5.4.3 on a Mac

• pack /System/Library/Frameworks/Java* (except JavaVM.fw)

• Compile current WONDER

• pack WONDER fw, apps, examples

Page 6: Deploying WO on Windows

Windows basic setup

• Install VC 2010 Redistributable Packages (64 Bit / 32 Bit)(Apache & WOStart depend on it)64 Bit / 32 Bit

• Choose proper hostname

Page 7: Deploying WO on Windows

WO basic setup

• Choose WO base dir (c:\Apple)

• ENV-Variable NEXT_ROOT

• Create Subfolders

• .\Library\Frameworks

• .\Local\Library\Frameworks

• .\Local\Library\WebObjects\Configuration

• .\Local\Library\WebObjects\JavaApplications

Page 8: Deploying WO on Windows

Demo 1, Setup

• Windows setup

• WO setup

Page 9: Deploying WO on Windows

WOStart

• modified WebObjects-aware Java.exe

• <AppName>.exe replaces <AppName>.cmd / WOBootstrap.jar

• parse Contents\Windows\CLSSPATH.TXT

• application class

• classpath

• JVM parameters

• find and load jvm.dll

Page 10: Deploying WO on Windows

WOStart, advantages

• no sub process

• process name == App name

• classpath loaded as system classpath

• able to run as NT Service

with same cmd line parameters

Page 11: Deploying WO on Windows

WO app as NT Service

• sc.exe create <ServiceName> displayName= "<DisplayName>" binPath = "<PathToWOStart> <WOParameters>" start= auto

• sc.exe failure <ServiceName> reset= 30 actions= restart/3000

• sc.exe start <ServiceName>

Page 12: Deploying WO on Windows

WOStart 64 Bit vs. 32 Bit

• 2 Binaries: 64 Bit and 32 Bit

• WOStart.exe must match the chosen Java VM architecture!

• VC 10 redist!

Page 13: Deploying WO on Windows

Demo 2, WOStart

• WOStart

• Install wotaskd and JavaMonitor as NT Service

Page 14: Deploying WO on Windows

JavaMonitor / WOTaskD

WOTaskD

WO App 1WO App 2WO App 2

WO Apps

start/stop

Diskconfig

lifebeat

JavaMonitor

Page 15: Deploying WO on Windows

JavaMonitor / WOTaskD, multiple hosts

WOTaskD

WO App 1WO App 2WO App 2

WOTaskD

WO App 1WO App 2WO App 2

JavaMonitor

WOTaskD

WO App 1WO App 2WO App 2

Page 16: Deploying WO on Windows

Demo 3, Setup JavaMonitor

• Declare host

• Create App & Instance

Page 17: Deploying WO on Windows

WebServer / Apache vs. IIS

• IIS

• integrate remote static content

• integrate ASP/.NET content

• modify Adaptor

• needs patched Application class

• Apache

• need for Apache modules

• integrate PHP (secure)

Page 18: Deploying WO on Windows

IIS

• Refurbished WOAdaptor

• IIS 7 / 64 Bit and 32 Bit

• Bugfixes (stable like Apache-Adaptor)

• Streaming (even with unset Content-Length)

• Compile using MingW

• WebObjects 4.x compatibility

Page 19: Deploying WO on Windows

IIS, cont.

• WOAdaptor is ISAPI-Extension, NOT ISAPI-Filter

• Add Server Role „Web Server (IIS)“

• Option „ISAPI-Extensions“

• Register WOAdaptor at „CGI and ISAPI Restrictions“

• Enable ISAPI-dll at „Handler Mappings“

• Create folders / declare in WebSite

• Configure in Registry

Page 20: Deploying WO on Windows

IIS / Application patch

// patch ERXApplication or your Application by adding:

String[] myAdaptorExtensions = new String[]{}

@Override public String[] adaptorExtensions() { return myAdaptorExtensions; }

Page 21: Deploying WO on Windows

Demo 4, IIS setup

• IIS installation

• Adaptor config

• WebSite config

• 32 Bit mode

Page 22: Deploying WO on Windows

Apache 2.4 under Windows

• Binaries for httpd and WOAdaptor available

• avoid compiling

• runs as NT Service

• short Demo

Page 23: Deploying WO on Windows

Debugging WOStart / WOApps

•WOStart debuggingset _JAVA_LAUNCHER_DEBUG=1WOStart.exe ...

• WOTaskD/JavaMonitor debuggingContents\Resources\Properties:NSDebugLevel=NSLog.DebugLevelDetailedNSDebugGroup= NSLog.DebugGroupDeployment

• All Apps: Java Remote DebuggingContents\Windows\CLSSPATH.TXT:# JVMOptions == -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n

Page 24: Deploying WO on Windows

Debugging WOAdaptor

• IIS

• always runs as background task

• Process Explorer: is DLL loaded?

• Where is my TMP-Folder?

• New Reg-KeyLOG_PATH (full path to log file)LOG_FLAG (full path to log flag)

• Apache

• start manually

Page 25: Deploying WO on Windows

Pitfalls

• text files & line endings

• 32 Bit vs. 64 Bit (Wow64)

• ONE user for all WO apps

• LocalService or dedicated user

• no sudo (RunAs does not help)

• Permissions Logs & config files

• process / user limits

Page 26: Deploying WO on Windows

Pitfalls, cont.

• est. TCP connections do block socketshttp://support.microsoft.com/kb/929851

• storage access / UNC paths

• automatic Windows updates

• IIS app pools / worker recycling

Page 27: Deploying WO on Windows

Aftermath

• Set WOAdaptor credentials

• Set JavaMonitor credentials

• Firewall

Page 28: Deploying WO on Windows

Windows deployment, URLs

• VC 10 Redist., 64 Bithttp://www.microsoft.com/en-us/download/details.aspx?id=13523

• VC 10 Redist., 32 Bithttp://www.microsoft.com/en-us/download/details.aspx?id=8328

• WOStart binarieshttp://wocommunity.org/documents/tools/WOStart.zip

• WOStart source${WONDER}/Utilities/WOStart

Page 29: Deploying WO on Windows

URLs, cont.

• WOAdaptor, IIS (DLL & EXE, 32 Bit, 64 Bit)http://wocommunity.org/documents/tools/mod_WebObjects/IIS/

• Apache for Windowshttp://www.apachelounge.com/download/

• WOAdaptor, Apache/Windows (32 Bit, 64 Bit)http://wocommunity.org/documents/tools/mod_WebObjects/Apache2.4/windows/

• WOAdaptor Source${WONDER}/Utilities/Adaptors

Page 30: Deploying WO on Windows

Tools

• Process Explorer (Microsoft Sysinternals)

• Process Monitor (Microsoft Sysinternals)

• Notepad++

• wireshark / Packetyzer / Fiddler2

• powershell

• MingW / MingW64

Page 31: Deploying WO on Windows

Q&A