CentOS下如何设置Apache的伪静态
CentOS下如何设置Apache的伪静态
最近因为要安装Chevereto,需要开启Apache的伪静态。搜索了网上的很多资料,都没有成功。经过一番摸索,最后还是找到了方法,现在记录如下,供大家参考。
首先,编辑Apache的配置文件:httpd.conf,命令如下:
vim /etc/httpd/conf/httpd.conf
在httpd.conf中找到:Include conf.modules.d/*.conf
,在其下一行添加以下代码:
LoadModule rewrite_module modules/mod_rewrite.so
然后继续寻找,找到:
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
将 AllowOverride None
改为:AllowOverride all
即可。
最后,按ESC,输入::wq
,退出。再重启Apache:systemctl restart httpd.service
就完成了。