
This should also be changed to point to your new document root as well: You also need to change the tag configured just right below the DocumentRoot line. The default document root is set to “/usr/local/var/But I assume you want to change the document root to set it to your home directory.Ĭhange this to point to your user directory where your_user is the name of your user account: DocumentRoot /Users/rahul/Sites Now, configure the document root for Apache. You have to manually change the listen port from the default of 8080 to the standard port 80. The Homebrew’s version of httpd uses port 8080. A configuration file /use/local/etc/httpd/nf is generated by the installer which you need to edit in a text editor and make following changes. Now you will want to make some configuration changes according to your local development environment. The Apache web server is running now on your macOS system. You can try to reach your server in a browser by pointing it at you should see a simple header that says “It works!” Apache default page on macOS Step 2 – Configuring the Apache Server You have successfully installed the Apache webserver via Homebrew, and configured it to auto-start with a privileged account. Now install the new version Apache server provided by Homebrew: brew install httpdĪfter completing the installation process, configure the httpd service to be auto-started on system boot. sudo apachectl stop sudo launchctl unload -w /System/Library/LaunchDaemons/ Open a terminal and execute commands to stop running Apache server and remove it. Remove the built-in Apache server (if any) from your system. It is useful for installing most open source software like Node.

But it’s hard to manage it via homebrew due to Apple has removed some of the required scrips from the latest macOS releases.

The latest versions of macOS come with pre-installed Apache 2.4.
