簡體   English   中英

linux下徹底清除apache2

[英]Complete removal of apache2 under linux

我在 ubuntu 下刪除 apache2 時遇到問題。 我試過的是:

sudo apt-get remove apache2
sudo apt-get purge apache2

不幸的是,在任何上級命令之后,仍然有文件:

sudo find / -name "apache2"
/var/log/apache2
/var/lib/update-rc.d/apache2
/var/cache/apache2
/usr/share/doc/apache2.2-common/examples/apache2
/usr/share/apache2
/usr/lib/apache2
/usr/lib/apache2/mpm-event/apache2
/usr/lib/apache2/mpm-itk/apache2
/usr/lib/apache2/mpm-worker/apache2
/usr/lib/apache2/mpm-prefork/apache2
/usr/sbin/apache2
/run/apache2
/run/lock/apache2
/etc/init.d/apache2
/etc/apache2
/etc/cron.daily/apache2
/etc/default/apache2
/etc/logrotate.d/apache2

當我運行sudo /etc/init.d/apache2 start

 * Starting web server apache2                                                                                                                                                                            apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

在瀏覽器中輸入 localhost 后,它會響應:

Forbidden

You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

這些文件會干擾新的 apache 服務器安裝嗎? 我已經檢查了所有內容,但沒有發現任何有趣的內容。

編輯:上面的輸出是在移除服務器之后。 sudo find / -name "apache2"刪除所有文件后,我再次安裝sudo apt-get install apache2 sudo /etc/init.d/apache2輸出:

 * Starting web server apache2                                                                                                                                                                            Segmentation fault
Action 'start' failed.
The Apache error log may have more information.

但是 error.log 和 access.log 是空的。

阿帕奇安裝:

sudo apt-get install apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  apache2-mpm-worker apache2-utils apache2.2-common
Suggested packages:
  apache2-doc apache2-suexec apache2-suexec-custom
The following NEW packages will be installed:
  apache2 apache2-mpm-worker apache2-utils apache2.2-common
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/321 kB of archives.
After this operation, 1,240 kB of additional disk space will be used.
Do you want to continue [Y/n]? 

它只要求1,240 kB空間是否正常?

第一站apache:

sudo service apache2 stop

然后,刪除 apache2 包和依賴項:

sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove --purge

如果您手動修改或安裝了東西,apt 可能不會將其刪除。 檢查剩余的內容:

whereis apache2

查看這些目錄中的內容,如果您確信要刪除它,請手動刪除目錄,如下所示:

sudo rm -Rf /etc/apache2 /usr/lib/apache2 /usr/include/apache2

在此處輸入圖像描述 在此處查看錯誤圖像

從 Ubuntu 中刪除 apache2

從您的本地主機中完全刪除

1st 檢查當前狀態使用

service apache2 status

如果它是活動的(正在運行)寫下一個

sudo apt remove apache2*

使用y說是

祝你有美好的一天:)

以這種方式刪除和安裝 apache2:

  sudo apt-get purge apache2 
  sudo apt-get install apache2 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM