Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid command ‘Order’, perhaps misspelled or defined by a module not included in the server configuration failed

Tags:

linux

apache

When I try to start or restart my apache server, I get bellow message:

Syntax error on line 162 of /etc/apache2/apache2.conf: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration Action 'configtest' failed. The Apache error log may have more information. failed!

and I tried find this error on google and fix it:

http://linuxindetails.wordpress.com/2009/12/02/invalid-command-order-perhaps-misspelled-or-defined-by-a-module-not-included-in-the-server-configuration-failed/

I get error:

Module authz_host does not exist!

So, some body help me to fix it?

like image 466
thuan leminh Avatar asked Jun 07 '12 04:06

thuan leminh


3 Answers

I just had the same problem while upgrading from openSUSE 13.2 to openSUSE Leap 42.1.

The problem is not a missing module in the apache2-configuration.

The problem is the upgrade from apache 2.2 to apache 2.4. "Order" and "Allow" have to be rewritten as follows (example):

in 2.2:

Order allow,deny
Allow from all

in 2.4:

Require all granted

You can find more options an examples here: Upgrading apache2

like image 183
TheFan1968 Avatar answered Nov 20 '22 07:11

TheFan1968


With Apache 2.4 please uncomment/add the following modules:

LoadModule access_compat_module modules/mod_access_compat.so
LoadModule authz_host_module modules/mod_authz_host.so
like image 26
user989383 Avatar answered Nov 20 '22 08:11

user989383


On SUSE 12, authz_host was already enabled, so I needed to follow willoller's comment and enable mod_access_compat:

a2enmod mod_access_compat
service apache2 restart
like image 26
Chris Novak Avatar answered Nov 20 '22 07:11

Chris Novak