Apache on macOS Catalina – Fix Remote Access Forbidden but Localhost Works

apachecatalinaNetworkwebserver

I followed this tutorial and the Apache server works locally. http://localhost/~user/ works but remotely http://my-ip/~user I get:

Forbidden.
You don't have permission to access this resource.

Note that I am using the same computer. It used to work with Mojave. How can I fix this?

Best Answer

By following the tutorial, you have created the file /etc/apache2/users/username.conf which contains the following:

<Directory "/Users/username/Sites/">
AllowOverride All
Options Indexes MultiViews FollowSymLinks
Require host localhost
</Directory>

(note that you've replaced "username" with your actual username)

If you want to allow the public access to the folder, change it to look as follows:

<Directory "/Users/username/Sites/">
AllowOverride All
Options Indexes MultiViews FollowSymLinks
Require all granted
</Directory>

Note that the "Require" line was changed to "Require all granted".