错误一:aaa@boco:/etc/apache2/mods-available$ sudo service apache2 restart
Syntax error on line 160 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.
...fail!
解决方法:如果之前有将/etc/apache2/mods-available/ authz_host.load的模块给禁用,只需要将这个模块给启动即可。
aaa@boco:/etc/apache2/mods-available$ cat authz_host.load
LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so
再次重启apache2服务时报如下错误:
错误二:
aaa@boco:/etc/apache2/mods-available$ sudo service apache2 restart
Syntax error on line 22 of /etc/apache2/conf.d/nagios.conf:
Invalid command 'AuthUserFile', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
解决方法:和上面的一样,只需要启动authn_file.load这个模块即可
aaa@boco:/etc/apache2/mods-available$ cat authn_file.load
LoadModule authn_file_module /usr/lib/apache2/modules/mod_authn_file.so
使用下面的方法同样可以解决上述两个问题:
a2enmod authn_file
sudo a2enmod authz_host
sudo /etc/init.d/apache2 restart