搭建简单Web服务器
-
安装web服务
yum -y install httpd -
启动httpd服务
systemctl start httpd -
查看httpd是否开启成功
service httpd status
以下是状态信息:

-
重新启动httpd
systemctl restart httpd
6.进入主配置文件
vim /etc/httpd/conf/httpd.conf

-
编辑自配置文件
vim /etc/httpd/conf.d/httpd-vhosts.conf 此路径必为conf.d/*.conf

-
重启httpd服务
systemctl restart httpd -
编辑页面测试文件
- 在web服务中默认存放网页文件的路径:/var/www/html
- 默认网页文件名字:index.html
- 进入编辑index.html
vim /var/www/html/index.html - 编写追加内容如下
welcome to T.com - 保存并退出vi
1、Esc 2、Shift + : 3、wq(保存)
- 本地机器访问

另外如果访问出现失败,很有可能是Linux防火墙没有关闭 ,请参考 防火墙设置
END















![[附源码]SSM计算机毕业设计疫情期间回乡人员管理系统JAVA](https://img-blog.csdnimg.cn/0603036a6ba94913b9f4406318e0236d.png)



![[附源码]计算机毕业设计springboot汽车租赁管理系统](https://img-blog.csdnimg.cn/82b1f305fd5f4a758e928c18c25e3809.png)