본문 바로가기
Tool/WEB,WAS

centos / nginx / install nginx on centos 7

by 하하IT 2019. 4. 10.

yum -y install epel-release                                       


yum -y  install nginx                                              


systemctl start nginx                                          


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


systemctl enable nginx                                         
systemctl restart nginx                                        
                                                               
vi /etc/nginx/nginx.conf                                           
    

 ...

http {

   ################################

   server {

               listen  80;

               server_name  xxxxxxx.test.com;

               location  / {

                       proxy_pass  http://localhost:9090;

               }

            }

   ################################

}

....

 

 

                               
systemctl restart nginx  

 

 

SELinux의 httpd 관련 허용 설정 ( 502 Bad Gateway error )

setsebool -P httpd_can_network_connect on                                  

 

 

CentOS / nginx / Permission Denied  해결방법 

 

[root@nginx audit]# yum install policycoreutils-python

[root@nginx audit]#
[root@nginx audit]#

[root@nginx audit]#sudo cat  /var/log/audit/audit/log  |  grep nginx  | grep denied  | audit2al 

******************* IMPORTANT ***********************

To make this policy package active, execute:

 

semodule -i swnginx.pp

 

[root@nginx audit]# sudo semodule -i swnginx.pp

[root@nginx audit]#

'Tool > WEB,WAS' 카테고리의 다른 글

tomcat / catalina.out / 일자별 log  (0) 2021.10.05
Jboss 7.1.1 as Windows service  (0) 2020.04.27
WAS / jBoss 7.1  (0) 2020.04.24
WAS / jboss 5.1 Administration Console password change  (0) 2020.04.24
nginx default.conf  (0) 2019.04.10