nginx 재 컴 파일 증가 모듈

cd ~/root/nginx
먼저 모듈 소스 패키지 다운로드:
wget -O jemalloc-5.0.1.tar.bz2 http://125.88.182.172:5880/src/jemalloc-5.0.1.tar.bz2

wget -O pcre-$pcre_version.tar.gz http://125.88.182.172:5880/src/pcre-$pcre_version.tar.gz -T 5

wget -O /root/nginx/nginx-$nginxVersion.tar.gz http://125.88.182.172:5880/src/nginx-$nginxVersion.tar.gz -T20

wget -O openssl.tar.gz http://125.88.182.172:5880/src/openssl-1.0.2l.tar.gz -T 5

wget -O ngx_cache_purge.tar.gz http://125.88.182.172:5880/src/ngx_cache_purge-2.3.tar.gz

wget -O /root/nginx/conf/nginx.conf http://125.88.182.172:5880/conf/nginx.conf -T20

wget -O /root/nginx/html/index.html http://125.88.182.172:5880/error/index.html -T 5

wget -O nginx.init http://125.88.182.172:5880/init/nginx.init -T 5

wget -O waf.zip http://125.88.182.172:5880/install/waf/waf.zip

wget -c -O lua-5.3.4.tar.gz http://125.88.182.172:5880/install/src/lua-5.3.4.tar.gz -T 5

wget -c -O LuaJIT-2.0.4.tar.gz http://125.88.182.172:5880/install/src/LuaJIT-2.0.4.tar.gz -T 5

wget -c -O lua-nginx-module-master.zip http://125.88.182.172:5880/install/src/lua-nginx-module-master.zip -T 5

wget -c -O ngx_devel_kit-master.zip http://125.88.182.172:5880/install/src/ngx_devel_kit-master.zip -T 5

wget -c -O lua-nginx-module-master.zip http://125.88.182.172:5880/install/src/lua-nginx-module-master.zip -T 5

wget -c -O ngx_devel_kit-master.zip http://125.88.182.172:5880/install/src/ngx_devel_kit-master.zip -T 5

압축 을 풀 고, 컴 파일 해 야 할 것 은 컴 파일 하고, 필요 하지 않 은 것 은 컴 파일 하지 않 는 다.
tar -xvf jemalloc-5.0.1.tar.bz2

cd jemalloc-5.0.1

./configure

make && make install

ldconfig

cd ..

tar xzf pcre-8.40.tar.gz

yum install libtermcap-devel ncurses-devel libevent-devel readline-devel -y

tar xvf lua-5.3.4.tar.gz

cd lua-5.3.4

make linux

make install

cd ..

tar xvf LuaJIT-2.0.4.tar.gz

cd LuaJIT-2.0.4

make linux

make install

cd ..

export LUAJIT_LIB=/usr/local/lib

export LUAJIT_INC=/usr/local/include/luajit-2.0/

ln -sf /usr/local/lib/libluajit-5.1.so.2 /usr/local/lib64/libluajit-5.1.so.2

echo "/usr/local/lib" >> /etc/ld.so.conf

ldconfig  #

다음은 nginx 를 컴 파일 합 니 다.
cd  nginx-1.12.2

./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/tmp/nginx/client_body --http-proxy-temp-path=/var/nginx/proxy_temp_dir --http-fastcgi-temp-path=/tmp/nginx/fastcgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --add-module=/root/lnmp/ngx_devel_kit-master --add-module=/root/lnmp/lua-nginx-module-master --with-openssl=/root/lnmp/openssl-1.0.2l --with-http_v2_module --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-pcre=/root/lnmp/pcre-8.40 --with-http_realip_module --add-module=/root/lnmp/ngx_cache_purge-2.3 --with-http_gunzip_module --with-stream --with-stream_ssl_module --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_mp4_module --with-ld-opt="-Wl,-E" --with-ld-opt="-ljemalloc"

모듈 만 추가:
make

[root@lnmp nginx-1.12.2]# cp -ar objs/nginx /usr/sbin/nginx

cp: overwrite ‘/usr/sbin/nginx’? y

cp: cannot create regular file ‘/usr/sbin/nginx’: Text file busy

[root@lnmp nginx-1.12.2]# cp /usr/sbin/nginx /usr/sbin/nginxbak

[root@lnmp nginx-1.12.2]# service nginx stop

Stopping nginx (via systemctl): [ OK ]

[root@lnmp nginx-1.12.2]# cp -ar objs/nginx /usr/sbin/nginx

cp: overwrite ‘/usr/sbin/nginx’? y

[root@lnmp nginx-1.12.2]# service nginx start

Starting nginx (via systemctl): [ OK ]
      :

make && make install

안에 있 는 프로필 을 사용 하여 기본 프로필 을 바 꾸 면 됩 니 다.

좋은 웹페이지 즐겨찾기