LoginSignup
1
3

More than 5 years have passed since last update.

nginx ソースコードからのインストール

Last updated at Posted at 2017-02-24

Apacheとの違い、拡張モジュールを動的に組み込めない

  • Mainline,Stable
    • 新機能の追加やバグは最初にMainlineに対して行われ、その後、Stable版にバックポート

環境

  • CentOS 7

インストール

# yum install -y pcre zlib openssl
# yum install geoip*
# cd /usr/local/src/
# wget http://nginx.org/download/nginx-1.9.15.tar.gz
# tar xvf nginx-1.9.15.tar.gz
# cd nginx-1.9.15
# ./configure --prefix=/usr/local/nginx --sbin-path=/usr/sbin/nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_geoip_module
# make
# make test
# nginx -v
# mkdir /etc/nginx
# cp /usr/local/src/nginx-1.9.15/conf/nginx.conf /etc/nginx/
# vi /etc/nginx/nginx.conf 
/etc/nginx/nginx.conf
location / {
    root   /home/www;
    index  index.html index.htm;
}
# vi /etc/init.d/nginx
# chmod 755 /etc/init.d/nginx 
モジュール名 用途
ngx_http_ssl_module SSLサポート --with-http_ssl_module
ngx_http_v2_module HTTP/2サポート --with-http_v2_module
ngx_http_realip_module リクエスト元IPアドレス --with-http_realip_module
ngx_http_geoip_module 国、地域ごとのIPアドレスをベースにした変数を生成 --with-http_geoip_module

参照

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3