logo

该视频仅会员有权观看

立即开通课程「Node 框架 Express 实践」权限。

¥
199
/ 年

熟悉管理系统里的服务

  • 在SDS操作系统中,可使用systemctl工具来管理服务,如启动、停止、重启、重载服务及查看状态。
  • 使用包管理工具安装nginx,一个web服务器,命令为sudo dnf install nginx -y
  • 安装后,用systemctl start命令启动nginx。
  • 查看nginx的状态用systemctl status nginx,运行中状态表示为active (running)
  • 停止服务使用systemctl stop nginx,再次查看状态会显示inactive (dead)
  • 修改nginx配置文件,在/etc/nginx/nginx.conf中更改user指令后,保存退出。
  • 为使配置生效,需使用systemctl reload nginx重载服务。
  • 确认nginx工作进程(worker process)现在运行在新用户下。
  • 如需移除nginx,使用命令sudo dnf remove nginx -y