启动nginx服务
通过systemd启动nginx服务:
systemctl enable nginx
systemctl start nginx
nginx是否启动成功可通过下面命令查看:
systemctl status nginx
- 图1表示nginx服务启动成功
- 若nginx服务启动失败,查看错误信息:
systemctl status nginx.service --full
如图2所示nginx服务创建失败,是由于目录/var/spool/nginx/tmp/client_body创建失败,手动进行创建,类似的问题也这样处理:
mkdir -p /var/spool/nginx/tmp/client_body
mkdir -p /var/spool/nginx/tmp/proxy
mkdir -p /var/spool/nginx/tmp/fastcgi
mkdir -p /usr/share/nginx/uwsgi_temp
mkdir -p /usr/share/nginx/scgi_temp