Probably a simple one, but this has me confused.
I'm running an EC2 instance which installs Apache 2.2 to the box once provisioned. I don't have access to a2enmod
there but I need to change AllowOverride None
to be AllowOverride FileInfo
for the default /var/www/html
directory where my app gets installed to.
This is configured in httpd.conf
but I don't want to have to SSH into every new instance of my app and manually change that setting. I have a build script which copies the below file to /etc/httpd/conf.d/my-app.conf
:
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride FileInfo
Order allow,deny
Allow from all
</Directory>
This doesn't work though, I presume because the part in httpd.conf
that loads files from conf.d/*.conf
comes before the part where /var/www/html
is defined (and AllowOverride
is therefore set back to None
).
How can I configure this so that setting is what I want (eg. FileInfo
) without manually editing that file? I need this to be scriptable.
httpd.conf
via a script?.htaccess
file should be rewriting (a Wordpress install where I'm removingindex.php
from the path). In the Apache logs I just getFile does not exist: /var/www/html/category
). I'd accept editing it via a script I guess but that feels a bit kludgy./etc/httpd/conf.d/my-app.conf
where you putting your<Directory>
container is a VHOST config? it it being loaded? - does the rewriting work if you temporarily changeAllowOverride FileInfo
toAllowOverride All
?my-app.conf
was literally the<Directory>
part I posted in my question. When I wrapped this in a<VirtualHost *:80>
tag it worked – my syntax was wrong. Thank you!