安裝Apache服務程序
yum install httpd

rpm -ql httpd? 查看安裝的所有文件

【/etc/httpd】--服務目錄
【/etc/httpd/conf/httpd.conf】--主配置文件
【/var/www/html】--網站數(shù)據(jù)目錄

【/var/log/httpd/access_log】--訪問日志

訪問日志實時更新用戶訪問的詳細信息

【/var/log/httpd/error_log】--錯誤日志

進入主配置文件 vim /etc/httpd/conf/httpd.conf
服務目錄-->

管理員郵箱-->

運行服務的用戶&運行服務的用戶組-->

網站服務器的域名-->

網站數(shù)據(jù)目錄-->

網站數(shù)據(jù)目錄的權限-->

監(jiān)聽IP地址與端口號-->

默認索引頁頁面-->

修改/var/www/html/index.html內容

打開火狐瀏覽器輸入127.0.0.1

【修改網站的數(shù)據(jù)目錄為/home/wwwroot】
創(chuàng)建目錄

修改/etc/httpd/conf/httpd.conf里的網站數(shù)據(jù)目錄和網站數(shù)據(jù)目錄的權限

修改完畢后wq保存退出
systemctl restart httpd --重啟Apache服務
打開火狐重新訪問

如果沒有出現(xiàn)自己設置的頁面則需要[關閉SElinux]
修改/etc/selinux/config的selinux為禁用狀態(tài)

修改完畢之后重新訪問即可
【個人用戶主頁功能】
編輯vim /etc/httpd/conf.d/userdir.conf
在第17行加上注釋--24行去掉注釋
