hfyuan@hfyuan-ThinkCentre-M58:/etc$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 234 of /etc/apache2/apache2.conf:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 234 of /etc/apache2/apache2.conf:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
the solution:
RewriteEngine命令需要rewrite mod的支持, $>cd /etc/apache2/mods-enabled 切换到apache下的mods-enabled目录 $>sudo ln -s ../mods-available/rewrite.load rewrite.load 启用rewrite mod $>sudo /etc/init.d/apache2 restart 重启apache服务器。 或者在apache的配置文件httpd.conf中将#LoadModule rewrite_module modules/mod_rewrite.so前的#去掉,再重启服务器。