Wiki source code of Programming__WebObjects-Development Tools-Running Through Apache
Version 62.1 by smmccraw on 2007/07/08 10:29
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
62.1 | 1 | If you are accessing your application with URLs that look like http:~/~/localhost:45437/cgi-bin/WebObjects/AppName.woa/ (with the xxx:portnum instead of xxxx/-portnum) ... then you are using the [[Evil Direct Connect>>Programming__WebObjects-Web Applications-Development-Direct Connect]]. See that page for why you don't want to be using Direct Connect. See this page for how to stop. |
![]() |
22.1 | 2 | |
![]() |
62.1 | 3 | == Turn on Apache == |
![]() |
22.1 | 4 | |
![]() |
62.1 | 5 | Go to **System Preferences -> Sharing -> Services** and turn on **Personal Web Sharing** if it is not already on. |
![]() |
28.1 | 6 | |
![]() |
62.1 | 7 | == Edit Apache Config == |
![]() |
22.1 | 8 | |
![]() |
62.1 | 9 | Note: **Do NOT try to use the Bonjour / Rendezvous name of your machine in this step.** It will cause you grief. Accept this and don't even try. You have been warned. |
![]() |
22.1 | 10 | |
![]() |
60.1 | 11 | Edit **/etc/httpd/httpd.conf**, find the line containing **ServerName** and change it to this: |
![]() |
56.1 | 12 | |
![]() |
22.1 | 13 | {{code}} |
14 | |||
15 | ServerName localhost | ||
16 | |||
17 | {{/code}} | ||
18 | |||
![]() |
60.1 | 19 | That line may be commented out by default. You can simply uncomment it (remove the leading pound sign) and then restart apache: |
![]() |
22.1 | 20 | |
21 | {{code}} | ||
22 | |||
23 | sudo apachectl restart | ||
24 | |||
25 | {{/code}} | ||
26 | |||
![]() |
62.1 | 27 | == Tell wotaskd to Use Localhost Too == |
![]() |
56.1 | 28 | |
![]() |
22.1 | 29 | Edit **/System/Library/WebObjects/JavaApplications/wotaskd.woa/Contents/Resources/Properties** |
30 | |||
31 | Add this line after the **WOPort=1085** one: | ||
32 | |||
33 | {{code}} | ||
34 | |||
35 | WOHost=localhost | ||
36 | |||
37 | {{/code}} | ||
38 | |||
39 | Now you need to restart wotaskd: | ||
40 | |||
41 | {{code}} | ||
42 | |||
![]() |
31.1 | 43 | sudo systemstarter stop "WebObjects Services" |
44 | sudo systemstarter start "WebObjects Services" | ||
![]() |
30.1 | 45 | |
46 | {{/code}} | ||
47 | |||
![]() |
32.1 | 48 | or |
![]() |
30.1 | 49 | |
![]() |
32.1 | 50 | restart wotaskd and womonitor with launchctl if your WebObjects install launches that way. |
![]() |
30.1 | 51 | |
![]() |
62.1 | 52 | == Finally, Configure your Application == |
![]() |
24.1 | 53 | |
54 | Add or edit these launch parameters: | ||
55 | |||
![]() |
22.1 | 56 | {{code}} |
57 | |||
![]() |
24.1 | 58 | -WODirectConnectEnabled false |
59 | -WOHost localhost | ||
60 | -WOAdaptorURL http://localhost/cgi-bin/WebObjects | ||
61 | -WOPort 5555 | ||
![]() |
22.1 | 62 | |
63 | {{/code}} | ||
64 | |||
![]() |
24.1 | 65 | The WOPort is optional, but useful if you want consistent URLs for bookmarks and such. You can use any number you want, but it needs to be unique for each application you launch (or rather, you can only run one app instance on a given WOPort at a time). In WOLips, WOPort, WODirectConnectEnabled, and WOAdaptorURL already exist and just need to be updated. WOHost does not, and needs to be added. The dash in front of the name ("-WOHost") is important and must be in the name for the setting to work properly. |
![]() |
22.1 | 66 | |
![]() |
32.1 | 67 | You may want to set this in your global WOLips settings so you don't have to set it every time you make a new launch configuration. You will need to go back and modify existing launch configurations with these settings even if you set it globally. Global settings only apply to newly created launch configurations. |