
다음 명령으로 apache2를 제거했습니다.
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove --purge
이 명령으로 남은 것을 찾았습니다.
whereis apache2
그런 다음 이러한 파일과 디렉터리를 모두 삭제했습니다.
이제 apache2를 설치하고 실행하려고 하면 오류가 발생합니다.
sudo apt install apache2
sudo systemctl start apache2
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
sudo systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2021-10-03 10:34:31 UTC; 2min 38s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 12449 ExecStart=/usr/sbin/apachectl start (code=exited, status=203/EXEC)
Oct 03 10:34:31 machina systemd[1]: Starting The Apache HTTP Server...
Oct 03 10:34:31 machina systemd[12449]: apache2.service: Failed to execute command: No such file or directory
Oct 03 10:34:31 machina systemd[12449]: apache2.service: Failed at step EXEC spawning /usr/sbin/apachectl: No such file or directory
Oct 03 10:34:31 machina systemd[1]: apache2.service: Control process exited, code=exited, status=203/EXEC
Oct 03 10:34:31 machina systemd[1]: apache2.service: Failed with result 'exit-code'.
Oct 03 10:34:31 machina systemd[1]: Failed to start The Apache HTTP Server.
apache2 -v
Server version: Apache/2.4.41 (Ubuntu)
Server built: 2021-09-28T11:00:45
apache2ctl -S
Command 'apache2ctl' not found, but can be installed with:
apt install apache2
Please ask your administrator.
그런 다음 나는 다음을 수행합니다.
sudo apt install apache2
하지만 같은 오류가 발생합니다.
이것을 시도했습니다 :
sudo apt-get --reinstall install apache2-bin
같은 오류입니다.
답변1
이것이 내가 이 문제를 해결한 방법입니다.
먼저 Apache2 서비스를 중지하고 완전히 제거해야 합니다.
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove --purge
이후기계를 다시 시작하세요그런 다음 Apache2를 다시 설치하십시오.
sudo apt install apache2