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新手上路(十)
Oct 09 PHP
php防注
Jan 15 PHP
PHP DataGrid 实现代码
Aug 12 PHP
Yii框架调试心得--在页面输出执行sql语句
Dec 25 PHP
PHP制作万年历
Jan 07 PHP
浅谈本地WAMP环境的搭建
May 13 PHP
Symfony2使用第三方库Upload制作图片上传实例详解
Feb 04 PHP
PHP简单创建压缩图的方法
Aug 24 PHP
PHP中Laravel 关联查询返回错误id的解决方法
Apr 01 PHP
php新建文件的方法实例
Sep 26 PHP
PHP实现单条sql执行多个数据的insert语句方法
Oct 11 PHP
基于ThinkPHP删除目录及目录文件函数
Oct 28 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
使用无限生命期Session的方法
2006/10/09 PHP
初探jquery——表单应用范例
2007/02/20 Javascript
JavaScript的模块化:封装(闭包),继承(原型) 介绍
2013/07/22 Javascript
浅析js中的浮点型运算问题
2014/01/06 Javascript
JavaScript原型链示例分享
2014/01/26 Javascript
web前端设计师们常用的jQuery特效插件汇总
2014/12/07 Javascript
javascript设计模式之中介者模式Mediator
2014/12/30 Javascript
JavaScript数组常用方法
2015/03/02 Javascript
JS+CSS实现带小三角指引的滑动门效果
2015/09/22 Javascript
深入理解Node.js的HTTP模块
2016/10/12 Javascript
JS实现复制功能
2017/03/01 Javascript
javascript编程实现栈的方法详解【经典数据结构】
2017/04/11 Javascript
浅谈Vue.js中ref ($refs)用法举例总结
2017/12/19 Javascript
vue中axios请求的封装实例代码
2019/03/23 Javascript
vant-ui框架的一个bug(解决切换后onload不触发)
2020/11/11 Javascript
[40:19]2018完美盛典CS.GO表演赛
2018/12/17 DOTA
python实现杨辉三角思路
2017/07/14 Python
python解析html提取数据,并生成word文档实例解析
2018/01/22 Python
python使用mysql的两种使用方式
2018/03/07 Python
Python使用re模块正则提取字符串中括号内的内容示例
2018/06/01 Python
python实现猜单词小游戏
2020/05/22 Python
python实现大转盘抽奖效果
2019/01/22 Python
wxPython:python首选的GUI库实例分享
2019/10/05 Python
在Python中等距取出一个数组其中n个数的实现方式
2019/11/27 Python
利用python控制Autocad:pyautocad方式
2020/06/01 Python
Python常用数字处理基本操作汇总
2020/09/10 Python
CSS3 :not()选择器实现最后一行li去除某种css样式
2016/10/19 HTML / CSS
HTML5 visibilityState属性详细介绍和使用实例
2014/05/03 HTML / CSS
应届生求职简历的自我评价怎么写
2013/10/23 职场文书
生物学学生自我评价
2014/01/17 职场文书
大学生个人实习的自我评价
2014/02/15 职场文书
法定授权委托证明书
2014/09/27 职场文书
2014年个人工作总结报告
2014/11/27 职场文书
教师节感谢信
2015/01/22 职场文书
协议书范文
2015/01/27 职场文书
SQLServer RANK() 排名函数的使用
2022/03/23 SQL Server