Linux中Apache简单配置,Linux中Apache服务器的简单配置

配置Apache服务器:

1.安装Apache,可以参考Linux 中yum的配置来安装:

yum install http* -y

2.修改SELinux:

setenforce 0

查看:

e09a8e00474a4e91f24d5862ee330149.png

3.防火墙开放httpd服务

firewall-cmd --permanent --add-service=httpd

重启防火墙:

firewall-cmd --reload

查看防火墙:

firewall-cmd --list-all

044abb53386510e57de6600d64dfcc59.png

4.修改Apache服务器的配置

新建测试文件:

vim /etc/httpd/conf.d/test.conf

ServerName server0.example.com

DocumentRoot/var/www/html

3a8253b4cad2f694f0dad3f70e6b9e03.png

其中:

ServerName 为域名

DocumentRoot 为html主页的路径

5.创建一个html文件

/var/www/html/index.html

页面导航

*{ margin:0; padding:0}//#id ul{ border: 2px solid red;}

#id ul{ list-style-type:none; margin:0auto;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 }

6.启动http服务

systemctl start httpd

开机自启动:

systemctl enable httpd

7.在windows下访问该网页

93dca9d859fc0c3993be4608a31cf522.png

其中地址为服务器端的地址

版权

作者:feiquan

出处:http://www.cnblogs.com/feiquan/

版权声明:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

大家写文都不容易,请尊重劳动成果~ 这里谢谢大家啦(*/ω\*)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值