thinkphp Apache配置重启Apache1 restart 出错解决办法


Posted in PHP onFebruary 15, 2017

概要:

thinkphp 在Apache上配置启用伪静态,重启Apache1 restart 竟然失败了,报错

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details

嗯,看状态

执行命令 systemctl status httpd.service

[root@cloud1 bin]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
  Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
  Active: failed (Result: exit-code) since 五 2016-08-26 11:13:09 CST; 6min ago
   Docs: man:httpd(8)
      man:apachectl(8)
 Process: 9915 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
 Process: 9913 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 9913 (code=exited, status=1/FAILURE)
 
8月 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
8月 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
8月 26 11:13:09 cloud1.localdomain httpd[9913]: no listening sockets available, shutting down
8月 26 11:13:09 cloud1.localdomain httpd[9913]: AH00015: Unable to open logs
8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
8月 26 11:13:09 cloud1.localdomain kill[9915]: kill: cannot find process ""
8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
8月 26 11:13:09 cloud1.localdomain systemd[1]: Failed to start The Apache HTTP Server.
8月 26 11:13:09 cloud1.localdomain systemd[1]: Unit httpd.service entered failed state.
8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service failed.

从上可以看到,80端口被占用了

 执行journalctl -xe

[root@cloud1 bin]# journalctl -xe
--
-- Unit session-9830.scope has finished starting up.
--
-- The start-up result is done.
8月 26 11:01:01 cloud1.localdomain systemd[1]: Starting Session 9830 of user root.
-- Subject: Unit session-9830.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-9830.scope has begun starting up.
8月 26 11:01:01 cloud1.localdomain CROND[9744]: (root) CMD (run-parts /etc/cron.hourly)
8月 26 11:01:01 cloud1.localdomain run-parts(/etc/cron.hourly)[9747]: starting 0anacron
8月 26 11:01:01 cloud1.localdomain run-parts(/etc/cron.hourly)[9753]: finished 0anacron
8月 26 11:01:01 cloud1.localdomain run-parts(/etc/cron.hourly)[9755]: starting 0yum-hourly.cron
8月 26 11:01:01 cloud1.localdomain run-parts(/etc/cron.hourly)[9759]: finished 0yum-hourly.cron
8月 26 11:10:01 cloud1.localdomain systemd[1]: Started Session 9831 of user root.
-- Subject: Unit session-9831.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-9831.scope has finished starting up.
--
-- The start-up result is done.
8月 26 11:10:01 cloud1.localdomain systemd[1]: Starting Session 9831 of user root.
-- Subject: Unit session-9831.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-9831.scope has begun starting up.
8月 26 11:10:01 cloud1.localdomain CROND[9870]: (root) CMD (/usr/lib64/sa/sa1 1 1)
8月 26 11:13:09 cloud1.localdomain polkitd[1171]: Registered Authentication Agent for unix-process:9908:450142261 (system bus name :1.19686 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object p
8月 26 11:13:09 cloud1.localdomain systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has begun starting up.
8月 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
8月 26 11:13:09 cloud1.localdomain httpd[9913]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
8月 26 11:13:09 cloud1.localdomain httpd[9913]: no listening sockets available, shutting down
8月 26 11:13:09 cloud1.localdomain httpd[9913]: AH00015: Unable to open logs
8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
8月 26 11:13:09 cloud1.localdomain kill[9915]: kill: cannot find process ""
8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
8月 26 11:13:09 cloud1.localdomain systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
--
-- The result is failed.
8月 26 11:13:09 cloud1.localdomain systemd[1]: Unit httpd.service entered failed state.
8月 26 11:13:09 cloud1.localdomain systemd[1]: httpd.service failed.
8月 26 11:13:09 cloud1.localdomain polkitd[1171]: Unregistered Authentication Agent for unix-process:9908:450142261 (system bus name :1.19686, object path /org/freedesktop/PolicyKit1/Authenticatio

上面这是查看日志

 查看Apache中的 httpd-vhosts.conf 文件,发现Listen 80 两次,httpd-vhosts.conf一次,httpd.conf一次

虚拟机里的加个#Listen 80  OK解决了

备注:apache\Apache\conf下,extraoriginal文件夹的含义

extra的意思是额外扩展

original的意思是源目录文件

original文件夹是配置文件的源文件备份,而真正要配置的是conf目录下的httpd.conf文件以及extra目录的额外扩展配置。

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

PHP 相关文章推荐
用PHP和ACCESS写聊天室(三)
Oct 09 PHP
php header()函数使用说明
Jul 10 PHP
php ss7.5的数据调用 (笔记)
Mar 08 PHP
jQuery 源码分析笔记
May 25 PHP
浅析php学习的路线图
Jul 10 PHP
php无限遍历文件夹示例分享
Mar 04 PHP
Laravel 5 框架入门(四)完结篇
Apr 09 PHP
WordPress中编写自定义存储字段的相关PHP函数解析
Dec 25 PHP
PHPMailer发送邮件
Dec 28 PHP
原生php实现excel文件读写的方法分析
Apr 25 PHP
Yii2框架类自动加载机制实例分析
May 02 PHP
PHP数组对象与Json转换操作实例分析
Oct 22 PHP
php+redis实现注册、删除、编辑、分页、登录、关注等功能示例
Feb 15 #PHP
Yii2 hasOne(), hasMany() 实现三表关联的方法(两种)
Feb 15 #PHP
Yii2中hasOne、hasMany及多对多关联查询的用法详解
Feb 15 #PHP
详解配置 Apache 服务器支持 PHP 文件的解析
Feb 15 #PHP
PHP使用Redis替代文件存储Session的方法
Feb 15 #PHP
Yii2中多表关联查询hasOne hasMany的方法
Feb 15 #PHP
php+Memcached实现简单留言板功能示例
Feb 15 #PHP
You might like
PHP连接SQLSERVER 注意事项(附dll文件下载)
2012/06/28 PHP
hadoop常见错误以及处理方法详解
2013/06/19 PHP
php单例模式实现方法分析
2015/03/14 PHP
PHP关键特性之命名空间实例详解
2017/05/06 PHP
JS如何将UTC格式时间转本地格式
2013/09/04 Javascript
再谈javascript原型继承
2014/11/10 Javascript
jQuery仿Flash上下翻动的中英文导航菜单实例
2015/03/10 Javascript
javascript中的正则表达式使用详解
2015/08/30 Javascript
js实现带缓冲效果的仿QQ面板折叠菜单代码
2015/09/06 Javascript
Json按某个键的值进行排序
2016/12/22 Javascript
浅谈SpringMVC中post checkbox 多选框value的值(隐藏域方式)
2018/01/08 Javascript
react-router 路由切换动画的实现示例
2018/12/03 Javascript
React 组件渲染和更新的实现代码示例
2019/02/21 Javascript
Node.js使用MongoDB的ObjectId作为查询条件的方法
2019/09/10 Javascript
JavaScript修改注册表实例代码
2020/01/05 Javascript
原生JS实现天气预报
2020/06/16 Javascript
vue组件是如何解析及渲染的?
2021/01/13 Vue.js
[34:56]Ti4冒泡赛LGD vs Liquid 1
2014/07/14 DOTA
[01:26]神话结束了,却也刚刚开始——DOTA2新英雄玛尔斯驾临战场
2019/03/10 DOTA
Python中Class类用法实例分析
2015/11/12 Python
git进行版本控制心得详谈
2017/12/10 Python
Python求两个圆的交点坐标或三个圆的交点坐标方法
2018/11/07 Python
Python正则表达式匹配日期与时间的方法
2019/07/07 Python
HTML5在canvas中绘制复杂形状附效果截图
2014/06/23 HTML / CSS
Original Penguin英国官方网站:美国著名休闲时装品牌
2016/10/30 全球购物
TripAdvisor西班牙官方网站:全球领先的旅游网站
2018/01/10 全球购物
Schecker荷兰:狗狗用品和配件
2019/06/06 全球购物
九年级家长会邀请函
2014/01/15 职场文书
马云北大演讲完整版:真心话,什么才是阿里的核心竞争力?
2014/04/04 职场文书
创业女性典型材料
2014/05/02 职场文书
汉语言文学专业求职信
2014/06/19 职场文书
党员群众路线教育实践活动剖析材料
2014/10/10 职场文书
地道战观后感2000字
2015/06/04 职场文书
推荐六本经典文学奖书籍:此生必读
2019/08/22 职场文书
Java图书管理系统,课程设计必用(源码+文档)
2021/06/30 Java/Android
mysql5.7的安装及Navicate长久免费使用的实现过程
2021/11/17 MySQL