I'm having a really rough time on this one and have tried a ton of solutions which have worked for certain people but not for me. Firstly my set up: Ubuntu 14.04.2 Apache 2.4.7
I'm currently migrating my site to wordpress into the folder structure /var/www/dev which is set up as a virtual host - dev.conf looks like:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
ServerAdmin ubuntu@12.345.678.90
DocumentRoot /var/www/dev
ServerName dev.mysite.com
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/dev/>
Options -Indexes +FollowSymLinks
AllowOverride All
#Require all granted
Order allow,deny
allow from all
</Directory>
</VirtualHost>
My problem is that when I access my home page in a browser for the first time dev.mysite.com it directs me to a 403 page:
Forbidden
You don't have permission to access / on this server.
I also have an .htaccess file in my root folder that looks like this currently:
DirectoryIndex index.php index.html
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I followed 2 different sets of advice so far - one saying to change my config Option to:
Options +Indexes
However when i navigate to my home page it gives me the physical folder "Index of /" with a list of all my files and folders - which I don't want. So I've left it as
Options -Indexes
Another set of advice said add this to the htaccess file:
DirectoryIndex index.php index.html
I've also checked my folder permissions, all owned by my apache user admin ubuntu:ubuntu and all follow the standard wordpress folder permissions e.g. all folders are 755 all files are 644 (rough rule of thumb).
I've also tried as you can see (commented out above) using the new apache 2.4 standard
Require all granted
instead of
Order allow,deny
allow from all
I'm also restarting the server every time I make a change so nothing silly like that. What am I doing in the above config that's not letting me load my site?
Specifically my homepage goes to 403 Forbidden, any other page e.g. dev.mysite.com/features loads this error message:
User-agent: *
Disallow: /wp-admin/
EDIT: The above issues only occur when the url is loaded initially - if I refresh the page it loads as it should.
Here's my file ownership structure - perhaps this may provide useful:
-rw-rw-r-- 1 ubuntu ubuntu 350 Sep 26 19:35 .htaccess
-rw-rw-r-- 1 ubuntu ubuntu 4951 Sep 9 13:21 wp-activate.php
drwxrwxr-x 9 ubuntu ubuntu 4096 Sep 9 13:21 wp-admin
-rw-rw-r-- 1 ubuntu ubuntu 271 Sep 9 13:21 wp-blog-header.php
-rw-rw-r-- 1 ubuntu ubuntu 5007 Sep 9 13:21 wp-comments-post.php
-rw-rw-r-- 1 ubuntu ubuntu 3130 Sep 24 10:32 wp-config.php
-rw-rw-r-- 1 ubuntu ubuntu 2764 Sep 16 17:23 wp-config-sample.php
drwxrwxr-x 6 ubuntu ubuntu 4096 Sep 24 10:46 wp-content
-rw-rw-r-- 1 ubuntu ubuntu 3286 Sep 16 17:23 wp-cron.php
drwxrwxr-x 12 ubuntu ubuntu 4096 Sep 9 13:21 wp-includes
-rw-rw-r-- 1 ubuntu ubuntu 2380 Sep 9 13:21 wp-links-opml.php
-rw-rw-r-- 1 ubuntu ubuntu 3123 Sep 9 13:21 wp-load.php
-rw-rw-r-- 1 ubuntu ubuntu 34669 Sep 16 17:23 wp-login.php
-rw-rw-r-- 1 ubuntu ubuntu 8252 Sep 9 13:21 wp-mail.php
-rw-rw-r-- 1 ubuntu ubuntu 11062 Sep 16 17:23 wp-settings.php
-rw-rw-r-- 1 ubuntu ubuntu 25124 Sep 16 17:23 wp-signup.php
-rw-rw-r-- 1 ubuntu ubuntu 4035 Sep 9 13:21 wp-trackback.php
-rw-rw-r-- 1 ubuntu ubuntu 3055 Sep 16 17:23 xmlrpc.php