1年以上前に更新された記事です。
情報が古い可能性がありますので、注意してください。
情報が古い可能性がありますので、注意してください。
apt-getでインストールがお手軽で簡単だが、バージョンが古いのでソースからインストールする。
新バージョンのダウンロードとコンパイル
configure のパラメータは現バージョンと同じ。
$ cd /opt $ sudo wget https://nginx.org/download/nginx-1.10.1.tar.gz $ sudo tar zxvf nginx-1.10.1.tar.gz $ cd nginx-1.10.1 $ sudo ./configure --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' \ --with-ld-opt=-Wl,-z,relro \ --prefix=/usr/share/nginx \ --sbin-path=/sbin/nginx \ --conf-path=/etc/nginx/nginx.conf \ --http-log-path=/var/log/nginx/access.log \ --error-log-path=/var/log/nginx/error.log \ --lock-path=/var/lock/nginx.lock \ --pid-path=/run/nginx.pid \ --http-client-body-temp-path=/var/lib/nginx/body \ --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ --http-proxy-temp-path=/var/lib/nginx/proxy \ --http-scgi-temp-path=/var/lib/nginx/scgi \ --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ --with-debug \ --with-pcre-jit \ --with-ipv6 \ --with-http_ssl_module \ --with-http_stub_status_module \ --with-http_realip_module \ --with-http_auth_request_module \ --with-http_addition_module \ --with-http_dav_module \ --with-http_geoip_module \ --with-http_gzip_static_module \ --with-http_image_filter_module \ --with-http_v2_module \ --with-http_sub_module \ --with-http_xslt_module $ sudo make
パッケージ作成
$ sudo checkinstall --install=no checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran このソフトウェアはGNU GPLの下でリリースしています。 The package documentation directory ./doc-pak does not exist. Should I create a default set of package docs? [y]: y パッケージのドキュメンテーションを準備..OK このパッケージの説明を書いてください 説明の末尾は空行かEOFにしてください。 >>(エンター) ***************************************** **** Debian package creation selected *** ***************************************** このパッケージは以下の内容で構成されます: 0 - Maintainer: [ root@raspberrypi3 ] 1 - Summary: [ Package created with checkinstall 1.6.2 ] 2 - Name: [ nginx ] 3 - Version: [ 1.10.1 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ armhf ] 8 - Source location: [ nginx-1.10.1 ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ nginx ] 12 - Conflicts: [ ] 13 - Replaces: [ ] 変更するものの番号を入力してください。Enterで続行します:(エンター)
インストール
dpkgでインストールしたら設定ファイルが消えてしまった…
設定ファイルのバックアップをとってアップデートする。
設定ファイルのバックアップをとってアップデートする。
$ sudo dpkg -i nginx_1.10.1-1_armhf.deb
確認
$ /sbin/nginx -v nginx version: nginx/1.10.1
Nginx再起動
$ sudo service nginx restart
コメントを残す