Mobile app version of vmapp.org
Login or Join
Heady270

: No matching DirectoryIndex error with wordpress I have a basic wordpress installation running on a localhost apache server. When I try to fetch the root page, apache gives a 403 error. The

@Heady270

Posted in: #Apache #Linux #Php #Wordpress

I have a basic wordpress installation running on a localhost apache server. When I try to fetch the root page, apache gives a 403 error. The log says:

[Wed Feb 07 13:05:54.519901 2018] [autoindex:error] [pid 2018] [client 127.0.0.1:44307] AH01276: Cannot serve directory /usr/share/wordpress: No matching DirectoryIndex (index.php) found, and server-generated directory index forbidden by Options directive


So, I realize this basically means that it tried to serve the content at /usr/share/wordpress, and it didn't find an index.php file. But I don't understand why it can't find it, because it clearly exists:

>ls -lh /usr/share/wordpress/ | grep index.php
-rw-r--r-- 1 www-data www-data 418 Feb 7 11:08 index.php


My apache wordpress config file (/etc/apache2/sites-available/wordpress.conf) contains the following:

>cat /etc/apache2/sites-available/wordpress.conf
Alias / /usr/share/wordpress
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride all
DirectoryIndex index.php
Allow from all
</Directory>


So I don't see anything wrong here. The wordpress config tells it to use index.php as the DirectoryIndex, and index.php clearly exists in /usr/share/wordpress.

Even more crazy, if I actually enable the server-generated directory index by doing:

Options FollowSymLinks Indexes


... and then I fetch localhost/, it works with a 200 and gives me the directory index. And indeed, inside the directory index it lists index.php as a file!

But if I fetch localhost/index.php directly, I get a 404.

So, any ideas what I might be doing wrong here?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Heady270

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme