I am working on Ubuntu 14.04.2 Apache 2.4.7
I have a virtual host configured to serve files from /var/www/dev, and the configuration file looks like this dev.conf::
<VirtualHost *:80>
ServerAdmin ubuntu@12.234.567.89
DocumentRoot /var/www/dev
ServerName dev.site.com
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/dev/>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I have several files in the directory /var/www/devthat I do not want to index, so the option-Indexes
However, I have a wordpress installation and I want these files to be loaded correctly in the browser. Index file index.phpand is located in/var/www/dev/
I also have a .htaccess file in the same root directory, which looks like this:
DirectoryIndex index.php index.html
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RedirectMatch 301 ^/terms-and-conditions\.php$ /terms-of-use
RedirectMatch 301 ^/privacy\.php$ /privacy-policy
</IfModule>
DirectoryIndexshould tell the browser to use the file index.php, but I get a 403 Forbidden error.
I tried:
- Opening permissions recursively change of ownership
/var/www/devonwww-data:www-data DirectoryIndex index.php dev.conf <Directory /var/www/dev/> - ""mod_dir ()+Indexes -- , 403 ,
apache2.conf , DirectoryIndex- DirectoryIndex + - , , , , .
!
EDIT:
hrome firefox dev - " " ( ) - - ,
2:
error.log -
AH01276: Cannot serve directory /var/www/dev/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
access.log -
"GET / HTTP/1.1" 200 1462 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0"