I installed a local version of Magento 2, but I was having issues validating the install, I was getting a 403 error on page load.
Forbidden You don't have permission to access / on this server. Server unable to read htaccess file, denying access to be safe
I don’t claim to be a DB administrator, so I searched on the webs for a solution and got nowhere fast. So I turned to my super smart coworker Brent Jameson, who is a wizard. Apparently, I had to do a few things to my Apache configurations to get it to hit my
Allow from all in my Virtual Hosts file
Turns out I had to add the
Allow directive in my virtual hosts file.
Edit your vhosts configuration in(in OSX):
Add this line in your
Allow from all
So it becomes this:
<VirtualHost *:80 ServerName rds.dev ServerAlias rds.dev DocumentRoot "/Volumes/Sites/my_site.dev" <Directory "/Volumes/Sites/my_site.dev"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
2. Force Apache to use my user when hitting our site.
Figure out your username. This is what we will tell Apache to load sites under. You can find your username by running:
Find the line specifying
User (right above the line specifying
Group), and change it to use your user:
# If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User Josh Group _www
2.b Change ownership of your magento 2 Directory
This is probably a
bad idea and you should never do this on a live server (which is true of pretty much everything in this post), but we’re going to change ownership of the entire magento 2 directory system and assign it to you.
cd into the parent directory containing all your websites (mine is
chown the magento 2 site to change it’s ownership
cd /path/to/sites sudo chown -R Josh:_www my_site.dev
After doing all that, I was able to hit the index.php inside my Magento 2 instance.
Thanks again for the help Brent Jameson!