Linux中Apache服务器的简单配置
2018-06-29 06:10:12来源:博客园 阅读 ()
配置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/
版权声明:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
大家写文都不容易,请尊重劳动成果~ 这里谢谢大家啦(*/ω\*)
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇:Linux中VSFTP的配置
- Linux系统如何设置开机自动运行脚本? 2020-06-11
- Linux指令和shell脚本 2020-06-11
- 适合开发者的最佳Linux发行版 2020-06-11
- RAID 1 软件实现(Linux 系统) 2020-06-10
- linux各级目录 2020-06-08
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash
