diff --git "a/15\345\274\240\346\231\257\346\266\233/2024-6-22-\346\234\215\345\212\241\347\256\241\347\220\206.md" "b/15\345\274\240\346\231\257\346\266\233/2024-6-22-\346\234\215\345\212\241\347\256\241\347\220\206.md" new file mode 100644 index 0000000000000000000000000000000000000000..d9a6064566344fccd5a6f4dc577ed33f5e78976b --- /dev/null +++ "b/15\345\274\240\346\231\257\346\266\233/2024-6-22-\346\234\215\345\212\241\347\256\241\347\220\206.md" @@ -0,0 +1,34 @@ +# 服务管理 + +### 什么是服务 + +服务是程序,后台的运行,响应用户或其他程序的请求,提供某种功能的程序。 + +nginx响应用户的http请求,提供web服务。html mysql响应3306提供数据库服务ssh + + + +### 如何管理服务 + +```bash +1.开启 start +service nginx start || /etc/init.d/nginx start || systemctl start nginx +2.关闭 stop +service httpd stop || systemctl stop httpd.service +3.重启 restart +service httpd restart || systemctl restart httpd.service +4.重新加载配置 reload +service httpd reload || systemctl reload httpd.service +5.查看状态 status +service httpd status || systemctl status httpd.service +6.开机自启动 enable +service httpd enable || systemctl enable httpd.service +``` + +### 如何添加新服务 + +##### 1,新建服务文件 + +##### 2,启动/停止/重启我们的服务 + +##### 3,启用/禁用开机自启 \ No newline at end of file