web服务器的简单搭建
参考:https://blog.51cto.com/13869720/2306896
1、安装一个可以提供web服务的软件
yum -y install httpd
2、 启动httpd服务
systemctl start httpd
3、进入主配置文件
vim /etc/httpd/conf/httpd.conf
在此范围内添加或删除设置,为了方便编写,编辑了一个子配置文件/etc/httpd/conf.d/httpd-vhosts.conf
4、 编辑子配置文件
vim /etc/httpd/conf.d/httpd-vhosts.conf 此路径必为conf.d/*.conf (意:为.conf 后缀命名)
systemctl restart httpd 重启服务
5、 编辑页面测试文件
在web服务中默认存放网页文件的路径:/var/www/html
默认网页文件名字:index.html
cat /var/www/html/index.html 查看index.html 文件中的内容
6、 浏览器测试
ifconfig ens33 查看ens33网卡的地址
在浏览器中输入地址,即可查看内容