Homebrew Apache



Eventhough Apache ships with macOS, a better maintained version would be coming from Homebrew, also Apple is making noises about not supporting legacy software like PHP so in the future this may be more of a compulsory option. First thing to do would be to remove the builtin Apache version of which in macOS Big Sur is Apache/2.4.46.

  1. Homebrew Apache Zeppelin
  2. Homebrew Apache Co
  3. Homebrew Apache Casino
  4. Homebrew Apache Family

Apache Homebrew does not start on MacOS: No Path for Address. Unable to start Apache - Bitnami Wordpress. Running wamp 3.1.3 Apache 2.4.33 fails with makesock: could not bind to address :::80 NT Kernel and System has taken it. Unable to start apache on Mac High Sierra 10.13.5 after latest update (June 15th 2018). A little under a year ago I wrote a walkthrough: Set up a Self Signed Certificate on macOS's Built in Apache. Recently a new tool showed up called mkcert has come and made life way easier. It's a wonderful tool that instead of building Self-Signed Certificates, sets your local machine up with a certificate signing authority and creates valid. Homebrew installs everything within /usr/local/ so there is no danger of it conflicting with any system-level software. If you get anything else returned as the file path for apachectl, then something hasn’t been setup properly, likely your PATH isn’t setup correctly, run brew. Homebrew’s package index. Columnar in-memory analytics layer designed to accelerate big data.

  • Install Homebrew


    Paste that in a macOS Terminal or Linux shell prompt.

    The script explains what it will do and then pauses before it does it. Read about other installation options.

  • What Does Homebrew Do?


    Homebrew installs the stuff you need that Apple (or your Linux system) didn’t.

  • Homebrew installs packages to their own directory and then symlinks their files into /usr/local.

  • Homebrew won’t install files outside its prefix and you can place a Homebrew installation wherever you like.

  • It’s all Git and Ruby underneath, so hack away with the knowledge that you can easily revert your modifications and merge upstream updates.

  • Homebrew complements macOS (or your Linux system). Install your RubyGems with gem and their dependencies with brew.

  • “To install, drag this icon…” no more. Homebrew Cask installs macOS apps, fonts and plugins and other non-open source software.

  • Donate to Homebrew

  • Homebrew Blog

  • Analytics Data

  • Homebrew was created by Max Howell. Website by Rémi Prévost, Mike McQuaid and Danielle Lalonde.

Eventhough Apache ships with macOS, a better maintained version would be coming from Homebrew, also Apple is making noises about not supporting legacy software like PHP so in the future this may be more of a compulsory option.

First thing to do would be to remove the builtin Apache version of which in macOS Big Sur is Apache/2.4.46.

Remove built-in Apache in macOS

You can test if Apache is running by issuing this command, which is checking Port 80:

Output you may get back would be:

This tells us that indeed httpd/Apache is running, no output would mean it’s not running.

Homebrew Apache Zeppelin

Stop Apache running on computer restart by issuing:

That will unload the start up daemon and make the builtin macOS Apache incapacitated, test by issuing the previous command:

Installing Apache with Homebrew

Homebrew Apache Co

First make sure you have Homebrew set up and ready to go. Evernote log.

Install Apache which is known as the package name ‘httpd’:

Final command line output should be:

Set Apache to auto-start now and on computer restart:

The other 2 commands to stop or Restart Apache are:

By default the Apache Homebrew package is listening on Port 8080 and 8443, test by issuing:

Test the location of Apache/httpd

Homebrew location is:

If you are getting the default macOS location of /usr/sbin/httpd:

Restart the computer and try the location test again.

Homebrew Apache Casino

Changing the Port Number

Next is to change the port numbers from 8080 to 80

And change Listen 8080 to:

Restart Apache and web files will now be served over the default port 80.

Changing the document root to be the old sites folder

Previously in macOS the web root directory which is missing by default is the ‘~/Sites’ folder in the User account. This makes sense to set up as a document root as it is logical and easily accessible.

You need to make a “Sites” folder at the root level of your account and then it will work. Once you make the Sites folder you will notice that it has a unique icon which is a throwback from a few versions older. Make that folder before you set up the configuration changes below

In the /usr/local/etc/httpd/httpd.conf file, find:

Change to:

Change the shortusername to the one on your macOS account

Do you need to transfer music from Mac to iPhone and don’t know how? This article will tell you how to transfer music from Mac to iPhone with/without iTunes. You might not know, but syncing music from Mac to iPhone is pretty easy. To learn how to transfer music from Mac to iPhone, you can simply go through this post. This article answers questions related to how to transfer music from iPhone to Mac and how to transfer music from iPhone to Mac. Apple music mac to iphone.

Find:

Change to:

Find:

Change to:

Find:

Change:

Find:

Change:

Find and uncomment:

Now the webroot is /Users/shortusername/Sites/ just add a index.html file there and view file via localhost/index.html in your browser

Apache Log File

To check any Apache errors or access you can find its log files:

Homebrew Apache Family

Getting PHP Working

Follow this Homebrew PHP guide to download your required PHP versions.

In the /usr/local/etc/httpd/httpd.conf file add in required module – example uses PHP 8.

Find:

Apache

Change:

Also at the end of the file add in:

Restart Apache:

You can check PHP is running by adding <?php phpinfo(); ?> to a .php web hosted file and view the output.

That’s it, Apache is now set up and running with PHP enabled.

To remove Apache httpd