配置Apache服務器:
1.安裝Apache,可以參考Linux 中yum的配置來安裝:
yum install http* -y
2.修改SELinux:
setenforce 0
查看:

3.防火牆開放httpd服務
firewall-cmd --permanent --add-service=httpd
重啟防火牆:
firewall-cmd --reload
查看防火牆:
firewall-cmd --list-all

4.修改Apache服務器的配置
新建測試文件:
vim /etc/httpd/conf.d/test.conf
<Virtualhost *:80> ServerName server0.example.com DocumentRoot /var/www/html </Virtualhost>

其中:
ServerName 為域名
DocumentRoot 為html主頁的路徑
5.創建一個html文件
/var/www/html/index.html
<html >
<head>
<title>頁面導航</title>
<style type="text/css">
*{ margin:0; padding:0}
//#id ul{ border: 2px solid red;}
#id ul{ list-style-type:none; margin:0 auto;width:600px }
#id ul li{ float:left; width:100px; text-align:center }
#id ul li a{ color:teal ; background-color:Aqua; display:inline-block;width:100px; line-height:30px ; text-decoration:none}
#id ul li a:hover{ background-color:Blue; color:White; font-style:oblique; font-weight:bold; text-decoration:underline }
</style>
</head>
<body>
<div id="id">
<ul>
<li><a href="#">首頁</a></li>
<li><a href="#">探索百科</a></li>
<li><a href="#">用戶</a></li>
<li><a href="#">任務</a></li>
<li><a href="#">合作</a></li>
<li><a href="#">知識商城</a></li>
</ul>
</div>
</body>
</html>
6.啟動http服務
systemctl start httpd
開機自啟動:
systemctl enable httpd
7.在windows下訪問該網頁

其中地址為服務器端的地址
版權
作者:feiquan
出處:http://www.cnblogs.com/feiquan/
版權聲明:本文版權歸作者和博客園共有,歡迎轉載,但未經作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文連接,否則保留追究法律責任的權利。
大家寫文都不容易,請尊重勞動成果~ 這里謝謝大家啦(*/ω\*)
