localhost issues on Mac OS Catalina

1

My localhost started working weirdly after I updated to Catalina, even after I have changed the settings according to this tutorial.

I have a site located in the folder /Users/username/Sites/sites. I also assigned virtual host to it. It works as http://site.local, but I cannot reach it as http://localhost/site.

Also, I have two more sites in the same folder: test and new_site. Permissions in both cases for the folders and the files in them are exactly the same. There are not virtual hosts for both. I can reach new_site as http://localhost/new_site/, but I cannot reach it if there is no forward slash at the end (http://localhost/new_site). The second site (test) I cannot see neither as http://localhost/test nor as http://localhost/test/. The error message that comes up in all cases above is as follows:

Forbidden

You don't have permission to access this resource.

Browser - Mozilla 69.0.3. Nothing works in Chrome.

Can anyone help me, please?

Sbotan

Posted 2019-10-22T01:17:32.290

Reputation: 21

I would recommend that instead of installing LAMP related items like Apache, PHP and MySQL on your machine as that tutorial explains, you use a more portable version of a MAMP/LAMP stack by using MAMP. The non-pro version is free and works great! That tutorial is honestly overly complicated and most developers use tools like MAMP and XAMPP instead of going nuts over installing local binaries like that.

– JakeGould – 2019-10-22T01:26:26.613

Thank you for the advice. Maybe I will do so, but in the mean time, I wanted to understand the reason why it doesn't work. I checked error_log and found that apache still looking for the file in the old folder /Library/WebServer/Documents even though in httpd.conf the DocumentRoot is set as /Users/username/Sites. I can't understand why that happens. – Sbotan – 2019-10-23T02:12:05.340

1

Issue solved. When you switch to DocumentRoot as /Users/username/Sites, the apart from changing conf files, you should address localhost as http://localhost/~username.

– Sbotan – 2019-10-23T22:53:52.820

Cool! Post that as an answer and accept it for anyone else who might be in a similar situation. – JakeGould – 2019-10-24T00:43:56.093

No answers