Wednesday, April 29, 2020

Updating Apache configuration after upgrading to macOS Catalina

I have a simple Apache/PHP setup on my mac to run Salesforce Workbench.  Once I upgraded my macOS (High Sierra to Catalina directly no less), it stopped working.  I guess I shouldn't be surprised - typical for the installer to put in default config - but was anyways...  It turned out to be a bit of work to fix, and here's the gist.

Catalina runs Apache 2.4 (mine says it's 2.4.41) and its httpd.conf seems to reside in /usr/local/etc/httpd/ by default.  However if it's an upgrade Apache has no problem staying with the one in /etc/apache2, but the config file did revert to generic as far as I could tell.  So I had to edit it to bring back stuff - lessons learned of course: think about the OS customization I've done before upgrading.   My edits include
  1. SSL related stuff
    1. Modules to load ()
    2. Port setting
    3. Location of httpd-ssl.conf
      1. Also the server certificate location within that file
  2. I added info to httpd-vhosts.conf as well (don't remember if I did that last time) 
  3. PHP stuff: uncomment the line that loads php7 module
     

    The following apache commands are your friends when going through the process...
    sudo apachectl  configtest
    sudo apachectl  restart

    Some reference links:
    https://getgrav.org/blog/macos-catalina-apache-ssl
    https://jasonmccreary.me/articles/update-apache-php-mysql-mac-os-x-catalina/
By the way, I took the chance to upgrade to Workbench 49, and got hit by Server Error 500 initially, until I realized it's a problem I dealt before with Workbench.  The shared.php file has this line that points to a non-existent file (probably related to dependency manager Composer).
require __DIR__ . '/../vendor/autoload.php';
Removing the line solved the issue.

No comments:

Post a Comment