centos:httpd服务配置

httpd是Apache超文本传输协议(HTTP)服务器的主程序。被设计为一个独立运行的后台进程,它会建立一个处理请求的子进程或线程的池。
它可以使得我们可以访问服务端配置的一些简单网页。例如:测试报告。

配置:
1.安装httpd服务:yum install httpd -y
2.重启httpd服务:systemctl start httpd.service
3.关闭防火墙:systemctl stop iptables.service
4.测试:放置html文件到var/www/html 目录
5.浏览器打开测试:http://ip/xx文件.html

访问效果:
图片

部分错误处理办法:
1、service httpd start:Redirecting to /bin/systemctl start httpd.service。
解决办法:/bin/systemctl start httpd.service

2、Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.:Active: failed,(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80。
解决办法:找到占用80端口的服务,kill掉。netstat -antlp | grep 80。

例如:
tcp 0 0 172.17.0.2:80 0.0.0.0:* LISTEN 21761/python3
kill:kill -9 21761
重启httpd服务:/bin/systemctl start httpd.service

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值