修改httpd服务目录

1.新建一个httpd服务目录文件夹
# mkdir /data/web/html -pv
-p, –parents 可以是一个路径名称。此时若路径中的某些目录尚不存在,加上此选项后,系统将自动建立好那些尚不存在的目录,即一次可以建立多个目录;
-v, –verbose 每次创建新目录都显示信息
2.# vim /etc/httpd/conf/httpd.conf
119行"DocumentRoot "/var/www/html"修改为
"DocumentRoot "/data/web/html"
还有 131行"# Further relax access to the default document root:
<Directory "/var/www/html">"需要修改为
<Directory "/data/web/html">
修改完后,使用 httpd -t 检查语法是否有误;
出现的错误: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message( AH00558:httpd:无法使用localhost可靠地确定服务器的完全限定域名。本地域。全局设置“ServerName”指令以抑制此消息
解决方法:
95行
# vim /etc/httpd/conf/httpd.conf
# systemctl stop httpd
# systemctl start httpd
# systemctl status httpd
# httpd -t
Syntax OK
3.新建一个测试主页看一下
 # vim /data/web/html/index.html 
<h1>change diretory </h1>
<h2>show time </h2>
4. 修改完毕需要重启httpd服务
# systemctl restart httpd.service
  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值