컴 파일 설치 Ningx 1.10.2

1779 단어
1. nginx, pcre, zlib, openssl 다운로드
# wget http://nginx.org/download/nginx-1.10.2.tar.gz
# wget https://ftp.pcre.org/pub/pcre/pcre-8.38.tar.gz
# wget https://ncu.dl.sourceforge.net/project/libpng/zlib/1.2.10/zlib-1.2.10.tar.gz
# wget http://distfiles.macports.org/openssl/openssl-1.0.2h.tar.gz

2. 압축 해제 *. tar. gz 파일
# tar -zxvf .tar.gz

3. 컴 파일, 설치, 시작
# ./configure --prefix=/usr/local/nginx --with-pcre=/root/softs/pcre-8.38 --with-zlib=/root/softs/zlib-1.2.10 --with-openssl=/root/softs/openssl-1.0.2h

# make && make install

# nginx

4. nginx 설정 (nginx 사용자 와 그룹 이 있 는 경우)
# cd /usr/local/nginx
# mkdir -p /usr/local/nginx/conf/conf.d
# vim conf/nginx.conf
---------------------------------
user nginx;
worker_processes auto;
error_log /data/log/nginx/error.log;
pid /var/run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections  1024;
}
http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  /data/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /usr/local/nginx/conf/mime.types;
    default_type        application/octet-stream;
    include /usr/local/nginx/conf.d/*.conf;
}

좋은 웹페이지 즐겨찾기