Skip to content
Redlyst

Switching from Default Apache to Homebrew Apache on MacOS

Apache, Homebrew, Guide, MacOS1 min read

Even though Apache is already installed on macOS, there is a better-maintained version with Homebrew.

In this guide, we will disable the default apache on mac restart also we will install the homebrew apache version.

Stop & Disable Apache

First of All, open the terminal and check if Apache is running on Port 80 by this command:

sudo lsof -i:80

The output you may get would be: Result

This tells us that the Apache is running and if no output would mean it's not running.

The next step is to stop and disable Apache on mac restart by this command:

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Install Apache with Homebrew

Make sure you already have Homebrew installed, if not you can follow the step from official homebrew installation, then the next step is to install apache httpd by this command:

brew install httpd

and the last output would be: Result2

Last but not least, start or restart the apache homebrew with this command:

Start-httpd
brew services start httpd
Restart-httpd
brew services restart httpd

and command for stop:

Stop-httpd
brew services stop httpd

By default the Apache Homebrew is listening on Port 8080, check by this command:

Listening-Port-8080
sudo lsof -i:8080

Check from the browser and MISSION IS COMPLETED!! Browser

© 2023 by Redlyst. All rights reserved.
©LekoArts