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 docker.service failed because the control process exited with error codeDockerAIError
- 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
- Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the processErrorExceptionAI
- Statistical Process Control in SAP
- CHEE 4703: Process Dynamics and Control
- zsh fg: no job control in this shell.
- 簡單介紹python process模組Python
- Node.js process 模組解讀Node.js
- 【ERROR】OPatch failed with error code 73ErrorAI
- Node.js child_process模組解讀Node.js
- Swoole 中通過 process 模組實現多程式
- OPatch failed with error code 73AIError
- httpd 一鍵編譯安裝指令碼(centos6&7_httpd2.2&2.4)httpd編譯指令碼CentOS
- [PM2][ERROR] Process XXX not foundError
- Fatal error in launcher: Unable to create process using '"'Error
- This application failed to start because it could not find or load the Qt platform plugin “windows“APPAIQTPlatformPluginWindows
- android studio Error:Unable to start the daemon process【轉】AndroidError
- Dynamics CRM the field cannot be deleted because it is used in one or more process的解決方法delete
- Python爬蟲教程-09-error 模組Python爬蟲Error
- httpd-2.4 編譯安裝(centos6)httpd編譯CentOS
- Error:Cannot build artifact xxx:war exploded‘ because it is included into a circular dependencyErrorUI
- [20200416]ORA-01187 cannot read from file because it failed verification tests.AI
- Error: Connection activation failed: Device not managed by NetworkManagerErrorAIdev
- 【AndroidStudio】Error:Execution failed for task ':app:preDebugAndroidTestBuild'.AndroidErrorAIAPPUI
- Sub-process /usr/bin/dpkg returned an error codeError
- CentOS 下重新編譯 nginx 新增模組CentOS編譯Nginx
- Centos下安裝FastDFS及Nginx模組CentOSASTNginx
- ORA-31687: error creating worker process with worker id 1Error
- Git bash Error: Could not fork child process: There are no available terminals (-1)GitErrorAI
- ERROR: Failed to resolve: org.greenrobot:eventbus:2.4.0ErrorAI
- weblogic報錯: OPatch failed with error code 73WebAIError
- FATAL - Fatal error: Target Interaction Manager failed at StartupErrorAI
- ImportError: DLL load failed while importing _cext: 找不到指定的模組ImportErrorAIWhile
- git error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500GitErrorRPCAIHTTP
- WSL:Sub-process /usr/bin/dpkg returned an error code (1)Error