配置Apache服務器:css
1.安裝Apache,能夠參考Linux 中yum的配置來安裝:html
yum install http* -y
2.修改SELinux:vim
setenforce 0
查看:windows
3.防火牆開放httpd服務服務器
firewall-cmd --permanent --add-service=httpd
重啓防火牆:post
firewall-cmd --reload
查看防火牆:測試
firewall-cmd --list-all
4.修改Apache服務器的配置url
新建測試文件:spa
vim /etc/httpd/conf.d/test.conf
<Virtualhost *:80> ServerName server0.example.com DocumentRoot /var/www/html </Virtualhost>
其中:3d
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/
版權聲明:本文版權歸做者和博客園共有,歡迎轉載,但未經做者贊成必須保留此段聲明,且在文章頁面明顯位置給出原文鏈接,不然保留追究法律責任的權利。
你們寫文都不容易,請尊重勞動成果~ 這裏謝謝你們啦(*/ω\*)