2010年2月14日日曜日

nginx configureメモ

作業用PCのHDDが吹っ飛んだりしてメモが消えることがあったので
Bloggerに記録…

XEON E5520用
-march=nehalem、-msse4.1は使えなかった(gcc 4.1.2の為…)
-march=noconaとしてコンパイルしておく
2010-05-13
試しにgcc44,gcc44-c++をインストールしたので修正
-march=nativeで実施
→-march=core2 -mcx16 -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=256 -mtune=core2
 として展開される
2011-05-21
SL6.0となり標準でgcc44へ
nginx-1.0となったので更新
2014-04-25
nginx-1.6となったので更新
2014-12-21
LibreSSLを利用する方法へ変更 
なお、この方法でLibreSSL2.1.2を利用した場合、失敗する
2015-02-17
nginx 1.7.10&LibreSSL2.1.3で実施した所、簡易に実行できることが判明したため改版
(途中でファイルの移動などが必要だったものが不要に)

改訂版 新卒ネットワークエンジニア
nginx+PHP-FPMでどこまでチューニングできるか
http://blog.kubox.info/?p=175
この記事が非常によさげ

ngx_pagespeed
https://github.com/pagespeed/ngx_pagespeed

------------------------------------------------------------
# LibreSSL
cd /usr/local/src
wget http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.1.3.tar.gz

tar xvf libressl-2.1.3.tar.gz && cd libressl-2.1.3
CFLAGS="-march=native -O2 -m64 -pipe -fomit-frame-pointer -mfpmath=sse -msse4 -msse4.1 -msse4.2" \
CXXFLAGS="-march=native -O2 -m64 -pipe -fomit-frame-pointer -mfpmath=sse -msse4 -msse4.1 -msse4.2" \
./configure LDFLAGS=-lrt \
--host=x86_64-redhat-linux-gnu \
--build=x86_64-redhat-linux-gnu \
--target=x86_64-redhat-linux \
--program-prefix= \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib64 \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/usr/com \
--mandir=/usr/share/man \
--infodir=/usr/share/info
make -j4 check
sudo make install

--------------------------------------------------------------
# NGINX

cd /usr/local/src
wget http://nginx.org/download/nginx-1.7.10.tar.gz
tar xvf nginx-1.7.10.tar.gz && cd nginx-1.7.10

CFLAGS="-march=native -O2 -m64 -pipe -fomit-frame-pointer -mmmx -mfpmath=sse -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2" \
CXXFLAGS="-march=native -O2 -m64 -pipe -fomit-frame-pointer -mmmx -mfpmath=sse -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2" \
./configure \
--prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error_log \
--http-log-path=/var/log/nginx/access_log \
--user=nginx \
--group=nginx \
--with-file-aio \
--with-ipv6 \
--with-http_realip_module \
--with-http_addition_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-http_spdy_module \
--with-http_ssl_module \
--with-poll_module \
--with-sha1-asm \
--with-sha1=/usr/include \
--http-client-body-temp-path=/tmp/nginx_client/ \
--http-proxy-temp-path=/tmp/nginx_proxy/ \
--http-fastcgi-temp-path=/tmp/nginx_fcgi/ \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--without-http_uwsgi_module \
--without-http_scgi_module \
--with-openssl=../libressl-2.1.3

make -j4
sudo make install
------------------------------------------------------------
追加 nginx-upload-module http://www.grid.net.ru/nginx/upload.en.html
--add-module=/usr/local/src/nginx_upload_module-2.2.0
追加 nginx-upload-progress-module
 http://wiki.nginx.org/HttpUploadProgressModule
--add-module=/usr/local/src/nginx-upload-module

NginxHttpUploadModuleを追加
git://github.com/vkholodkov/nginx-upload-module.git

------------------------------------------------------------

+NginxHttpUploadProgressModuleを追加
git clone https://github.com/masterzen/nginx-upload-progress-module.git

NGINXの./configure時に追加
--add-module=/usr/local/src/nginx-upload-progress-module

------------------------------------------------------------

1 件のコメント :

G2 さんのコメント...

openssl ecparam -name secp521r1 -genkey -out server.key
openssl req -new -sha256 -key server.key -out server.csr
openssl req -x509 -nodes -sha256 -days 3650 -in server.csr -key server.key -out server.crt