卸载VPS自带的apache2服务
小于 1 分钟
查看 Apache2 服务
$ systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2023-09-29 01:20:34 UTC; 1min 51s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 23223 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 23227 (apache2)
Tasks: 28 (limit: 19660)
Memory: 6.3M
CGroup: /system.slice/apache2.service
├─23227 /usr/sbin/apache2 -k start
└─23228 /usr/sbin/apache2 -k start
Sep 29 01:20:34 5863126759hax.localdomain systemd[1]: Starting The Apache HTTP Server...
Sep 29 01:20:34 5863126759hax.localdomain apachectl[23226]: AH00557: apache2: apr_sockaddr_info_get() failed for 586312>
Sep 29 01:20:34 5863126759hax.localdomain apachectl[23226]: AH00558: apache2: Could not reliably determine the server's>
Sep 29 01:20:34 5863126759hax.localdomain systemd[1]: Started The Apache HTTP Server.停止、禁用
停止Apache2服务:
sudo systemctl stop apache2禁用Apache2的开机自启动:
sudo systemctl disable apache2
卸载、移除
卸载Apache2软件包:
sudo apt-get remove apache2这将会从系统中移除Apache2软件包,但会保留与其相关的配置文件。
如果你希望连同配置文件一起移除,可以使用以下命令:
sudo apt-get purge apache2这将卸载Apache2并删除其配置文件。
