Issue
I'm running few things on CentOS 7. Everything was working fine until full update with yum update
. Can't launch Apache since.
I tried everything including removing and reinstalling httpd.
The error I'm getting is this:
**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 Thu 2020-07-09 20:50:18 CEST; 34min ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 5785 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 5785 (code=exited, status=1/FAILURE)
Jul 09 20:50:18 vps.xyz.com systemd[1]: Starting The Apache HTTP Server...
Jul 09 20:50:18 vps.xyz.com httpd[5785]: [Thu Jul 09 20:50:18.618214 2020] [so:warn] [pid 5785] AH01574: module systemd_module is already ...skipping
Jul 09 20:50:18 vps.xyz.com httpd[5785]: AH00526: Syntax error on line 1 of /etc/httpd/conf/httpd.conf:
Jul 09 20:50:18 vps.xyz.com httpd[5785]: Invalid command '\xef\xbb\xbfServerRoot', perhaps misspelled or defined by a module not included ...guration
Jul 09 20:50:18 vps.xyz.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jul 09 20:50:18 vps.xyz.com systemd[1]: Failed to start The Apache HTTP Server.
Jul 09 20:50:18 vps.xyz.com systemd[1]: Unit httpd.service entered failed state.
Jul 09 20:50:18 vps.xyz.com systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
It doesn't matter how I edit httpd.conf, it always shows me the same \xef\xbb\xbf error.
Solution
Looks like an encoding issue. Could you please encoding type of httpd.conf file. It should be UTF-8 Unicode text
file httpd.conf
i.e
[test@test bin]# file /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf: UTF-8 Unicode text
On Notepad++ you can use the Encoding -> Encode in UTF-8 without BOM option to remove it
Answered By - Pandurang Answer Checked By - Terry (WPSolving Volunteer)