欢迎光临散文网 会员登陆 & 注册

linux安装nginx以及报错处理Job for nginx.service failed because the contr

2023-06-09 08:52 作者:movno1  | 我要投稿

一、安装nginx

sudo yum install nginx -y


二、设置开机启动

sudo systemctl enable nginx

三、启动nginx

sudo systemctl start nginx

————————————

扩展命令

systemctl stop nginx

systemctl reload nginx

systemctl status nginx

——————————————


四、打开防火墙

sudo firewall-cmd --permanent --zone=public --add-service=http

sudo firewall-cmd --permanent --zone=public --add-service=https

sudo firewall-cmd --reload

————————————————

拓展命令

systemctl status firewalld

systemctl stop firewalld

systemctl start firewalld

systemctl enable firewalld
——————————————————


五、开始配置nginx



六、配置完nginx后如果无法启动,开始下面的内容

Job for nginx.service failed because the control process exited with error code.

See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.

(说明一下,如果还是无法启动,可以通过这个命令查一下具体是什么原因:systemctl status nginx -l


安装工具

sudo yum install selinux-policy-devel -y

开启 HTTP 访问。

sudo setsebool -P httpd_can_network_connect 1

sudo ausearch -c 'nginx' --raw | audit2allow -M my-nginx

sudo semodule -i my-nginx.pp


linux安装nginx以及报错处理Job for nginx.service failed because the contr的评论 (共 条)

分享到微博请遵守国家法律