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+FLASH实现上传文件进度条相关文件 下载
Jul 21 PHP
PHP之变量、常量学习笔记
Mar 27 PHP
PHP 输出缓存详解
Jun 20 PHP
php操作mysqli(示例代码)
Oct 28 PHP
smarty内置函数foreach用法实例
Jan 22 PHP
php生成gif动画的方法
Nov 05 PHP
WordPress中限制非管理员用户在文章后只能评论一次
Dec 31 PHP
zend framework重定向方法小结
May 28 PHP
PHP实现的获取文件mimes类型工具类示例
Apr 08 PHP
PHP时间戳和日期相互转换操作实例小结
Dec 18 PHP
PHP PDOStatement::rowCount讲解
Feb 01 PHP
goto语法在PHP中的使用教程
Sep 17 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连接Access数据库的方法小结
2013/06/20 PHP
php获取数组长度的方法(有实例)
2013/10/27 PHP
PHP开发中常见的安全问题详解和解决方法(如Sql注入、CSRF、Xss、CC等)
2014/04/21 PHP
解密ThinkPHP3.1.2版本之独立分组功能应用
2014/06/19 PHP
Linux php 中文乱码的快速解决方法
2016/05/13 PHP
Javascript 构造函数 实例分析
2008/11/26 Javascript
浅析Prototype的模板类 Template
2011/12/07 Javascript
基于JavaScript实现继承机制之构造函数方法对象冒充的使用详解
2013/05/07 Javascript
js函数在frame中的相互调用详解
2014/03/03 Javascript
JavaScript生成随机字符串的方法
2015/03/19 Javascript
详解JavaScript中Date.UTC()方法的使用
2015/06/12 Javascript
浅析JavaScript作用域链、执行上下文与闭包
2016/02/01 Javascript
JavaScript ES6中CLASS的使用详解
2016/11/22 Javascript
如何编写一个d.ts文件的步骤详解
2018/04/13 Javascript
解决v-for中使用v-if或者v-bind:class失效的问题
2018/09/25 Javascript
Vue实现商品详情页的评价列表功能
2019/09/04 Javascript
Vue.js自定义指令学习使用详解
2019/10/19 Javascript
maptalks+three.js+vue webpack实现二维地图上贴三维模型操作
2020/08/10 Javascript
[03:07]DOTA2英雄基础教程 冰霜诅咒极寒幽魂
2013/12/06 DOTA
Python中的lstrip()方法使用简介
2015/05/19 Python
利用Python批量生成任意尺寸的图片
2016/08/29 Python
深入理解Python中的 __new__ 和 __init__及区别介绍
2018/09/17 Python
python tkinter实现界面切换的示例代码
2019/06/14 Python
python中bs4.BeautifulSoup的基本用法
2019/07/27 Python
关于ResNeXt网络的pytorch实现
2020/01/14 Python
Python实现检测文件的MD5值来查找重复文件案例
2020/03/12 Python
Django中和时区相关的安全问题详解
2020/10/12 Python
即时搜索数百万张门票:SeatsForEveryone.com
2018/08/26 全球购物
介绍一下RMI的基本概念
2016/12/17 面试题
医院义诊活动总结
2014/07/04 职场文书
严以律己专题学习研讨会发言材料
2015/11/09 职场文书
2019最新企业员工考勤管理制度(通用版)!
2019/07/02 职场文书
感恩信:写给爸爸妈妈的一封感谢信
2019/09/12 职场文书
CSS变量实现主题切换的方法
2021/06/23 HTML / CSS
MySQL七大JOIN的具体使用
2022/02/28 MySQL
tree shaking对打包体积优化及作用
2022/07/07 Java/Android