![apache2 ubuntu 14.04를 재설치할 때 발생하는 문제](https://rvso.com/image/1083756/apache2%20ubuntu%2014.04%EB%A5%BC%20%EC%9E%AC%EC%84%A4%EC%B9%98%ED%95%A0%20%EB%95%8C%20%EB%B0%9C%EC%83%9D%ED%95%98%EB%8A%94%20%EB%AC%B8%EC%A0%9C.png)
재설치를 하다가 문제가 생겼습니다 apache2
.
나는 사용한다:
sudo apt-get install --reinstall apache2 apache2-bin
그런 다음 이 메시지에 오류가 발생합니다.
/etc/init.d/apache2: 64: .: Can't open /etc/apache2/envvars
/etc/init.d/apache2: 76: .: Can't open /etc/apache2/envvars
ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvarsinvoke-rc.d: initscript apache2, action "restart" failed
나는 이것을 사용하여 제거하려고합니다.
sudo apt-get purge apache2
그 후 다시 설치하려고 합니다. 다음을 사용합니다.
sudo apt-get install apache2
해당 코드를 사용하여 Apache2를 다시 설치하려고 할 때 나타나는 메시지입니다.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
apache2-doc apache2-suexec-pristine apache2-suexec-custom apache2-utils
The following NEW packages will be installed:
apache2
0 upgraded, 1 newly installed, 0 to remove and 405 not upgraded.
Need to get 0 B/87,5 kB of archives.
After this operation, 473 kB of additional disk space will be used.
Selecting previously unselected package apache2.
(Reading database ... 170080 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.7-1ubuntu4.1_amd64.deb ...
Unpacking apache2 (2.4.7-1ubuntu4.1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Setting up apache2 (2.4.7-1ubuntu4.1) ...
Enabling module mpm_event.
cp: cannot stat ‘/usr/share/apache2/default-site/index.html’: No such file or directory
dpkg: error processing package apache2 (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Errors were encountered while processing:
apache2
E: Sub-process /usr/bin/dpkg returned an error code (1)
누군가 이 문제를 해결하도록 도와주실 수 있나요?
답변1
dpkg가 무엇에 대해 불평하는지 알 수 있습니다.
sudo dpkg --configure -a
sudo apt-get install -f
다음 명령을 실행해보십시오
sudo apt-get remove --purge apache2 apache2-utils
그런 다음 실행
sudo apt-get install apache2
답변2
Synaptic Package Manager를 사용해 보십시오:https://apps.ubuntu.com/cat/applications/synaptic/.
패키지를 검색 apache2
하고 "완전 제거" 옵션을 선택하십시오. 구성된 모든 디렉터리와 패키지를 제거해야 합니다 apache2
. 그런 다음 apache2
콘솔을 사용하거나 Synaptic Package Manager에서 패키지를 설치하십시오 .