● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2019-05-27 15:26:18 KST; 37ms ago Process: 4183 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
5월 27 15:26:18 ns systemd[1]: Starting The Apache HTTP Server... 5월 27 15:26:18 ns apachectl[4183]: apache2: Could not open configuration file /etc/apache2/apache2.conf: No such file or directory 5월 27 15:26:18 ns apachectl[4183]: Action 'start' failed. 5월 27 15:26:18 ns apachectl[4183]: The Apache error log may have more information. 5월 27 15:26:18 ns systemd[1]: apache2.service: Control process exited, code=exited status=1 5월 27 15:26:18 ns systemd[1]: Failed to start The Apache HTTP Server. 5월 27 15:26:18 ns systemd[1]: apache2.service: Unit entered failed state. 5월 27 15:26:18 ns systemd[1]: apache2.service: Failed with result 'exit-code'.
이런경우, 삭제 후 재설치 해야 하는데, 그 방법도 단순히 apt-get install, apt-get remove 로는 되지 않습니다.
The problem is because some configuration files are deleted, you have to reinstall it.
REINSTALL APACHE2:
To replace configuration files that have been deleted, without purging the package, you can do:
To fully remove the apache2 config files, you should:
sudo apt-get purge apache2
which will then let you reinstall it in the usual way with:
sudo apt-get install apache2
Purge is required to remove all the config files - if you delete the config files but only remove the package, then this is remembered & missing config files are not reinstalled by default.