Last modified by Aaron Rosenzweig on 2012/10/18 13:08

Hide last authors
David Holt 20.1 1 This needs to be in one page - especially for beginners. I summarized my steps to run applications with Apache on a brand new Leopard install on the mailing list and it was suggested that it get put on the wiki. Please refer to the following pages if you need clarification:
David Avendasora 14.1 2
Aaron Rosenzweig 50.1 3 [[Development Tools-Running Through Apache>>doc:documentation.Home.How-tos.Development Tools-Running Through Apache.WebHome]]
Timothy Worman 48.1 4 [[doc:WO.Home.Deprecated.WO 5\.4 Getting Started.WebHome]]
David Avendasora 14.1 5
6 You don't need to set your host in JavaMonitor. I thought you did too, but it wasn't the case. You should be able to just run your application from Eclipse and it will "magically" use Apache when it is starting up.
7
Kieran Kelleher 22.1 8 The steps I took as outlined in the wiki pages above:
David Avendasora 14.1 9
Pascal Robert 40.1 10 ~1. Edit /etc/apache2/httpd.conf
null null 46.1 11 Search for "Directory /" and comment out the Order and Deny lines:
Kieran Kelleher 22.1 12
Pascal Robert 38.1 13 {{code}}
14
David Avendasora 14.1 15 <Directory />
Pascal Robert 38.1 16 Options FollowSymLinks
17 AllowOverride None
Pascal Robert 42.1 18 #Order deny,allow
19 #Deny from all
David Avendasora 14.1 20 </Directory>
21
Pascal Robert 38.1 22 {{/code}}
23
Kieran Kelleher 22.1 24 Then search for "ServerName" and add
Pascal Robert 38.1 25
26 {{code}}
27
David Avendasora 14.1 28 ServerName localhost
29
Pascal Robert 38.1 30 {{/code}}
31
David Avendasora 14.1 32 Add a line that points to the WebObjects apache config file
Pascal Robert 38.1 33
34 {{code}}
35
David Avendasora 14.1 36 Include /System/Library/WebObjects/Adaptors/Apache2.2/apache.conf
37
Pascal Robert 38.1 38 {{/code}}
39
Pascal Robert 40.1 40 2. My apache.conf (/System/Library/WebObjects/Adaptors/Apache2.2/apache.conf) file contained the line to load the WebObject module
null null 46.1 41 Confirm that apache.conf also includes:
David Avendasora 14.1 42
Pascal Robert 38.1 43 {{code}}
Timothy Worman 26.1 44
Pascal Robert 38.1 45 WebObjectsConfig [http://localhost:1085] 10
Timothy Worman 26.1 46
Pascal Robert 38.1 47 {{/code}}
48
Timothy Worman 48.1 49 3. Add the launchd plist files necessary to start monitor and wotaskd during system startup to your /System/Library/LaunchDaemons/ directory. If you are using WO 5.4.x you can probably find the plists at /Developer/Examples/JavaWebObjects/Deployment/launchd/ If you cannot find them there, you can find instructions to produce them here: [[doc:WO.Home.Deprecated.WO 5\.4 Getting Started.WebHome]] If you do not specify WOHost in your plist, you will need to add the "WOHost=localhost" to the properties file in wotaskd (/System/Library/WebObjects/JavaApplications/wotaskd.woa/Contents/Resources/Properties)
Pascal Robert 38.1 50
Pascal Robert 40.1 51 4. Change permissions of the launch daemon plists for wotaskd and monitor to **exactly** what is written in the wiki
Pascal Robert 38.1 52
David Holt 32.1 53 {{code}}
54
Pascal Robert 38.1 55 $ cd /Library/LaunchDaemons/
David Holt 32.1 56 $ chmod 644 com.apple.webobjects.womonitor.plist
57 $ chmod 644 com.apple.webobjects.wotaskd.plist
58 $ sudo chown root:wheel com.apple.webobjects.womonitor.plist
59 $ sudo chown root:wheel com.apple.webobjects.wotaskd.plist
60
61 {{/code}}
62
Pascal Robert 40.1 63 5. Set your launch parameters in your application:
David Avendasora 14.1 64
Pascal Robert 38.1 65 {{code}}
David Avendasora 14.1 66
Pascal Robert 42.1 67 -WODirectConnectEnabled false
68 -WOHost localhost
69 -WOAdaptorURL [http://localhost/cgi-bin/WebObjects]
70 -WOPort 5555
Pascal Robert 38.1 71
72 {{/code}}
73
null null 46.1 74 6. Update mod_WO
75 You will need to replace your mod_WebObjects.so located at /System/Library/WebObjects/Adaptors/Apache2.2/mod_WebObjects.so with the appropriate version of [[mod_WebObjects>>url:http://wocommunity.org/documents/tools/mod_WebObjects/Apache2.2/macosx/||shape="rect"]] This will allow you to use SSL and solves a lot of problems where pages return **No instance available** errors. Make note of the original file's permissions and duplicate them on the replacement. Once you do this, restart Apache.
Timothy Worman 26.1 76
Pascal Robert 40.1 77 7. Load the LaunchDaemons. Make sure the filenames of the plists are the same as the module you're loading. I know this seems obvious, but it appears that the filenames have changed over time from "com.apple.webobjects.womonitor.plist" to "com.apple.womonitor.plist". The wiki calls for the loading of a module named "com.apple.webobjects.womonitor.plist" (notice the extra **webobjects**). You may not load the modules if you use the wiki instructions on the command line and don't notice the naming difference of the files.
Kieran Kelleher 22.1 78
David Avendasora 14.1 79 If the LaunchDaemons are already loaded and you've made no changes, you should be able to start your application directly. If you've made changes and the LaunchDaemons are already loaded, you'll have to restart your machine to kick off launchd.
80
Pascal Robert 34.1 81 I needed to change permissions on /Library/WebObjects/Configuration because I was getting this error:
82
83 Don't have permission to write to Configuration Directory /Library/WebObjects/Configuration/ as this user; please change the permissions.
84
85 {{code}}
86
87 sudo chown _appserver:_appserveradm Configuration
88
89 {{/code}}
90
Kieran Kelleher 22.1 91 Steps 8, 9, 10. If that doesn't work, go back and double check every one of the settings. You'll probably find one of them has a typo or something. I am sure I did it three or four times before I finally got it all to work.
Pascal Robert 34.1 92
null null 45.1 93 If things still aren't working, make sure that wotaskd and JavaMonitor are executable.
null null 43.1 94
null null 45.1 95 Each of these should both have their permissions set to executable.
96
97 {{code}}
98
99 <pathto>/wotaskd.woa/wotaskd
100 <pathto>/JavaMonitor.woa/JavaMonitor
101
102 {{/code}}
103
David Avendasora 49.1 104 See this page for debugging tips: [[doc:documentation.Home.Deployment.Troubleshooting.Troubleshooting wotaskd and JavaMonitor on OS X.WebHome]]