当前位置:Gxlcms >
数据库问题 >
centos7下nginx添加到自定义系统服务中提示Access denied
centos7下nginx添加到自定义系统服务中提示Access denied
时间:2021-07-01 10:21:17
帮助过:24人阅读
=nginx -
high performance web server
Documentation=http:
//nginx.org/en/docs/
After=network.target remote-fs.target nss-
lookup.target
[Service]
Type=forking
PIDFile=/your nginx pid file path/
nginx.pid
ExecStartPre=/your nginx path/sbin/nginx -t -c /your nginx path/conf/
nginx.conf
ExecStart=/your nginx path/sbin/nginx -c /your nginx path/conf/
nginx.conf
ExecReload=/bin/kill -
s HUP $MAINPID
ExecStop=/bin/kill -
s QUIT $MAINPID
PrivateTmp=
true
[Install]
WantedBy=multi-user.target
添加完之后,开启服务
systemctl enable nginx.service
但是提示错误:Access denied
搜了一下原因,是SELinux造成的。解决方案有两种:
一,
systemctl daemon-reexec
二,这种方法会存在安全隐患
setenforce 0
centos7下nginx添加到自定义系统服务中提示Access denied
标签:rman conf type color ble usr multi unit emctl