1、安裝提供web服務的軟件
yum -y install httpd
2、啟動httpd服務
systemctl start httpd
3、進入主配置文件()
1)vim /etc/httpd/conf/httpd.conf
2)在此范圍內添加或刪除設置,為了方便編寫,編輯了一個子配置文件/etc/httpd/conf.d/httpd-vhosts.conf
4、編輯子配置文件
1)vim /etc/httpd/conf.d/httpd-vhosts.conf (此路徑必為conf.d/*.conf)
2)在該文件內編輯以下內容
5、重啟服務
systemctl restart httpd
6、編輯頁面測試文件
1)在web服務中默認存放網頁文件的路徑:/var/www/html
2)默認網頁文件名字:index.html
3)vim /var/www/html/index.html
4)編寫內容按需求
welcome to here
7、瀏覽器驗證
直接輸入安裝的本機ip地址,可得
來源:https://blog.51cto.com/u_13869720/2306896