Configure Apache in macOS High Sierra

My local apache was working fine until it wasn't 🤷‍♂️ I'm not sure at what point stopped working, my guess is after I updated to High Sierra.

In any case, here are some tips I found across different sites that worked for me 👨‍💻

1️⃣ Users

sudo nano /private/etc/apache2/extra/httpd-userdir.conf
Code language: PHP (php)

Remove the # from:

#Include /private/etc/apache2/users/*.conf
Code language: PHP (php)

2️⃣ Main configuration file

sudo nano /etc/apache2/httpd.conf

Look for and change this:

Options FollowSymLinks Multiviews

Add Indexes at the end👇

Options FollowSymLinks Multiviews Indexes

3️⃣ Verify DocumentRoot

In the same main configuration

sudo nano /etc/apache2/httpd.conf

It should look similar to 👇

DocumentRoot "/Library/WebServer/Documents" <Directory "/Library/WebServer/Documents"> Options FollowSymLinks Multiviews Indexes MultiviewsMatch Any AllowOverride All Require all granted </Directory>
Code language: PHP (php)

(You probably will have comments in-between)

4️⃣ Restart apache

sudo apachectl restart

Leave a Reply

Add <code> Some Code </code> if you need to.