- Plesk for Linux
Note: The article is applicable only to RHEL-based operating systems (CentOS, Red Hat Enterprise Linux, CloudLinux).
Apache fails to start:
# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not open configuration file /etc/httpd/conf/httpd.conf: No such file or directory
# systemctl status httpd.service
plesk.example.com systemd: Starting The Apache HTTP Server...
plesk.example.com httpd: httpd: Could not open configuration file /etc/httpd/conf/httpd.conf: No such file or directory
The file from the error message
/etc/httpd/conf/httpd.conf exists in another directory along with all other Apache configuration files:
# locate /etc/httpd/conf/httpd.conf
# locate httpd.conf
Apache configuration files are located in the incorrect directory.
Connect to the server using SSH.
Back up the existing directory
# mv /etc/httpd /etc/httpd_bak
Rename the directory that contains
httpd.confto the original name
# mv /etc/httpd.new /etc/httpd
Set correct permissions and ownership:
# chmod 755 /etc/httpd && chown root:root /etc/httpd
# chmod 755 /etc/httpd/conf && chown root:root /etc/httpd/conf
# chmod 644 /etc/httpd/conf/httpd.conf && chown root:root /etc/httpd/conf/httpd.conf
# service httpd start