概述
系统centos8,利用httpd搭建本地web服务器.
安装httpd
sudo yum install -y httpd
启动服务
service httpd start
设置开机启动
- 先查看有没有设置开机启动:
systemctl list-unit-files | grep httpd
httpd.service enabled #这个表示已经打开
httpd@.service disabled
httpd.socket disabled
- 没有的话设置:
chkconfig httpd on
-
在浏览器输入ip访问
-
修改var/www/html/index.html,修改主页内容
-
ps:在浏览器中默认的定位就是在该目录之下