openEuler 2203-LTS 安装nginx 并设置开启自启同时给出详细指令
要在openEuler 22.03-LTS上安装nginx并设置开机自启,可以按照以下步骤进行操作:
- 更新系统软件包列表:
sudo dnf update
- 安装nginx:
sudo dnf install nginx
- 启动nginx服务:
sudo systemctl start nginx
- 设置nginx开机自启:
sudo systemctl enable nginx
- 验证nginx是否已经成功安装并正在运行:
sudo systemctl status nginx
如果nginx已经成功安装并正在运行,你将会看到类似以下的输出:
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2022-11-28 10:23:12 UTC; 5s ago
Docs: http://nginx.org/en/docs/
Process: 12345 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Main PID: 12346 (nginx)
Tasks: 2 (limit: 11509)
Memory: 3.6M
CGroup: /system.slice/nginx.service
├─12346 nginx: master process /usr/sbin/nginx
└─12347 nginx: worker process
现在,nginx已经成功安装并设置为开机自启。你可以通过在Web浏览器中访问服务器的IP地址来验证nginx是否正常工作
原文地址: http://www.cveoy.top/t/topic/hNZy 著作权归作者所有。请勿转载和采集!