Back

Uninstall Apache Advanced Edition

Apache2 is installed by default. Now uninstall this service.

Featured image of post Uninstall Apache Advanced Edition

Table of contents

# Uninstall Apache Advanced Edition

TL;DR / [Geek Summary]:

  • Clean Slate: Completely purge redundant Apache2 services to reclaim occupied port 80/443 resources.
  • Deep Scrub: Use apt-get --purge to wipe binaries/configs and find | xargs rm to hunt down and eliminate lingering fragments.
  • Geek Goal: Clear the deck for Nginx or custom web stacks, keeping your server environment lightweight and manageable.

# Delete apache

Apache2 is installed by default. Now uninstall this service.

# 1. Find web services

Use the following command:

dpkg -l | grep apache2

# 2. Delete apache2

The deletion command is as follows:

apt-get --purge remove apache2

apt-get --purge remove apache2-doc

apt-get --purge remove apache2-utils

apt-get --purge remove apache2-bin

apt-get --purge remove apache2-data

# 3. Delete redundant files

After the above execution, execute the following command:

find /etc -name "apache" |xargs rm -rf

rm -rf /var/www

rm -rf /etc/libapache2-mod-jk

# 4. Finally

Port 80 is released, no problem.

转载需要保留原始链接,未经明确许可,禁止商业使用。CC BY-NC-SA 4.0

Last updated on 2026-05-19 17:43 UTC