Changes for page Deployment-Book
Last modified by Aaron Rosenzweig on 2012/01/23 04:38
From version 6.1
edited by Pascal Robert
on 2011/05/08 23:48
on 2011/05/08 23:48
Change comment:
There is no comment for this version
To version 9.1
edited by Pascal Robert
on 2011/05/08 03:17
on 2011/05/08 03:17
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,26 +1,9 @@ 1 += Deployment = 2 + 1 1 == Using Apache: Develop Like you Deploy == 2 2 3 -Most of the WebObjects deployments are done in a UNIX (Mac OS X, Linux, BSD) environments, and most of the time deployment also involve Apache httpd. Since you are probably developing your applications on a Mac OS X box and Apache httpd come bundled with it, it's really easy to setup a deployment-like setup on your development box. You can also get a small deployment environment by renting a VM on services like Amazon EC2 or Linode. 4 - 5 -Deployment typically need the following tools: 6 - 7 -* A Web server (Apache httpd) 8 -* A Web server module (mod//webobjects for Apache)// 9 -* wotaskd 10 -* JavaMonitor 11 - 12 -For a deployment-like environment on your deployment box, JavaMonitor is not needed, but you do need wotaskd, the Web server and the module. 13 -[[WO:WO 5.4 Getting Started]] 14 -[[WO:Running Through Apache - Leopard & Snow Leopard Client - Summary]] 15 - 16 16 == Why Deployment at the Beginning? == 17 17 18 -You might wondering: why bother with deployment so early one? So of the reasons are: 19 - 20 -* You can use features like mod//rewrite, which are not available when using DirectConnect.// 21 -* You can detect deployment problems early on. Nothing is worst than finding deployment problems when you deploy it and found out that you forgot a lot of things. 22 -* You can use static content or scripts (PHP, etc.) that are not bundled in your applications. 23 - 24 24 == Structure of .framework and .woa Build Products == 25 25 26 26 {{code}} ... ... @@ -34,49 +34,14 @@ 34 34 -> Info.plist 35 35 -> Java 36 36 -> Properties 37 - -> *.eomodeld 38 38 -> WebServerResources 39 39 -> English.lproj, ... 40 - -> .css/.png 41 41 -> .css/.png 42 42 43 43 {{/code}} 44 44 45 -{{code}} 46 - 47 -.woa 48 - -> AppName 49 - -> AppName.cmd 50 - -> WOBootstrap.jar 51 - -> Content 52 - -> Frameworks 53 - -> Info.plist 54 - -> MacOS 55 - -> MacOSClassPath.txt 56 - -> MacOSXServerClassPath.txt 57 - -> Resources 58 - -> English.lproj, ... 59 - -> ValidationTemplate.strings, Localizable.strings 60 - -> .wo, .api 61 - -> CustomInfo.plist 62 - -> Java 63 - -> *.eomodeld 64 - -> Properties 65 - -> UNIX 66 - -> UNIXClassPath.txt 67 - -> WebServerResources 68 - -> English.lproj, ... 69 - -> .css/.png 70 - -> Windows 71 - -> CLSSPATH.TXT 72 - -> SUBPATHS.TXT 73 - 74 -{{/code}} 75 - 76 76 == WebObjects and Classpaths == 77 77 78 -The classpath that your applications use can be different in development and deployment, and that's one of the reasons why you should create a deployment environment early on. The WebObjects runtime includes the following directories when you deploy your applications: 79 - 80 80 == Organizing Deployments == 81 81 82 82 == Apache Configuration == ... ... @@ -83,14 +83,8 @@ 83 83 84 84 == SSL Configuration == 85 85 86 - It'suseful to create a https configuration on your deployment-likesetup. By doing that, you can try out switching between SSL and non-SSL andmake sure that switching is working well. Onyour developmentbox, no need to purchaseaSSL certificate, you cancreate a self-signed certificate forfree. Tocreateaelf-signedcertificate onOS X, check [[this page>>http://wiki.objectstyle.org/confluence/display/WO/Development-SSL+requests+via+https+protocol]].34 +== Deployment Components: JavaMonitor, Wotaskd and javawoservice == 87 87 88 -{{code}} 89 - 90 -Deployment Components: JavaMonitor, Wotaskd and javawoservice 91 - 92 -{{/code}} 93 - 94 94 == Setting up JavaMonitor == 95 95 96 96 == Editing spawnofwotaskd.sh == ... ... @@ -97,36 +97,14 @@ 97 97 98 98 == Configuring an Application == 99 99 100 -* By using JavaMonitor's GUI 101 -* By using JavaMonitor's REST services 102 - 103 103 == Logging and Permissions == 104 104 105 -Permissions are a typical deployment problem that arise from time to time in the mailing lists. By default, on deployment boxes, applications are running under the "appserver" user, but when you upload your application to your deployment server, the script that launch your application will be owned by the user who uploaded the application and "appserver" might not be able to launch the application. If your application doesn't launch and you don't get any logging going on, good chance that the problem is related to permissions on the launch script. 106 - 107 107 == Optimization: Adjusting Timeouts, Memory Usage, and Number of Instances == 108 108 109 109 == Trouble Shooting: Where to look when things go wrong == 110 110 111 -The first thing to do when an application doesn't launch by JavaMonitor/wotaskd is to launch it by command line. To do so, open a command line shell, logging as the "appserver" and start the launch script manually. For example, if you have an application named "MyApp.woa" in /Library/WebObjects/Applications, do the following commands: 112 - 113 -* sudo s 114 -* su - appserver 115 -* cd /Library/WebObjects/Applications/MyApp.woa 116 -* ./MyApp 117 - 118 -99% of the time, that procedure will show the problems, in particular permissions and classpath problems. 119 - 120 120 == Deployment alternatives (servlet, mod//proxy)// == 121 121 122 -== HandlingTransitionsbetweenhttpandhttps==50 +== Wonder versions of wotaskd and JavaMonitor == 123 123 124 -== Using Jenkins for builds == 125 - 126 -Using a continuous build system is useful. Many people in the community don't even build their applications on their development boxes anymore, they use a continuous build system to build projects from a source control repository. This is even more useful if you have more than one developer working on your projects, by centralizing builds, you can detect source merge problems, etc. You can even run unit tests and do deployments from a build system. 127 - 128 -The most popular continuous build system is Jenkins. It's an open source project build in Java, with many useful plugins. 129 - 130 -== Using a staging server == 131 - 132 -It's not a requirement early on, but if your development and development environments are not alike (for example: development on OS X, deployment on Linux), you should create a staging environment that is setup exactly like your production environment. By "exactly", we means that for instance if your production environment is using CentOS 5 64bits (x86//64), your staging environment should use the same OS, and the same version of Apache, etc. A staging environment will allow your customers to try new versions of your apps without putting them on your production server, and you can detect environment-specific problems.// 52 +== Handling Transitions between http and https ==