美文网首页
centos:httpd服务配置

centos:httpd服务配置

作者: 玩转测试开发 | 来源:发表于2021-09-09 01:41 被阅读0次

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

微信公众号:玩转测试开发
欢迎关注,共同进步,谢谢!

相关文章

网友评论

      本文标题:centos:httpd服务配置

      本文链接:https://www.haomeiwen.com/subject/vtabwltx.html