On Mon, Jan 22, 2018 at 1:53 PM, Sam Ruby <ru...@intertwingly.net> wrote:
> On Sun, Jan 21, 2018 at 6:21 PM, Sam Ruby <ru...@intertwingly.net> wrote:
>> See https://github.com/phusion/passenger/issues/1986
>>
>> I'm exploring brew install apache-httpd to see if that is any better.
>
> That version of httpd works for me.  Configuration files and logs are
> in different places and LDAP support has to be added, but mostly
> everything is the same.  Even better, the configuration files and
> startup scripts can be updated.
>
> Two configurations are possible:
>
> 1) Alongside the system httpd, with the system httpd on port 80
> reverse proxying the brew httpd running on port 80.  Of course, this
> means that you have to have both up.
> 2) Instead of the system httpd.  If you want to run as port 80, sudo
> will be required to start/stop the server.
>
> I'm going to play around some more (and test on multiple machines).
> If things continue to go well and there are no objections, I'll update
> MACOSX.md to describe these two approaches (and remove the
> recommendation to use the system httpd).

Current outline:

# optional steps to get the latest
brew upgrade passenger
brew upgrade ruby

# install Apache httpd + LDAP from brew
# https://gist.github.com/Tenzian/459dd3e9972b3b498900546ad6e0739b
brew install apache-httpd
brew install openldap --with-sssvlv
brew reinstall -s apr-util --with-openldap
brew reinstall -s apache-httpd
brew link --overwrite httpd

# optional - unload system httpd
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist

edit /usr/local/etc/httpd/httpd.conf:

  Uncomment:
    LoadModule proxy_module lib/httpd/modules/mod_proxy.so
    LoadModule proxy_wstunnel_module lib/httpd/modules/mod_proxy_wstunnel.so
    LoadModule speling_module lib/httpd/modules/mod_speling.so
    LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so
    LoadModule expires_module lib/httpd/modules/mod_expires.so
    LoadModule cgi_module lib/httpd/modules/mod_cgi.so

  Append:
    LoadModule ldap_module lib/httpd/modules/mod_ldap.so
    LoadModule authnz_ldap_module lib/httpd/modules/mod_authnz_ldap.so
    LDAPVerifyServerCert Off
    Include conf/passenger.conf
    Include conf/whimsy.conf

  (Optional) change Listen 8080 to Listen 80

mkdir /usr/local/opt/httpd/conf

create /usr/local/opt/httpd/conf/passenger.conf from the output from
`brew info passenger` (new location: was /etc/apache2/other).
Change /usr/bin/ruby to /usr/local/bin/ruby
Optional: add PassengerUser _www and PassengerGroup _www lines

cp /srv/whimsy/config/whimsy.conf /usr/local/opt/httpd/conf/
  * change :80 to match httpd.conf (either leave asis or change to 8080)
  * change ErrorLog and Custlog to /usr/local/var/log/httpd/whimsy_*.log

edit /usr/local/opt/httpd/homebrew.mxcl.httpd.plist, add:

  <key>EnvironmentVariables</key>
  <dict>
    <key>OBJC_DISABLE_INITIALIZE_FORK_SAFETY</key>
    <string>YES</string>
    <key>XPC_SERVICES_UNAVAILABLE</key>
    <string>1</string>
  </dict>

edit /usr/local/opt/httpd/bin/envvars, add:

  OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

brew services start httpd

# optional - provide convenient access to scattered directories
mkdir /srv/apache2
cd /srv/apache2
ln -s /usr/local/etc/httpd etc
ln -s /usr/local/opt/httpd opt
ln -s /usr/local/var/log/httpd log
ln -s /usr/local/opt/httpd/lib/httpd/modules modules

- Sam Ruby

Reply via email to