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 相关文章推荐
一个ORACLE分页程序,挺实用的.
Oct 09 PHP
PHP Memcached + APC + 文件缓存封装实现代码
Mar 11 PHP
php array_push()数组函数:将一个或多个单元压入数组的末尾(入栈)
Jul 12 PHP
PHP FOR MYSQL 代码生成助手(根据Mysql里的字段自动生成类文件的)
Jul 23 PHP
php报表之jpgraph柱状图实例代码
Aug 22 PHP
PHP结合JQueryJcrop实现图片裁切实例详解
Jul 24 PHP
CodeIgniter框架URL路由总结
Sep 03 PHP
php实现的Cookies操作类实例
Sep 24 PHP
php中file_get_contents与curl性能比较分析
Nov 08 PHP
javascript some()函数用法详解
Nov 13 PHP
smarty自定义函数用法示例
May 20 PHP
PHP实现的pdo连接数据库并插入数据功能简单示例
Mar 30 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读取IMAP邮件
2006/10/09 PHP
PHP魔术方法使用方法汇总
2016/02/14 PHP
PHP检查文件是否存在,不存在自动创建及读取文件内容操作示例
2020/01/23 PHP
JavaScript 全角转半角部分
2009/10/28 Javascript
5个最佳的Javascript日期处理类库分享
2012/04/15 Javascript
JS实现状态栏跑马灯文字效果代码
2015/10/24 Javascript
解决jquery中动态新增的元素节点无法触发事件问题的两种方法
2015/10/30 Javascript
js实现不重复导入的方法
2016/03/02 Javascript
vue中mint-ui环境搭建详细介绍
2017/04/06 Javascript
通过源码分析Vue的双向数据绑定详解
2017/09/24 Javascript
JavaScript复制内容到剪贴板的两种常用方法
2018/02/27 Javascript
JavaScript创建对象的四种常用模式实例分析
2019/01/11 Javascript
JavaScript实现电灯开关小案例
2020/03/30 Javascript
Vue 数据绑定的原理分析
2020/11/16 Javascript
pycharm 使用心得(七)一些实用功能介绍
2014/06/06 Python
Python实现删除Android工程中的冗余字符串
2015/01/19 Python
python同时给两个收件人发送邮件的方法
2015/04/30 Python
python交互式图形编程实例(二)
2017/11/17 Python
python爬取个性签名的方法
2018/06/17 Python
Python中Proxypool库的安装与配置
2018/10/19 Python
浅析Python 责任链设计模式
2020/09/11 Python
python基于exchange函数发送邮件过程详解
2020/11/06 Python
如何设置PyCharm中的Python代码模版(推荐)
2020/11/20 Python
让ie浏览器成为支持html5的浏览器的解决方法(使用html5shiv)
2014/04/08 HTML / CSS
H5新属性audio音频和video视频的控制详解(推荐)
2016/12/09 HTML / CSS
英国最大的线上保健品零售商之一:Vitamin Planet
2016/12/01 全球购物
英国亚马逊官方网站:Amazon.co.uk
2019/08/09 全球购物
社会学专业学生职业规划书
2014/02/07 职场文书
教职工代表大会主持词
2014/04/01 职场文书
医院合作协议书
2014/08/19 职场文书
授权收款委托书
2014/09/23 职场文书
专业见习报告范文
2014/11/03 职场文书
计划生育汇报材料
2014/12/26 职场文书
安全保证书
2015/01/16 职场文书
寻找最美乡村教师观后感
2015/06/18 职场文书
篮球赛新闻稿
2015/07/17 职场文书