Apache:rewrite模块不存在

时间:2019-08-20 17:58:10  来源:igfitidea点击:

我在模块时,发现Apache Web服务器存在重写问题,我试图启用重写模块,但是遇到了这个错误 **错误:模块重写不存在!)。故障排除后,我发现。

在Ubuntu中使用Apache时,报错

ERROR: Module rewrite does not exist!

问题出在mod_rewrite模块上。
经过故障排查,发现问题出现在
/etc/apache2/mods-available/ 中没有文件 rewrite.load

下面是排查过程

root@theitroad:~# a2enmod rewrite
ERROR: Module rewrite does not exist!
root@theitroad:~# ls -l /usr/lib/apache2/modules/mod_rewrite.so
-rw-r--r-- 1 root root 58728 Jul 12  2013 /usr/lib/apache2/modules/mod_rewrite.so
root@theitroad:~# 
root@theitroad:~# echo "LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so" > /etc/apache2/mods-available/rewrite.load
root@theitroad:~# 
root@theitroad:~# a2enmod rewriteEnabling module rewrite.
To activate the new configuration, you need to run:
  service apache2 restart
root@theitroad:~# service apache2 restart