centos 7 오프라인 구축 nginx 관련 배치 설명

zlib - 1.2.11. tar. gz 압축 해제 설치
    [root@wizesb-test-mng01 java]# cd /data/zlib
    [root@wizesb-test-mng01 zlib]# tar -zxvf zlib-1.2.11.tar.gz 
    [root@wizesb-test-mng01 zlib]# ./configure 

압축 해제 설치 gccdependences.zip
    [root@wizesb-test-mng01 gcc]# cd /data/gcc/
    [root@wizesb-test-mng01 gcc]# rpm -Uvh *.rpm --nodeps --force

압축 해제 설치 nginx - 1.15.7. tar. gz
    [root@wizesb-test-mng01 gcc]# cd nginx/

    [root@wizesb-test-mng01 nginx]# tar zxvf nginx-1.15.7.tar.gz
    [root@wizesb-test-mng01 nginx]# cd nginx-1.15.7
    [root@wizesb-test-mng01 nginx]# ./configure
    [root@wizesb-test-mng01 nginx]# make
    [root@wizesb-test-mng01 nginx]# make install
    //         
    cd /usr/local/nginx
    ./sbin/nginx -t 
    //     
    [root@192 nginx]# ./sbin/nginx -t
    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

    //   nginx
    cd /usr/local/nginx/sbin
    ./nginx   

    //      nginx    
    netstat -ntlp | grep 80


    1、  firewall:
    systemctl stop firewalld.service #  firewall
    systemctl disable firewalld.service #  firewall    
    firewall-cmd --state #         (     notrunning,     running)


      nginx     
    vim /etc/rc.d/rc.local
    /usr/local/nginx/sbin/nginx

     nginx  systemctl

    vi  /usr/lib/systemd/system/nginx.service
    [Unit]
    Description=The nginx HTTP and reverse proxy server
    After=network.target remote-fs.target nss-lookup.target


    [Service]
    Type=forking
    ###   find / -name 'nginx.pid'  pid   
    PIDFile=/usr/local/nginx/logs/nginx.pid    

    # Nginx will fail to start if /run/nginx.pid already exists but has the wrong
    # SELinux context. This might happen when running `nginx -t` from the cmdline.
    # https://bugzilla.redhat.com/show_bug.cgi?id=1268621

    ExecStartPre=/usr/bin/rm -f /usr/local/nginx/logs/nginx.pid
    ExecStartPre=/usr/local/nginx/sbin/nginx -t
    ExecStart=/usr/local/nginx/sbin/nginx
    ExecReload=/bin/kill -s HUP $MAINPID
    KillSignal=SIGQUIT
    TimeoutStopSec=5
    KillMode=process
    PrivateTmp=true

    [Install]
    WantedBy=multi-user.target


    :wq
        
          
    systemctl enable nginx.service
    systemctl  restart nginx
    pkill -9 nginx
    systemctl start nginx.service

          
    ss -lntp | egrep ':80\s'



      vue  
    cd /usr/local/nginx/conf/
    vi nginx.conf

좋은 웹페이지 즐겨찾기