Linuxサーバ(CentOS 6.5)Nginxサーバのインストール
2368 ワード
LinuxでのNginxサーバのコンパイルとインストールに必要な条件:
ディスク容量:10 M以上の空き容量は、nginxのインストールが完了すると約4 MB程度のスペースを占め、実際のディスク容量のニーズは、安価な設定とサードパーティモジュールのインストールの有無によって異なります.
依存パッケージのインストール:
gcc#Linuxライセンスソフトウェアインストールコンパイルツール:c、c++、Objective-c、Fortran、Java言語のコンパイルをサポートします.
gcc-c++
Automake#自動作成機能完備のMakefile(コンパイル)
Autoconf#自動作成機能完備のMakefile(構成)
zlib#サードパーティ拡張(gzip)サポート
zlib-devel
Openssl#サードパーティ拡張SSL
openssl-devel
PCre#rewriteモジュールに必要なpcreライブラリサポート
pcre-devel
以下は、これらのライブラリファイルをインストールするLinux shellコマンドです.
インストール前の構成(プロファイルとpidファイルの場所に注意)
次に、コンパイルとインストールを行います.
ディスク容量:10 M以上の空き容量は、nginxのインストールが完了すると約4 MB程度のスペースを占め、実際のディスク容量のニーズは、安価な設定とサードパーティモジュールのインストールの有無によって異なります.
依存パッケージのインストール:
gcc#Linuxライセンスソフトウェアインストールコンパイルツール:c、c++、Objective-c、Fortran、Java言語のコンパイルをサポートします.
gcc-c++
Automake#自動作成機能完備のMakefile(コンパイル)
Autoconf#自動作成機能完備のMakefile(構成)
zlib#サードパーティ拡張(gzip)サポート
zlib-devel
Openssl#サードパーティ拡張SSL
openssl-devel
PCre#rewriteモジュールに必要なpcreライブラリサポート
pcre-devel
以下は、これらのライブラリファイルをインストールするLinux shellコマンドです.
yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel
インストール前の構成(プロファイルとpidファイルの場所に注意)
./configure
--prefix=/usr/local/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/tmp/nginx/client/ \
--http-proxy-temp-path=/var/tmp/nginx/proxy/ \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \
--with-pcre
# , !
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/etc/nginx"
nginx configuration file: "/etc/nginx/nginx.conf"
nginx pid file: "/var/run/nginx/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/tmp/nginx/client/"
nginx http proxy temporary files: "/var/tmp/nginx/proxy/"
nginx http fastcgi temporary files: "/var/tmp/nginx/fcgi/"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
次に、コンパイルとインストールを行います.
make && make install