DirectoryIndex not being respected on AWS EC2 instance

ehime asked:

Hey guys I’m having a really weird issue here with my AWS EC2 instance. I have set up my LAMP stack with PHP5.5 MariaDB and Apache2, I have created/enabled my conf file (below)

<VirtualHost *:80>

    ServerName localhost
    DocumentRoot /var/www

    SetEnv  APPLICATION_ENV live

    <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews

        DirectoryIndex index.html index.php

        Order allow,deny
        AllowOverride All
        Allow from All

    <IfModule mod_rewrite>
        RewriteEngine On

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


and have even tried dropping an htaccess with a DirectoryIndex in my webroot. None of this though seems to be respecting my DirectoryIndex? Any ideas? mod_dir is enabled, as well as mod_rewrite, you think between the two Apache would be able to figure it out??

You can use to check it out, security groups are set to allow on 80, and you can see my directory structure here for var dub

-rw-r--r--  1 ubuntu ubuntu   4566 Jan 30 18:58 backup
-rw-rw-r--  1 ubuntu ubuntu     50 Jan 30 19:10 .htaccess
-rw-rw-r--  1 ubuntu ubuntu     12 Jan 30 19:09 index.html
-rw-rw-r--  1 ubuntu ubuntu      4 Jan 30 18:51 index.php

contents of htaccess are below

DirectoryIndex index.php index.html

I’m seriously at a loss atm?

My answer:

It says: “Works: index.php”.

Did you clear your browser cache?

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.