[Setup] Solved: Apache Rewrite Rules on (Mac) Tiger Server
Juliann
juliann at people-are.strange.com
Fri Dec 9 17:36:56 UTC 2005
Sometime during the upgrade of Plone.org the How-To about hosting on
MacOSX disapeared (the url is there but no data exists, only the
comments). The section about interacting with Apache and the Server
Admin Tools was not correct, at least not for Mac OSX 10.4 (Tiger)
Server. I spent four days (4+ hours per day) trying all of the
advice on every website, discussion board and list I could pester.
Thanks to those from these lists who helped. In the end, it took a
little bit of everything to get it to work.
I have multiple Zope instances, each with multiple Plone sites.
What I did:
Created the virtual host files in the Server Admin (GUI) Tool. Just
leave all of the information as the default except host name and
alias (if needed). I did change the contact email and I turned off
Performance Caching, but the latter I may turn back on. (With
caching turned on it kept looking for port 16080 and failing, an
error I haven't time to track down right now and something affecting
everything on my server so we have it turned off across the board.)
I then went into the sites/sitename.conf files created by the GUI and
modified each file to read as thus (substitute your zope server port
for 8284):
_______________________
## Plone Site
<VirtualHost *:80>
ServerName www.sitename.com
ServerAdmin webmaster at sitename.com
## DocumentRoot "/Library/WebServer/Documents"
DirectoryIndex index.html index.php
CustomLog "/var/log/httpd/access_log" "%h %l %u %t \"%r\" %
>s %b"
ErrorLog "/var/log/httpd/error_log"
ErrorDocument 404 /error.html
<IfModule mod_ssl.c>
SSLEngine Off
SSLLog "/var/log/httpd/ssl_engine_log"
SSLCertificateFile "/etc/certificates/Default.crt"
SSLCertificateKeyFile "/etc/certificates/Default.key"
SSLCipherSuite "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:!
SSLv2:+EXP:+eNULL"
</IfModule>
<IfModule mod_dav.c>
DAVLockDB "/var/run/davlocks/.davlock100"
DAVMinTimeout 600
</IfModule>
## <Directory "/Library/WebServer/Documents">
## Options All -Indexes -ExecCGI -Includes +MultiViews
## AllowOverride None
## <IfModule mod_dav.c>
## DAV Off
## </IfModule>
## </Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
## RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule ^/(.*) http://localhost:8284/
VirtualHostBase/http/www.sitename.com:80/Plonesite/VirtualHostRoot/$1
[L,P]
</IfModule>
<IfModule mod_alias.c>
</IfModule>
LogLevel warn
</VirtualHost>
_______________
I cannot claim that this is best practice, but I can say that it
works. (Knock on wood!) But as Apple seem to muddle with their
version of Apache with every major OS release this will probably
break when 10.5 comes out :P
Thanks again to all who helped. I hope that by posting I can spare
others some wasted time. However, I know that others have said that
they had far less hassle getting their configs working, so there may
be a simpler option out there. I just couldn't find it.
With great relief,
--Juliann
More information about the Setup
mailing list