Last modified by Aaron Rosenzweig on 2020/09/03 22:17

From version 59.1
edited by Theodore Petrosky
on 2013/07/10 10:20
Change comment: There is no comment for this version
To version 62.1
edited by Ray Kiddy
on 2020/09/03 22:17
Change comment: add info for re-write

Summary

Details

Page properties
Parent
... ... @@ -1,0 +1,1 @@
1 +Deployment
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.tedpet
1 +XWiki.kiddyr
Tags
... ... @@ -1,0 +1,1 @@
1 +deployment
Content
... ... @@ -46,7 +46,7 @@
46 46  
47 47  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.
48 48  
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"]].
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"]]
50 50  
51 51  === mod_rewrite with mod_webobjects ===
52 52  
... ... @@ -91,6 +91,24 @@
91 91  
92 92  {{id name="Apache22Adapter"/}}
93 93  
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 +
94 94  === Jeff Schmitz ===
95 95  
96 96  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.
... ... @@ -163,3 +163,31 @@
163 163  
164 164  Add to the end of your make.config the following:
165 165   {{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}}