apache2 and httpd being run on macOS simultaneously

This is a simple post mainly for my notes incase I need to recapitulate what should be done to restore running of my virtually hosted websites on my laptop.

Ever since I installed httpd on my macOS 15.1 using homebrew and configured my virtual hosts on it and upon macOS updates which resulted in a restart of the laptop, my virtual hosts websites stopped working.

After many updates I found that there’s an apache2 service also running in the background and upon going to local.myWebsite.com it was trying to detect the virtual host from Apache’s config and not the httpd’s one.

So I had to stop Apache2 and httpd and start httpd. Only then my virtual hosts were back running properly.

sudo apachectl stop
brew services stop httpd
brew services start httpd
0
Subscribe to my newsletter

Read articles from Anjanesh Lekshminarayanan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Anjanesh Lekshminarayanan
Anjanesh Lekshminarayanan

I am a web developer from Navi Mumbai working as a consultant for cloudxchange.io. Mainly dealt with LAMP stack, now into Django and trying to learn Laravel and Google Cloud. TensorFlow in the near future. Founder of nerul.in