今注目を集めているWEBサーバーnginxをインストールしてみます。
モジュールの組み込み、取り外しが容易なソースからインストールします。
[root@nginx01 ~]# mkdir /tmp/src
[root@nginx01 ~]# cd /tmp/src
[root@nginx01 src]# wget http://nginx.org/download/nginx-1.9.12.tar.gz
--2016-03-04 17:56:03-- http://nginx.org/download/nginx-1.9.12.tar.gz
nginx.org をDNSに問いあわせています... 206.251.255.63, 95.211.80.227, 2606:7100:1:69::3f, ...
nginx.org|206.251.255.63|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 899183 (878K) [application/octet-stream]
`nginx-1.9.12.tar.gz' に保存中
100%[======================================>] 899,183 903K/s 時間 1.0s
2016-03-04 17:56:04 (903 KB/s) - `nginx-1.9.12.tar.gz' へ保存完了 [899183/899183]
[root@nginx01 src]# tar zxvf nginx-1.9.12.tar.gz
公式サイトよりソースをダウンロードして展開します。
[root@nginx01 src]# cd nginx-1.9.12
[root@nginx01 nginx-1.9.12]# useradd -M -s /sbin/nologin nginx
[root@nginx01 nginx-1.9.12]# id nginx
uid=500(nginx) gid=500(nginx) 所属グループ=500(nginx)
[root@nginx01 nginx-1.9.12]# yum install pcre pcre-devel openssl openssl-devel
nginxユーザーの作成、必要モジュールのインストールを行ないます。
[root@nginx01 nginx-1.9.12]# ./configure \
> --user=nginx \
> --group=nginx \
> --prefix=/etc/nginx/ \
> --sbin-path=/usr/sbin/nginx \
> --conf-path=/etc/nginx/nginx.conf \
> --error-log-path=/var/log/nginx/error.log \
> --pid-path=/var/run/nginx.pid \
> --lock-path=/var/run/nginx.lock \
> --http-log-path=/var/log/nginx/access.log \
> --http-client-body-temp-path=/var/cache/nginx/client_temp \
> --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
> --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
> --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
> --http-scgi-temp-path=/var/cache/nginx/scgi_temp \
> --with-http_ssl_module \
> --with-http_realip_module
・
・
・
nginx path prefix: "/etc/nginx/"
nginx binary file: "/usr/sbin/nginx"
nginx modules path: "/etc/nginx//modules"
nginx configuration prefix: "/etc/nginx"
nginx configuration file: "/etc/nginx/nginx.conf"
nginx pid file: "/var/run/nginx.pid"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/var/cache/nginx/client_temp"
nginx http proxy temporary files: "/var/cache/nginx/proxy_temp"
nginx http fastcgi temporary files: "/var/cache/nginx/fastcgi_temp"
nginx http uwsgi temporary files: "/var/cache/nginx/uwsgi_temp"
nginx http scgi temporary files: "/var/cache/nginx/scgi_temp"
[root@nginx01 nginx-1.9.12]# make
[root@nginx01 nginx-1.9.12]# make install
ソースのコンパイル、インストールを行ないます。
configure時に必要なモジュールを組み込んでいます。
[root@nginx01 ~]# nginx -V
nginx version: nginx/1.9.12
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --user=nginx --group=nginx --prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --with-http_ssl_module --with-http_realip_module
インストール確認のためにバージョンの確認を行ないます。
[root@nginx01 ~]# ps aux | grep [n]ginx
[root@nginx01 ~]# nginx
[root@nginx01 ~]# ps aux | grep [n]ginx
root 5676 0.0 0.0 44652 1068 ? Ss 18:18 0:00 nginx: master process nginx
nginx 5677 0.0 0.0 45068 1640 ? S 18:18 0:00 nginx: worker process
プロセスを起動します。
起動後、WEBブラウザでサーバーにアクセスし、上記画面が表示されることを確認します。
モジュールの組み込み、取り外しが容易なソースからインストールします。
[root@nginx01 ~]# mkdir /tmp/src
[root@nginx01 ~]# cd /tmp/src
[root@nginx01 src]# wget http://nginx.org/download/nginx-1.9.12.tar.gz
--2016-03-04 17:56:03-- http://nginx.org/download/nginx-1.9.12.tar.gz
nginx.org をDNSに問いあわせています... 206.251.255.63, 95.211.80.227, 2606:7100:1:69::3f, ...
nginx.org|206.251.255.63|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 899183 (878K) [application/octet-stream]
`nginx-1.9.12.tar.gz' に保存中
100%[======================================>] 899,183 903K/s 時間 1.0s
2016-03-04 17:56:04 (903 KB/s) - `nginx-1.9.12.tar.gz' へ保存完了 [899183/899183]
[root@nginx01 src]# tar zxvf nginx-1.9.12.tar.gz
公式サイトよりソースをダウンロードして展開します。
[root@nginx01 src]# cd nginx-1.9.12
[root@nginx01 nginx-1.9.12]# useradd -M -s /sbin/nologin nginx
[root@nginx01 nginx-1.9.12]# id nginx
uid=500(nginx) gid=500(nginx) 所属グループ=500(nginx)
[root@nginx01 nginx-1.9.12]# yum install pcre pcre-devel openssl openssl-devel
nginxユーザーの作成、必要モジュールのインストールを行ないます。
[root@nginx01 nginx-1.9.12]# ./configure \
> --user=nginx \
> --group=nginx \
> --prefix=/etc/nginx/ \
> --sbin-path=/usr/sbin/nginx \
> --conf-path=/etc/nginx/nginx.conf \
> --error-log-path=/var/log/nginx/error.log \
> --pid-path=/var/run/nginx.pid \
> --lock-path=/var/run/nginx.lock \
> --http-log-path=/var/log/nginx/access.log \
> --http-client-body-temp-path=/var/cache/nginx/client_temp \
> --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
> --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
> --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
> --http-scgi-temp-path=/var/cache/nginx/scgi_temp \
> --with-http_ssl_module \
> --with-http_realip_module
・
・
・
nginx path prefix: "/etc/nginx/"
nginx binary file: "/usr/sbin/nginx"
nginx modules path: "/etc/nginx//modules"
nginx configuration prefix: "/etc/nginx"
nginx configuration file: "/etc/nginx/nginx.conf"
nginx pid file: "/var/run/nginx.pid"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/var/cache/nginx/client_temp"
nginx http proxy temporary files: "/var/cache/nginx/proxy_temp"
nginx http fastcgi temporary files: "/var/cache/nginx/fastcgi_temp"
nginx http uwsgi temporary files: "/var/cache/nginx/uwsgi_temp"
nginx http scgi temporary files: "/var/cache/nginx/scgi_temp"
[root@nginx01 nginx-1.9.12]# make
[root@nginx01 nginx-1.9.12]# make install
ソースのコンパイル、インストールを行ないます。
configure時に必要なモジュールを組み込んでいます。
[root@nginx01 ~]# nginx -V
nginx version: nginx/1.9.12
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --user=nginx --group=nginx --prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --with-http_ssl_module --with-http_realip_module
インストール確認のためにバージョンの確認を行ないます。
[root@nginx01 ~]# ps aux | grep [n]ginx
[root@nginx01 ~]# nginx
[root@nginx01 ~]# ps aux | grep [n]ginx
root 5676 0.0 0.0 44652 1068 ? Ss 18:18 0:00 nginx: master process nginx
nginx 5677 0.0 0.0 45068 1640 ? S 18:18 0:00 nginx: worker process
プロセスを起動します。
起動後、WEBブラウザでサーバーにアクセスし、上記画面が表示されることを確認します。
コメント