How do I avoid a 403 Error when I use vhosts for a local site using Xampp for Mac?
-
13-12-2019 - |
Question
I'm using the GitHub client on a Mac (10.6.8) to make it easier to work with my (first) web project to be hosted on GitHub. I usually use Windows.
Using Xampp's vhosts file, and the hosts file, I run the project using a server alias, so I can just type project.git, for example into my browser, and use absolute paths if I need to, for the project.
On my windows machines, I've set it up so the folder being used to serve the site locally is the same folder that the GitHub folder clones it to. This a folder inside my Documents folder, by default.
On windows, that works fine. On OS X, it gives me a 403 error whenever I try to look at the page. I've already set the permissions for Read and Write for my user profile and for "Everybody" in the folder properties, and for each file underneath it. By "the folder" I mean the root folder for the project, inside which is the first index file, for example.
I'm sure the hosts file is working fine, I can point to things like the xampp stuff in localhost using aliases, with no issues.
I don't know how to get rid of the 403 error. Any suggestions?
I won't be offended if you tell me that what I'm doing is horribly wrong. I'm new to both Git and GitHub, and am unfamiliar with the best practices for either.
Solution
I got it, finally.
I found this blog post:Create Apache Alias in XAMPP for Mac
All I needed to do was to change the user in Xampp's httpd.conf file to my user name, then it worked. The file is at /Applications/xampp/etc/httpd.conf
So where it was: User nobody
it now says User davey
Restarted xampp, and boom!