Apache2 | http.conf How do I set AllowOverride All on a directory
The file that you are looking for is probably in /etc/apache2/sites-enabled/000-default.conf or similar.
You can create the Directory tags yourself in /etc/httpd.conf, /etc/apache2/sites-enabled/000-default.conf, or in a new file placed in /etc/apache2/sites-enabled/example.conf
Below is what you need to include in one of the files mentioned above:
<Directory /path/to/directory-name>
AllowOverride All
</Directory>
Apache will load this directory block from any of the configuration files. I imagine that you are probably used to putting this in the default block that had previously been located in the /etc/apache2/httpd.conf file. The default DocumentRoot and Directory tags still exist but are probably located in /etc/apache2/sites-available/000-default.conf.
You may also consider creating a new configuration file for your specific website in /etc/apache2/sites-available/example.conf. Then placing within that file, something like this:
<VirtualHost *:80>
ServerName site-name.com
ServerAlias other-name.com www.site-name.com
DocumentRoot /path/to/application
<Directory />
AllowOverride All
</Directory>
</VirtualHost>
By default Apache will load configuration from any file that is located in /etc/apache2/sites-enabled/* that ends in .conf
Related videos on Youtube
Comments
-
Félix Desjardins over 1 year
I have to set
AllowOveride
toAll
on my web server, but in myhttpd.conf
file, there is no<Directory>
tag for me to place it in.I never seen this before. What can I do? Where is the file I have to change?
I am on a LAMP server, and Debian7, with Apache2.
Thanks!
-
Marki555 almost 9 yearsAt least on debian there is command
a2ensite
which will make the symlink fromsites-available
tosites-enabled
for you (but you can make it also manually). -
Félix Desjardins almost 9 yearsThanks for your answer. Only one thing that I noticed. The
000-default
file should have an.conf
extension, right? -
Jacob Margason almost 9 yearsyes, if you look inside httpd.conf you will see that near the bottom, there is: Include sites-enabled/*.conf You could ofc change that so that any file will be loaded in. You can also manually include any file: Include /path/to/file