1. 程式人生 > >HTTP基礎配置

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 //檢查倉庫狀態

[[email protected] ~]# 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服務狀態是否開啟

網頁結果檢視:
在這裡插入圖片描述