CentOS 7 에 Nginx 1.10.1 을 설치 합 니 다.

2586 단어
  • cd /usr/local
  • GCC 와 GCC - C + + 설치
  •     yum install gcc
        yum install -y gcc gcc-c++
    
  • pcre 라 이브 러 리 설치
  • cd /usr/local/
    wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
    tar -zxvf pcre-8.39.tar.gz
    cd pcre-8.39/
    ./configure
    make
    make install
    
  • zlib 라 이브 러 리 설치
  • cd /usr/local/ 
    wget http://zlib.net/zlib-1.2.8.tar.gz
    tar -zxvf zlib-1.2.8.tar.gz
    cd zlib-1.2.8/
    ./configure
    make
    make install
    
  • ssl 설치
  • cd /usr/local/
    wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
    tar -zxvf openssl-1.0.1c.tar.gz
    cd openssl-1.0.1c
    ./config
    make
    make install
    

    위의 조작 에 따라 openssl 이 잘못 보 고 했 습 니 다. 저 는 openssl yum -y install openssl openssl-devel 을 다시 업 데 이 트 했 습 니 다.
  • nginx 설치
  • cd /usr/local/
    wget http://nginx.org/download/nginx-1.10.1.tar.gz
    tar -zxvf nginx-1.10.1.tar.gz
    cd nginx-1.10.1/
    

    뉴스 를 지원 하기 위해 서 - with - stream - with - stream 을 추 가 했 습 니 다.ssl_module
    ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-stream --with-stream_ssl_module --with-http_flv_module --with-http_mp4_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy/ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre=/usr/local/pcre-8.39 --with-zlib=/usr/local/zlib-1.2.8
    
    make
    make install
    
  • nginx /usr/local/nginx/sbin/nginx 시작
  • nginx: [emerg] getpwnam ("nginx") 이 다음 두 줄 을 실행 하지 못 하면
    useradd -s /sbin/nologin -M nginx
    id nginx
    

    uid = 1000 (nginx) gid = 1000 (nginx) 그룹 = 1000 (nginx) 그룹 이 나타 날 것 같 습 니 다.
    nginx: [emerg] mkdir () "/ var / tmp / nginx / client /" failed (2: No such file or directory) 다음 두 줄 을 실행 합 니 다.
    cd /var/tmp/
    mkdir -p /var/tmp/nginx/{client,proxy,fastcgi,uwsgi,scgi}
    

    다시 한 번 아무런 힌트 없 이 성공 을 표시 합 니 다 /usr/local/nginx/sbin/nginx
  • 입력http://localhost/

  • 주: 설정 파일 은 / etc / nginx / nginx. conf 에 있 습 니 다.

    좋은 웹페이지 즐겨찾기