Centos httpd模組 Job for httpd.service failed because the control process exited with error code.
專案場景:
學習Linux的httpd模組報錯:
問題描述:
修改httpd 服務程式的主配置檔案後,重啟httpd服務報了以下錯:
[root@localhost ~]# systemctl restart httpd
Job for httpd.service failed because the control process exited with error code.
See "systemctl status httpd.service" and "journalctl -xe" for details.
原因分析:
其實最開是就應該想到是配置檔案寫錯了,因為是修改檔案後報錯的。。。但還是記錄一下一步一步的解決問題思路吧。
解決步驟:
搜尋Job for httpd.service failed because the control process exited with error code.的報錯資訊
- 先是修改80埠號,改為85、95、8088等都無效
- (這個沒有操作,因為看不懂)檢視Apache中的 httpd-vhosts.conf 檔案,發現Listen 80 兩次,httpd-vhosts.conf一次,httpd.conf一次,虛擬機器裡的加個#Listen 80
- 輸入systemctl status httpd.service 或 journalctl -xe,發現錯誤資訊為
[root@localhost ~]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2020-11-04 23:46:48 CST; 10s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 3319 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Process: 3609 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 3609 (code=exited, status=1/FAILURE)
Nov 04 23:46:48 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Nov 04 23:46:48 localhost.localdomain httpd[3609]: AH00526: Syntax error on line 119 of /etc/httpd/conf/httpd.conf:
Nov 04 23:46:48 localhost.localdomain httpd[3609]: DocumentRoot '/home/wwwroot' is not a directory, or is not readable
Nov 04 23:46:48 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Nov 04 23:46:48 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Nov 04 23:46:48 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Nov 04 23:46:48 localhost.localdomain systemd[1]: httpd.service failed.
- 查詢以下錯誤資訊
DocumentRoot '/home/wwwroot' is not a directory, or is not readable
以為是SELinux的原因,關閉SELinux後發現還未成功
- 最後發現是第一步修改httpd的配置檔案中Directory目錄寫錯(寫多了一個o),conf錯誤內容如下
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/home/wwworoot"
#
# Relax access to content within /var/www.
#
<Directory "/home/wwwrooot">
AllowOverride None
# Allow open access:
Require all granted
</Directory>
# Further relax access to the default document root:
<Directory "/home/wwwrooot">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
修改Directory目錄後正確生效
參考:
https://blog.csdn.net/weixin_30709635/article/details/99143232
https://blog.csdn.net/wangxiaoming099/article/details/23165575
https://blog.csdn.net/zhuoyr/article/details/8393854
https://tpyyes.com/a/linux/616.html(這篇文章最後一句告訴我對症下藥,然後我看了我的報錯資訊)
相關文章
- Mysql啟動報錯:Job for mysqld.service failed because the control process exited with error code.MySqlAIError
- Job for mysqld.service failed because the control process exited with error code...MySqlAIError
- Job for mysqld.service failed because the control process exited with error code錯誤解決MySqlAIError
- 安裝MySQL出現Job for mysqld.service failed because the control process exited with error codeMySqlAIError
- Job for firewalld.service failed because a timeout was exceeded. See "systemctl status firewalld.serAI
- error: Exited sync due to fetch errorsError
- 安裝GRID CONTROL The OPMN Process Manager failed to start報錯處理AI
- 安裝Grid Control , OPMN Process Manager failed to start 問題解決AI
- Starting httpd: httpd: apr_sockaddr_info_get() failed for subversionhttpdAI
- Error: The action can not be performed because ...could not be locked?ErrorORM
- 【ERROR】OPatch failed with error code 73ErrorAI
- Ksvcreate:Process(xx) Creation Failed/ORA-00445:Background Process "xx"AI
- httpd: apr_sockaddr_info_get() failed for bogonhttpdAIGo
- Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the processErrorExceptionAI
- [ERROR] Failed to open logErrorAI
- ksvcreate: Process(m000) creation failedAI
- VM啟動報:failed to launch peer processAI
- httpd 一鍵編譯安裝指令碼(centos6&7_httpd2.2&2.4)httpd編譯指令碼CentOS
- OPatch failed with error code 73AIError
- Dynamics CRM the field cannot be deleted because it is used in one or more process的解決方法delete
- httpd-2.4 編譯安裝(centos6)httpd編譯CentOS
- Error: failed PB timebomb checkErrorAI
- This application failed to start because it could not find or load the Qt platform plugin “windows“APPAIQTPlatformPluginWindows
- Application failed to start because it could not find or load the QT platform plugin “windows”APPAIQTPlatformPluginWindows
- Error: The action can not be performed because the selected records are not eligibleErrorORM
- ksvcreate: Process(m000) creation failed 處理AI
- Fatal error in launcher: Unable to create process using '"'Error
- Node.js process 模組解讀Node.js
- 【故障處理】ORA-12545: Connect failed because target hostAI
- ORA-12545: Connect failed because target host or object does not existAIObject
- maridb Error 'Operation DROP USER failed forErrorAI
- Opiino: Attach Failed! Error=-1 Ifvp=0AIError
- Sub-process /usr/bin/dpkg returned an error codeError
- [PM2][ERROR] Process XXX not foundError
- 簡單介紹python process模組Python
- Terminated With Error ORA-474: SMON Process Terminated With Error-1361872.1Error
- ORA-27369: job of type EXECUTABLE failed with exit code: Permission deniedAI
- Oracle OCP IZ0-053 Q216(Job Chain Process)OracleAI