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 相关文章推荐
一个连接两个不同MYSQL数据库的PHP程序
Oct 09 PHP
用PHP实现ODBC数据分页显示一例
Oct 09 PHP
PHP 中的面向对象编程:通向大型 PHP 工程的办法
Dec 03 PHP
php header示例代码(推荐)
Sep 08 PHP
PHP中Date()时间日期函数的使用方法小结
Apr 20 PHP
PHP实现邮件群发的源码
Jun 18 PHP
分享下PHP register_globals 值为on与off的理解
Sep 26 PHP
php实现对象克隆的方法
Jun 20 PHP
PHP中如何使用session实现保存用户登录信息
Oct 20 PHP
在Mac OS上搭建PHP的Yii框架及相关测试环境
Feb 14 PHP
PHP工厂模式简单实现方法示例
May 23 PHP
通过代码实例解析PHP session工作原理
Dec 11 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插入排序实现代码
2013/04/04 PHP
Symfony2安装第三方Bundles实例详解
2016/02/04 PHP
PHP基于ORM方式操作MySQL数据库实例
2017/06/21 PHP
javascript中数组中求最大值示例代码
2013/12/18 Javascript
jQuery插件PageSlide实现左右侧栏导航菜单
2015/04/12 Javascript
javascript实现dom动态创建省市纵向列表菜单的方法
2015/05/14 Javascript
javascript 使用for循环时该注意的问题-附问题总结
2015/08/19 Javascript
基于insertBefore制作简单的循环插空效果
2015/09/21 Javascript
JS+CSS3实现超炫的散列画廊特效
2016/07/16 Javascript
ECMAScript6轮播图实践知识总结
2016/08/17 Javascript
谈谈JavaScript的New关键字
2016/08/26 Javascript
微信小程序 轮播图swiper详解及实例(源码下载)
2017/01/11 Javascript
微信小程序之发送短信倒计时功能
2017/08/30 Javascript
JavaScript树的深度优先遍历和广度优先遍历算法示例
2018/07/30 Javascript
详解webpack引用jquery(第三方模块)的三种办法
2019/08/21 jQuery
vue实现计步器功能
2019/11/01 Javascript
vue实现购物车列表
2020/06/30 Javascript
Vue优化:常见会导致内存泄漏问题及优化详解
2020/08/04 Javascript
pycharm 使用心得(二)设置字体大小
2014/06/05 Python
Python实现打印螺旋矩阵功能的方法
2017/11/21 Python
浅谈python中真正关闭socket的方法
2018/12/18 Python
python 读取Linux服务器上的文件方法
2018/12/27 Python
详解Python中的内建函数,可迭代对象,迭代器
2019/04/29 Python
简单了解Python write writelines区别
2020/02/27 Python
Python处理mysql特殊字符的问题
2020/03/02 Python
Python matplotlib绘制图形实例(包括点,曲线,注释和箭头)
2020/04/17 Python
详解pycharm2020.1.1专业版安装指南(推荐)
2020/08/07 Python
美国在线印刷公司:PsPrint
2017/10/12 全球购物
新加坡交友网站:be2新加坡
2019/04/10 全球购物
新闻记者实习自我鉴定
2013/09/19 职场文书
酒店开业庆典主持词
2014/03/21 职场文书
学生评语大全
2014/04/18 职场文书
小学生母亲节演讲稿
2014/05/07 职场文书
2015年小学生新年寄语
2014/12/08 职场文书
2015年全国爱眼日活动方案
2015/05/05 职场文书
2015年幼儿园安全工作总结
2015/05/12 职场文书