ubuntu20.04自带的apache2占用80端口

前言:

如果有httpd系统自带的apache占了端口则:

先解释一下linux下Apache有个前段管理工具:apachectl,用来管理后台Apache的启动,关闭,还有一些设置,具体通过

apachectl --help

root@telegraf:/usr/share/doc/zabbix-sql-scripts/postgresql# apachectl --help
Usage: /usr/sbin/apachectl start|stop|restart|graceful|graceful-stop|configtest|status|fullstatus|help
       /usr/sbin/apachectl <apache2 args>
       /usr/sbin/apachectl -h            (for help on <apache2 args>)

 

查看用法。

在这里我们可以通过apachectl这个脚本(bash脚本),查看其控制的httpd在哪?

1.先找到apache2

whereis apache2

  1. ps -ef |grep apache

此apache用kill -9 kill不掉 需要改变其端口

 

  1. Whereis apache2
root@gegewu1:/home/gegewu# whereis apache2
apache2: /usr/sbin/apache2 /usr/lib/apache2 /etc/apache2 /usr/share/apache2 /usr/share/man/man8/apache2.8.gz

  1. Cd  /etc/apache2
  2. Vim ports.conf

修改配置文件

 最后:/usr/sbin/apachectl  start|stop|restart|graceful|graceful-stop|configtest|status|fullstatus|help

root@telegraf:/usr/share/doc/zabbix-sql-scripts/postgresql# apachectl --help
Usage: /usr/sbin/apachectl start|stop|restart|graceful|graceful-stop|configtest|status|fullstatus|help
       /usr/sbin/apachectl <apache2 args>
       /usr/sbin/apachectl -h            (for help on <apache2 args>)

查看是否起来:

ss -ntulp |grep 880

 成功!

posted @ 2022-07-06 19:17  GEGEWU-  阅读(528)  评论(0编辑  收藏  举报