centos7 配置http服务器

2021-1-20 Hyp
1.安装 http,使用命令

yum install -y httpd

2.重启http服务
关闭服务

  httpd service stop

启动服务

 httpd service start

重启服务

 httpd service restart

3.测试运行
使用浏览器访问localhost或者127.0.0.1
出现测试页面即服务启动成功
在这里插入图片描述

4.制作自己的测试网页在/var/www/html/ 目录下新建一个index.html文件

	vim /var/www/html/index.html
输入
	<h1>hello word</h1>

按esc :qw保存退出

访问服务器

	curl 127.0.0.1

本地访问成功
本地访问成功

5.配置apache

vim  /etc/httpd/conf/httpd.conf  #打开apache配置文件

将servername注释 去掉,编辑自己的配置

#ServerName=www.exmpel.com :80 
#修改为
ServerName=localhost:80

猜你喜欢

转载自blog.csdn.net/m0_52425873/article/details/112910402