导读 | Linux下默认安装后的Apache根目录在/var/www/html下,有些时候我们可能需要更改这一设置。 |
Apache
创建自己需要更改的新目录,并更改宿主权限为apache用户 chown -R apache:apache /mnt/www
停止Apache
服务 service httpd stop
修改Apache的配置文件,默认在/etc/httpd/conf/httpd.conf
,找到Document Root
修改为你的新路径,如下图所示
以及下方的 Directory 为你的新路径,如下图所示
保存配置文件后,重启Apache
服务,你的Apache
目录更改就会生效了。
原文来自:http://sh.qihoo.com/pc/96a573bb187ed19b4?cota=4&tj_url=xz&sign=360_e39369d1&refer_scene=so_3
本文地址:https://www.linuxprobe.com/linux-modify-apache.html编辑:坑人小妖精,审核员:逄增宝
Linux命令大全:https://www.linuxcool.com/
Linux系统大全:https://www.linuxdown.com/
红帽认证RHCE考试心得:https://www.rhce.net/