[nginx] errorIT/nginx2023. 3. 29. 10:01
Table of Contents
# error
Mar 17 01:35:50 gsitm-bastion setroubleshoot[82865]: SELinux is preventing /usr/sbin/nginx from read access on the file ... For complete SELinux messages run: sealert -l fe2a>
Mar 17 01:35:50 gsitm-bastion setroubleshoot[82865]: SELinux is preventing /usr/sbin/nginx from read access on the file ...
***** Plugin catchall (100. confidence) suggests **************************
If you believe that nginx should be allowed read access on the ... file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'nginx' --raw | audit2allow -M my-nginx
# semodule -X 300 -i my-nginx.pp
# 임시 조치
# check value
[root@localhost ~]# getenforce
Permissive, enforcing, disabled
[root@localhost ~]# settenforce 0
# 영구
vi /etc/sysconfig/selinux
SELINUX=disabled
reboot
# error
[root@localhost ~]# systemctl status nginx
● nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2023-03-21 21:55:28 KST; 14min ago
Docs: http://nginx.org/en/docs/
Process: 81278 ExecStop=/bin/sh -c /bin/kill -s TERM $(/bin/cat /var/run/nginx.pid) (code=exited, status=1/FAILURE)
Process: 97938 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
Main PID: 81252 (code=exited, status=0/SUCCESS)
Mar 21 21:55:27 web-1 nginx[97938]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Mar 21 21:55:27 web-1 nginx[97938]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Mar 21 21:55:27 web-1 nginx[97938]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Mar 21 21:55:27 web-1 nginx[97938]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Mar 21 21:55:28 web-1 nginx[97938]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
Mar 21 21:55:28 web-1 nginx[97938]: nginx: [emerg] bind() to [::]:443 failed (98: Address already in use)
Mar 21 21:55:28 web-1 nginx[97938]: nginx: [emerg] still could not bind()
Mar 21 21:55:28 web-1 systemd[1]: nginx.service: Control process exited, code=exited status=1
Mar 21 21:55:28 web-1 systemd[1]: nginx.service: Failed with result 'exit-code'.
Mar 21 21:55:28 web-1 systemd[1]: Failed to start nginx - high performance web server.
[root@localhost ~]# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1073/sshd
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 97654/nginx: master
tcp 0 196 10.117.1.15:22 10.117.1.30:37390 ESTABLISHED 97804/sshd: gsitm-p
tcp6 0 0 :::22 :::* LISTEN 1073/sshd
tcp6 0 0 :::443 :::* LISTEN 97654/nginx: master
[root@localhost ~]# ps -ef | egrep nginx
root 97654 1 0 17:46 ? 00:00:00 nginx: master process nginx
nginx 97655 97654 0 17:46 ? 00:00:00 nginx: worker process
nginx 97656 97654 0 17:46 ? 00:00:00 nginx: worker process
root 98243 97838 0 22:08 pts/0 00:00:00 grep -E --color=auto nginx
[root@localhost ~]# kill -9 97654
[root@localhost ~]# kill -9 97655
[root@localhost ~]# kill -9 97656
[root@localhost ~]# ps -ef | egrep nginx
root 98251 97838 0 22:09 pts/0 00:00:00 grep -E --color=auto nginx
[root@localhost ~]# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1073/sshd
tcp6 0 0 :::22 :::* LISTEN 1073/sshd
[root@localhost ~]# systemctl restart nginx
'IT > nginx' 카테고리의 다른 글
[nginx] conf (0) | 2023.03.29 |
---|
@주니- :: 주니
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!