Wiki source code of Deploying on FreeBSD 8.2 and WebObjects 5.4.3
Version 37.1 by Pascal Robert on 2012/02/11 08:51
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | This page describes the steps to install WebObjects 5.4.3 from scratch on a modern FreeBSD 8.2 system. This instructions do not include using the WOPort, as described in [[Deploying on FreeBSD 6.x and 7.x (WO 5.3.3)>>Deploying on FreeBSD 6.x and 7.x (WO 5.3.3)]]. Although the WOPort would save a lot of time, it's not being actively maintained, and AFAIK does not support WO 5.4.3. This instructions are based on WOInstaller.jar, and provide all the necessary steps to a working deployment environment, including Apache web server integration. | ||
2 | |||
3 | The following steps assume you have installed the necessary ports. Those include java/diablo-jdk16, www/apache22 and devel/git. | ||
4 | |||
5 | ~1. Download ##WOInstaller.jar## from [[http://wocommunity.org/documents/tools]] | ||
6 | |||
7 | 2. As root, create the /usr/local/apple directory: | ||
8 | |||
9 | {{code}} | ||
10 | |||
11 | mkdir /usr/local/apple | ||
12 | |||
13 | {{/code}} | ||
14 | |||
15 | 3. Run the following command to install the WebObjects frameworks in the directory just created: | ||
16 | |||
17 | {{code}} | ||
18 | |||
19 | java -jar WOInstaller.jar 5.4.3 /usr/local/apple | ||
20 | |||
21 | {{/code}} | ||
22 | |||
23 | 4. Edit ##/etc/rc.conf## and add the following lines: | ||
24 | |||
25 | {{code}} | ||
26 | |||
27 | ## WebObjects ## | ||
28 | JavaMonitor_enable="YES" | ||
29 | wotaskd_enable="YES" | ||
30 | |||
31 | {{/code}} | ||
32 | |||
33 | 5. Run the following commands to create needed directories and set correct permissions: | ||
34 | |||
35 | {{code}} | ||
36 | |||
37 | mkdir /var/run/webobjects/ | ||
38 | mkdir /var/log/webobjects/ | ||
39 | chmod ugo+x /usr/local/apple/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd | ||
40 | chmod ugo+x /usr/local/apple/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor | ||
41 | chgrp www /usr/local/apple/Local/Library/WebObjects/Configuration/ | ||
42 | chgrp g+w /usr/local/apple/Local/Library/WebObjects/Configuration/ | ||
43 | |||
44 | {{/code}} | ||
45 | |||
46 | 6. Place these two files in ##/usr/local/etc/rc.d/## directory: [[WO:Deploying on FreeBSD 8.2 and WebObjects 5.4.3^wotaskd]] and [[WO:Deploying on FreeBSD 8.2 and WebObjects 5.4.3^JavaMonitor]] | ||
47 | |||
48 | 7. Run the following commands to start ##wotaskd## and ##JavaMonitor##. After running this commands, your system should be running wotaskd and JavaMonitor. You can verify that by running ##top## or ##ps##. Also, you should take the time now to configure JavaMonitor, including setting the administration password. | ||
49 | |||
50 | {{code}} | ||
51 | |||
52 | /usr/local/etc/rc.d/wotaskd start | ||
53 | /usr/local/etc/rc.d/JavaMonitor start | ||
54 | |||
55 | {{/code}} | ||
56 | |||
57 | 8. We need to checkout Project Wonder to obtain a copy of the Apache adaptor source. To do that, cd to a work directory, and run the following command. This will checkout Project Wonder from GitHub. | ||
58 | |||
59 | {{code}} | ||
60 | |||
61 | git clone https://github.com/projectwonder/wonder.git | ||
62 | |||
63 | {{/code}} | ||
64 | |||
65 | 9. Inside the Project Wonder directory, navigate to the ##Utilities/Adaptors## directory: | ||
66 | |||
67 | {{code}} | ||
68 | |||
69 | cd Utilities/Adaptors | ||
70 | |||
71 | {{/code}} | ||
72 | |||
73 | 10. Edit the ##make.config## file, and set the OS to FreeBSD by changing the following line: | ||
74 | |||
75 | {{code}} | ||
76 | |||
77 | # Set the platform you are building on | ||
78 | ADAPTOR_OS = FreeBSD | ||
79 | |||
80 | {{/code}} | ||
81 | |||
82 | ~11. Run the ##gmake## command on that directory. Note that you have to run ##gmake## and not ##make##. Also, do not change directory to ##Apache2.2##. The command should be run on the ##Utilities/Adaptors## directory. | ||
83 | |||
84 | {{code}} | ||
85 | |||
86 | gmake | ||
87 | |||
88 | {{/code}} | ||
89 | |||
90 | 12. After successful compilation, enter ##Utilities/Adaptors/Apache2.2## directory and install the module on Apache: | ||
91 | |||
92 | {{code}} | ||
93 | |||
94 | cd Apache2.2 | ||
95 | apxs -i -a -n WebObjects mod_WebObjects.la | ||
96 | |||
97 | {{/code}} | ||
98 | |||
99 | 13. Edit the ##/usr/local/etc/apache22/httpd.conf## file and make sure the ##LoadModule## line for the WebObjects module appears before ##LoadModule## for ##mod//rewrite//##//. If not, swap the order of both lines.// | ||
100 | |||
101 | 14. Still in ##/usr/local/etc/apache22/httpd.conf## file, tweak the following configurations (you can do however you want, this are just suggestions to make it run plain and simply): | ||
102 | |||
103 | * Change ##None## to ##All## in the ##Allow## line of the following configuration section: | ||
104 | |||
105 | {{code}} | ||
106 | |||
107 | <Directory /> | ||
108 | AllowOverride None | ||
109 | Order deny,allow | ||
110 | Allow from all | ||
111 | </Directory> | ||
112 | |||
113 | {{/code}} | ||
114 | |||
115 | * Comment out the following line and section, if you want to use the default ##/cgi-bin/WebObects## URL for the WebObjects module: | ||
116 | |||
117 | {{code}} | ||
118 | |||
119 | # ScriptAlias /cgi-bin/ "/usr/local/www/apache22/cgi-bin/" | ||
120 | |||
121 | {{/code}} | ||
122 | |||
123 | {{code}} | ||
124 | |||
125 | #<Directory "/usr/local/www/apache22/cgi-bin"> | ||
126 | # AllowOverride None | ||
127 | # Options None | ||
128 | # Order allow,deny | ||
129 | # Allow from all | ||
130 | #</Directory> | ||
131 | |||
132 | {{/code}} | ||
133 | |||
134 | 15. Assuming you're still in Wonder's ##Utilities/Adaptors/Apache2.2## directory (cd to it if you left it in the previous step), copy the following file to the Apache configuration directory: | ||
135 | |||
136 | {{code}} | ||
137 | |||
138 | cp apache.conf /usr/local/etc/apache22/Includes/wo.conf | ||
139 | |||
140 | {{/code}} | ||
141 | |||
142 | 16. Edit the destination file (##/usr/local/etc/apache22/Includes/wo.conf##). You need to make two changes: | ||
143 | |||
144 | * Comment out the LoadModule line, as the module is already loaded by ##httpd.conf##. | ||
145 | * Set ##WebObjectsDocumentRoot## to ##/usr/local/www/apache22/data##: | ||
146 | |||
147 | {{code}} | ||
148 | |||
149 | WebObjectsDocumentRoot /usr/local/www/apache22/data | ||
150 | |||
151 | {{/code}} | ||
152 | |||
153 | 17. Edit ##/etc/rc.conf## again and add the following lines: | ||
154 | |||
155 | {{code}} | ||
156 | |||
157 | apache22_enable="YES" | ||
158 | |||
159 | {{/code}} | ||
160 | |||
161 | 18. Run the following command to launch Apache: | ||
162 | |||
163 | {{code}} | ||
164 | |||
165 | /usr/local/etc/rc.d/apache22 start | ||
166 | |||
167 | {{/code}} | ||
168 | |||
169 | You should now have a working web server and WebObjects deployment environment. Try to open your browser and access ##http:~/~/<your-server-name>/cgi-bin/WebObjects/app.woa## and you should see the error "The requested application was not found on this server." generated by the WebObjects adaptor. | ||
170 | |||
171 | ===== Project Wonder ===== | ||
172 | |||
173 | To install Project Wonder, assuming you performed all the previous steps and checked out Wonder from GitHub, do the following steps logged in as your username (not root): | ||
174 | |||
175 | ~1. Install the port ##devel/apache-ant## if not yet installed. | ||
176 | |||
177 | 2. Run the following command: | ||
178 | |||
179 | {{code}} | ||
180 | |||
181 | mkdir -p "~/Library/Application Support/WOLips/" | ||
182 | |||
183 | {{/code}} | ||
184 | |||
185 | 3. On that directory, create a file named ##wolips.propertipes## with the following content, adjusted to your paths: | ||
186 | |||
187 | {{code}} | ||
188 | |||
189 | #Wed Sep 17 01:33:31 WEST 2008 | ||
190 | wo.system.root=/usr/local/apple | ||
191 | wo.user.frameworks=/home/<username>/Library/Frameworks | ||
192 | wo.system.frameworks=/usr/local/apple/Library/Frameworks | ||
193 | wo.bootstrapjar=/usr/local/apple/Library/WebObjects/JavaApplications/wotaskd.woa/WOBootstrap.jar | ||
194 | wo.network.frameworks= | ||
195 | wo.api.root= | ||
196 | wo.network.root= | ||
197 | wo.extensions=/usr/local/apple/Local/Library/WebObjects/Extensions | ||
198 | wo.user.root=/home/<username> | ||
199 | wo.local.frameworks=/usr/local/apple/Local/Library/Frameworks | ||
200 | wo.apps.root=/usr/local/apple/Local/Library/WebObjects/Applications | ||
201 | wo.local.root=/usr/local/apple/Local | ||
202 | wo.systemroot=/usr/local/apple | ||
203 | wo.wosystemroot=/usr/local/apple | ||
204 | wo.wolocalroot=/usr/local/apple/Local | ||
205 | wo.localroot=/usr/local/apple/Local | ||
206 | wo.server.root=/usr/local/www/apache22/data/WebObjects | ||
207 | |||
208 | {{/code}} | ||
209 | |||
210 | 4. Create ##/usr/local/www/apache22/data/WebObjects## directory with write permission for group ##wheel## (or whatever group you are on). | ||
211 | |||
212 | 5. Run the following command: | ||
213 | |||
214 | {{code}} | ||
215 | |||
216 | chmod -R g+w /usr/local/apple/Local/Library | ||
217 | |||
218 | {{/code}} | ||
219 | |||
220 | Note that you can use more restrict permissions than the ones showed here. This should be only considered as an example. | ||
221 | |||
222 | 6. ##cd## into the Wonder directory. | ||
223 | |||
224 | 7. Run the commands: | ||
225 | |||
226 | {{code}} | ||
227 | |||
228 | ant frameworks | ||
229 | ant frameworks.install | ||
230 | |||
231 | {{/code}} | ||
232 | |||
233 | This will compile and install Wonder in your system, including the web server resources of Wonder frameworks, like Ajax. |