Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AllowOverride not allowed here

Tags:

apache

I have setup a virtualhost like following

<VirtualHost *:80>
  DocumentRoot /var/www/html
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  Options Includes
  AllowOverride All
</VirtualHost>

But always throws me

AH00526: Syntax error on line 6 of /etc/apache2/sites-enabled/000-my-site.conf:
AllowOverride not allowed here

I'm a bit confused because I understand that is the right place to do it

like image 226
rkmax Avatar asked Feb 19 '16 15:02

rkmax


1 Answers

It's because you have to put it in <Directory> directive.' .htaccess is per directory context, so you have to explicitly tell apache where .htaccess is allowed to be used.

<VirtualHost *:80>
  DocumentRoot /var/www/html
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  Options Includes
  <Directory "/var/www/html">
  AllowOverride All
  </Directory>
</VirtualHost>
like image 138
Panama Jack Avatar answered Oct 14 '22 09:10

Panama Jack