HTTP基础配置

1  mount     查看挂载信息
2  mount /dev/sr0 /mnt/

3 vim /etc/yum.repos.d/base.repo //对yum的仓库信息进行配置
[base]
name=base
baseurl=file:///mnt //仓库的url
gpgcheck=0
enable=1

4 yum repolist //检查仓库状态

[root@localhost ~]# yum repolist
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
源标识 源名称 状态
base base 4,620
repolist: 4,620 4620为本地源

5  yum install httpd -y   //安装httpd服务
6  rpm -qa httpd       // 查看httpd服务安装情况
7  rpm -ql httpd       // 查看httpd安装的文件

8 vim /etc/httpd/conf/httpd.conf //对httpd的配置文件进行修改
ServerName www.example.com:80改为ServerName 0.0.0.0:80 //改为对所有ip的缺省

9 systemctl start httpd //开启http服务
10 systemctl stop firewalld.service //关闭防火墙
11 setenforce 0 // 关闭SELinux

12 systemctl status httpd -l // 查看httpd的状态 并在网页查看服务是否打开
13 vim /var/www/html/index.html 编辑配置文件默认显示的html页面

this is a my new web. Hello World!

14 systemctl restart httpd //重启httpd的服务
15 systemctl status httpd //查看httpd服务状态是否开启

网页结果查看:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_39396529/article/details/84397044