0

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 apache2sudo /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スペースのみを要求するのは正常ですか?

4

3 に答える 3

6

最初に 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
于 2013-09-29T17:03:50.963 に答える