After messing around with WordPress on a VM, I was able to get to get everything up and running with nice working Permalinks. But for whatever which reason I could not for the life of me figure out why I kept on getting 403′s on the entire site! Here is a run down on what I did:
First I made sure everything was working correctly the way I wanted it to be and this meant I had to enable mod_rewrite module in Apache for Permalinks.
ls /etc/apache2/modules-available
ls will return a list of available modules located in the directory, the one we are lookng for is called rewrite.load
Now we need to tell Apache that we want to make mod_rewrite available and ready to use and to that we will need to issue this command:
sudo a2enmod rewrite
Now Apache needs to be restarted by: sudo /etc/init.d/apache2 restart
Once Apache is restarted the rewrite module will be enabled but we still need to tell Apache a few other things before we can get pretty Permalinks, and in order to do this we need to open /etc/apache2/sites-enabled/000-default with your favorite text editor and of course permissions to be able to save the file.
The code we are looking for is pretty standard but if you are using VirtualHost then you need to pay attention to which directory your website is running on.
The code is:
<Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all </Directory>
We need to change that to this:
<Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride none Order allow,deny allow from all </Directory>
All that was really done to this was we changed AllowOverride all to AllowOverride none. Once you have finished saving the file you need to restart apache again by issuing sudo /etc/init.d/apache2 restart.
We are almost done, what needs to be done next is that we need to log into WordPress and tell it that we want to use Permalinks! This can be done in Settings>Permalinks.
I picked the Day and the Name for easier reading, but of course you can pick how it can be displayed and if you need help you should look at the WordPress Codex which has a ton of information!
Now after we are done updating the settings for Permalinks if you have write access to the directory WordPress will create and generate a .htaccess file for you, but if you don’t then WordPress tells you that you need to manually edit the .htaccess file.
Now here is what I learned, since we have SSH access to our VPS I used rsync+ssh to sync the files from my VM to the Server, not knowing what the permissions where set on the .htaccess file, after about an hour of comparing permissions, looking at Apache config files. and checking out the log file for Apache I figured that when you went to our homepage that the user didn’t have read permissions to the .htacces file that it would spit out a 403 errors.
