Nginx インストール · 1 min read · Feb 06, 2026

CentOS 5.5 に SSL、PCRE、GeoIP、Zlib、Gzip、DAV サポート付きの Nginx をインストールする

CentOS 5.5 に SSL、PCRE、GeoIP、Zlib、Gzip、DAV サポート付きの Nginx をインストールする

Nginx (発音は「エンジン エックス」) は、無料でオープンソースの高性能 HTTP サーバーです。Nginx は、その安定性、豊富な機能セット、シンプルな設定、低リソース消費で知られています。このチュートリアルでは、CentOS 5.5 サーバーに SSL、PCRE、GeoIP、Zlib、Gzip、DAV サポート付きの Nginx をコンパイルしてインストールする方法を示します。

私は、これがあなたにとって機能するという保証は一切行いません!

インストール前の準備

まず、次のようにして httpd-devel、pcre、pcre-devel、zlib、zlib-devel、perl、geoip、および geoip-devel パッケージをインストールします:

yum install -y httpd-devel pcre perl pcre-devel zlib zlib-devel GeoIP GeoIP-devel

必要なパッケージのダウンロード

cd
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz
wget http://zlib.net/zlib-1.2.5.tar.gz
wget ftp://ftp.openssl.org/source/openssl-0.9.8o.tar.gz

これらのファイルを解凍する必要があります。

tar -xvf zlib-1.2.5.tar.gz
tar -xvf pcre-8.10.tar.gz
tar -xvf openssl-0.9.8o.tar.gz

Nginx ソースパッケージのダウンロード

Nginx ソースパッケージを http://nginx.org/ からダウンロードする必要があります。

cd
wget http://nginx.org/download/nginx-0.7.67.tar.gz
tar -xvf nginx-0.7.67.tar.gz
cd nginx-0.7.67

Nginx のコンパイルとインストール

次のコマンドを使用して Nginx をコンパイルしてインストールできます:

./configure –user=nginx –group=nginx –prefix=/usr/share/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=/var/lib/nginx/tmp/client_body –http-proxy-temp-path=/var/lib/nginx/tmp/proxy –http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi –pid-path=/var/run/nginx.pid –lock-path=/var/lock/subsys/nginx –with-http_ssl_module –with-http_realip_module –with-http_addition_module –with-http_sub_module –with-http_dav_module –with-http_flv_module –with-http_gzip_static_module –with-http_stub_status_module –with-http_perl_module –with-mail –with-mail_ssl_module –with-cc-opt=’-m32 -march=i386’ –with-openssl=/root/openssl-0.9.8o –with-pcre –with-pcre=/root/pcre-8.10 –with-zlib=/root/zlib-1.2.5 –with-http_geoip_module

次のコマンドを使用して、さらに多くのオプションを見つけることができます:

./configure –help

次に実行します:

make
make install

設定の概要

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"

Nginx サーバーの起動

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

テスト

/usr/local/nginx/sbin/nginx -V

Share: X/Twitter LinkedIn

新しい投稿を受信箱で受け取る

スパムはありません。いつでも購読を解除できます。