配置Apache服务器: 1.安装Apache,可以参考Linux 中yum的配置来安装: yum install http* -y2.修改SELinux:setenforce 0查看: 3.防火墙开放httpd服务 firewall-cmd --permanent --add-service=httpd重启防火墙:firewall-cmd --reload查看防火墙:firewall-cmd --list-all4.修改Apache服务器的配置 新建测试文件: vim /etc/httpd/conf.d/test.conf
其中: 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 blique; 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 httpd7.在windows下访问该网页
其中地址为服务器端的地址 |