From 99097d168382c439989ae98e7f7ac8ea4ba6695f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=AC=A3?= <12078128+rainbow-meet-rose-die@user.noreply.gitee.com> Date: Tue, 25 Jun 2024 04:57:54 +0000 Subject: [PATCH] =?UTF-8?q?=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李欣 <12078128+rainbow-meet-rose-die@user.noreply.gitee.com> --- ...15\345\212\241\347\256\241\347\220\206.md" | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 "51 \346\235\216\346\254\243/20240624\346\234\215\345\212\241\347\256\241\347\220\206.md" diff --git "a/51 \346\235\216\346\254\243/20240624\346\234\215\345\212\241\347\256\241\347\220\206.md" "b/51 \346\235\216\346\254\243/20240624\346\234\215\345\212\241\347\256\241\347\220\206.md" new file mode 100644 index 0000000..55e7dcc --- /dev/null +++ "b/51 \346\235\216\346\254\243/20240624\346\234\215\345\212\241\347\256\241\347\220\206.md" @@ -0,0 +1,49 @@ +### 服务管理 + +service nginx start + +system v 用 /etc/init.d/nginx start 实现 + +systemd 用 systemctl nginx start 实现 + +早期 linux /etc/init.d/ 服务名 service 服务名 操作命令 + +现今 linux systemctl 操作命令 服务名 + +#### 操作命令 + +start 启用 + +stop 停止 + +restart 重启 + +reload 重加配置 + +enable 开机自启用 + +dsable 禁用 + +#### 查看所有运行服务 + +systemctl list -until-files 详细 + +service -status-all 精简 + +### 作业 + +```bash +#安装apache +sudo apt install apache2 +#查看状态 +service --status-all +#停止nginx +sudo systemctl stop nginx.service +#开启apache +sudo systemctl start apache2 +#查看apache状态 +sudo systemctl status apache2 + +进入/etc/apache2,里面的ports.conf 和 000-default.conf可改端口,从而让nginx和apache共存 +``` + -- Gitee