Last modified by Yana Oksner on 2026/01/08 11:38

From version 57.1
edited by Pascal Robert
on 2012/02/11 08:44
Change comment: Migrated to Confluence 4.0
To version 63.1
edited by Aaron Rosenzweig
on 2023/11/13 11:55
Change comment: Renamed back-links.

Summary

Details

Page properties
Parent
... ... @@ -1,0 +1,1 @@
1 +Deployment
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.probert
1 +XWiki.arosenzweig2
Tags
... ... @@ -1,0 +1,1 @@
1 +deployment
Content
... ... @@ -1,6 +1,6 @@
1 1  == Overview ==
2 2  
3 -In a deployment scenario on Mac OS X, Linux, Solaris or even Windows, your applications will most likely use Apache to server static resources. Additionally, if you develop with WODirectConnectEnabled=false (you **should**, see the [[Direct Connect>>doc:WO.Development-Direct Connect]] section for details), you will be running your application locally through Apache as well. Apache is a very extensible web server that provides a huge number of capabilities, some of which we will detail here.
3 +In a deployment scenario on Mac OS X, Linux, Solaris or even Windows, your applications will most likely use Apache to server static resources. Additionally, if you develop with WODirectConnectEnabled=false (you **should**, see the [[Direct Connect>>doc:WO.Home.To classify.Development-Direct Connect.WebHome]] section for details), you will be running your application locally through Apache as well. Apache is a very extensible web server that provides a huge number of capabilities, some of which we will detail here.
4 4  
5 5  == Split Install ==
6 6  
... ... @@ -13,7 +13,6 @@
13 13  An example mod_expires configuration might look like:
14 14  
15 15  {{code 0="xml"}}
16 -
17 17  <IfModule mod_expires.c>
18 18   ExpiresActive On
19 19   ExpiresDefault A60
... ... @@ -29,7 +29,6 @@
29 29  You will also need the corresponding type-extension mappings:
30 30  
31 31  {{code 0="xml"}}
32 -
33 33  <IfModule mod_mime.c>
34 34   AddType image/bmp bmp
35 35   AddType image/gif gif
... ... @@ -48,7 +48,7 @@
48 48  
49 49  Anyone who has used WebObjects has likely noticed that WebObjects URLs are long [[http:~~/~~/yoursite.com/cgi-bin/WebObjects/AppName.woa/wa/something>>url:http://yoursite.com/cgi-bin/WebObjects/AppName.woa/wa/something||shape="rect"]]{{code language="none"}}{{/code}}. It is a common request to make these URLs nicer for end-users who are used to just requesting [[http:~~/~~/yoursite.com>>url:http://yoursite.com||shape="rect"]]{{code language="none"}}{{/code}}. Fortunately Apache provides an amazingly extensive module called "mod_rewrite" that allows you to rewrite the URL requests of your site based on a series of regular expressions and rules.
50 50  
51 -Aaron Rosenzweig has a very thorough article about [[using mod_rewrite with Apache>>url:http://www.jewelryluv.com/fashion/pageWithName/ModRewrite/||shape="rect"]].
49 +Aaron Rosenzweig has a very thorough article about [[using mod_rewrite with Apache>>url:http://web.archive.org/web/20051216205025/http://www.jewelryluv.com/fashion/pageWithName/ModRewrite/||shape="rect"]][[.>>url:http://www.jewelryluv.com/fashion/pageWithName/ModRewrite/||shape="rect"]]
52 52  
53 53  === mod_rewrite with mod_webobjects ===
54 54  
... ... @@ -57,7 +57,6 @@
57 57  So in http.conf, search for mod_rewrite and change it to:
58 58  
59 59  {{noformat}}
60 -
61 61  LoadModule WebObjects_module /System/Library/WebObjects/Adaptors/Apache/mod_WebObjects.so
62 62  LoadModule rewrite_module libexec/httpd/mod_rewrite.so
63 63  
... ... @@ -66,7 +66,6 @@
66 66  , find again:
67 67  
68 68  {{noformat}}
69 -
70 70  AddModule mod_WebObjects.c
71 71  AddModule mod_rewrite.c
72 72  
... ... @@ -79,7 +79,6 @@
79 79  Here's an example mod_rewrite we use on one of our apps:
80 80  
81 81  {{code 0="xml"}}
82 -
83 83  <IfModule mod_rewrite.c>
84 84   RewriteEngine On
85 85   RewriteRule ^/$ /page/HomePage [R]
... ... @@ -96,6 +96,24 @@
96 96  
97 97  {{id name="Apache22Adapter"/}}
98 98  
94 +=== Ray Kiddy ===
95 +
96 +This worked for me (September 2020) and seems easier to parse. I wanted to change all of "(% class="nolink" %)http:~/~/opencalaccess.org/cgi-bin/WebObjects/app.woa(%%)/" to "http:~/~/opencalaccess.org/app/" and this worked.
97 +
98 +>RewriteEngine OnRewriteRule ^/$ /app [R]RewriteRule ^/index.html$ /app [R]RewriteRule ^/app(/(.*))?$ /cgi-bin/WebObjects/app.woa$1 [PT,L]
99 +
100 +I inserted this into my file: /etc/apache2/sites-enabled/[[opencalaccess.org>>url:http://opencalaccess.org||shape="rect"]].conf which specifies the values particular to this one domain.
101 +
102 +I added this as arguments to the app:
103 +
104 +(((
105 +(% class="Apple-tab-span" %)
106 +
107 +>-Der.extensions.ERXApplication.replaceApplicationPath.pattern=/cgi-bin/WebObjects/app.woa-Der.extensions.ERXApplication.replaceApplicationPath.replace=/app
108 +
109 +And you can, of course, do this in the Properties file as well. Much thanx to Stefan Gärtner on the mailing list (Subject: Re: Apache rules and SSL, 2020/08/27)
110 +)))
111 +
99 99  === Jeff Schmitz ===
100 100  
101 101  This one stumped me for a couple days, so thought I'd add it. Was trying to add mod_rewrite functionality as described above, and things went well on my dev machine by adding the rewrite rules just to the /etc/apache2/httpd.conf file. However, on the deployment machine I also had to add them to the /etc/apache2/sites/0000_any_.conf file.
... ... @@ -115,7 +115,6 @@
115 115  The new default configuration is:
116 116  
117 117  {{code 0="xml"}}
118 -
119 119  <Directory />
120 120   Options FollowSymLinks
121 121   AllowOverride None
... ... @@ -130,10 +130,9 @@
130 130  And, of course, either change the name of the WebObjectsAlias setting from /cgi-bin/WebObjects to <foo>/WebObjects or comment out the ScriptAlias definition for the /cgi-bin/ directory.
131 131  
132 132  {{info title="Note"}}
133 -The default {{code language="none"}}ScriptAlias{{/code}} directive in the 10.5 and 10.6 {{code language="none"}}httpd.conf{{/code}} files is:\\
145 +The default {{code language="none"}}ScriptAlias{{/code}} directive in the 10.5 and 10.6 {{code language="none"}}httpd.conf{{/code}} files is:
134 134  
135 135  {{noformat}}
136 -
137 137  ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Library/WebServer/CGI-Executables/$1"
138 138  
139 139  {{/noformat}}
... ... @@ -157,15 +157,44 @@
157 157  
158 158  Enjoy your shiny new WO adaptor.
159 159  
160 -* Note: if you are getting the error
171 +* (((
172 +Note: if you are getting the error
161 161  
162 162  {{noformat}}
163 -
164 164  libtool: compile: unable to infer tagged configuration
165 165  libtool: compile: specify a tag with `--tag'
166 166  apxs:Error: Command failed with rc=65536
167 167  
168 168  {{/noformat}}
180 +)))
169 169  
170 170  Add to the end of your make.config the following:
171 171   {{code language="none"}}CC = gcc{{/code}}
184 +
185 +== Webobjects Adaptor for Apache 2.4 ==
186 +
187 +=== Access control ===
188 +
189 +Check out [[http:~~/~~/httpd.apache.org/docs/2.4/upgrading.html#access>>url:http://httpd.apache.org/docs/2.4/upgrading.html#access||shape="rect"]]
190 +
191 +In 2.2, access control based on client hostname, IP address, and other characteristics of client requests was done using the directives [[Order>>url:http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#order||shape="rect"]]{{code language="none"}}{{/code}}, [[Allow>>url:http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#allow||shape="rect"]]{{code language="none"}}{{/code}}, [[Deny>>url:http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#deny||shape="rect"]]{{code language="none"}}{{/code}}, and [[Satisfy>>url:http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#satisfy||shape="rect"]]{{code language="none"}}{{/code}}.
192 +
193 +In 2.4, such access control is done in the same way as other authorization checks, using the new module [[mod_authz_host>>url:http://httpd.apache.org/docs/2.4/mod/mod_authz_host.html||shape="rect"]]{{code language="none"}}{{/code}}. The old access control idioms should be replaced by the new authentication mechanisms, although for compatibility with old configurations, the new module [[mod_access_compat>>url:http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html||shape="rect"]]{{code language="none"}}{{/code}} is provided.
194 +
195 +==== 2.2 configuration: ====
196 +
197 +{{code}}
198 +<Location /cgi-bin/WebObjects/>
199 + Order allow,deny
200 + Allow from all
201 +</Location>
202 +{{/code}}
203 +
204 +====
205 +2.4 configuration: ====
206 +
207 +{{code}}
208 +<Location /cgi-bin/WebObjects/>
209 + Require all granted
210 +</Location>
211 +{{/code}}