如何在Apache中安装mod_authz_host?

当我放

Order deny,allow Deny from all Allow from dev.example.com 

进入/etc/apache2/conf.d/restrict.confservice apache2 restart我得到了

 Syntax error on line 1 of /etc/apache2/conf.d/restrict.conf: order not allowed here Action 'configtest' failed. The Apache error log may have more information. ...fail! 

请帮忙。

您的问题不是没有安装或加载mod_authnz_host,而是将这些指令放在错误的位置。 它们仅在块中有效,如下所示:

  Order deny,allow Deny from all Allow from dev.example.com