Linuxでnginx1.2.9インストール、起動停止方法と./configure項目整理

1.pcreのインストール
ダウンロード
http://www.pcre.org/
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.tar.gz

インストール手順
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.tar.gz
# tar zxvf pcre-8.21.tar.gz
# cd pcre-8.21
# ./configure
# make
# sudo make install

gccの確認
[demoserver@dev Server]$ rpm -q gcc
gcc-4.1.2-51.el5

2.nginxのインストール
http://nginx.org/en/download.html
[demoserver@dev opt]tar zxvf nginx-1.2.9.tar.gz
[demoserver@dev opt] cd nginx-1.2.9
[demoserver@dev nginx-1.2.9]$ ./configure –with-http_stub_status_module
[demoserver@dev nginx-1.2.9]$ make install
[demoserver@dev nginx-1.2.9]$ sudo make install

3.nginx起動
[demoserver@dev nginx-1.3.12]$ cd /usr/local/nginx/sbin
[demoserver@dev sbin]$ sudo ./nginx &

4.nginx停止
[demoserver@dev sbin]$ sudo ./nginx -s stop
[demoserver@dev sbin]$ sudo ./nginx -s quit
Nginx -s stop (quick exit)
Nginx -s quit (graceful exit)
Nginx -s reload (changing configuration,start a new worker,quitting an old worker gracefully.)
Nginx -s reopen (reopenging log files)

5../configure
–prefix=<path> – /usr/local/nginx。
–sbin-path=<path> – <prefix>/sbin/nginx。
–conf-path=<path> – <prefix>/conf/nginx.conf。
–pid-path=<path> – <prefix>/logs/nginx.pid。
–lock-path=<path> – nginx.lockのパス
–error-log-path=<path> – <prefix>/logs/error.log。
–http-log-path=<path> – <prefix>/logs/access.log。
–user=<user> – nobody。
–group=<group> – nobody。
–builddir=DIR –
–with-rtsig_module – rtsig
–with-select_module –without-select_module – Whether or not to enable the select module. This module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or /dev/poll is not discovered by configure.
–with-poll_module –without-poll_module – Whether or not to enable the poll module. This module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or /dev/poll is not discovered by configure.
–with-http_ssl_module – Enable ngx_http_ssl_module. Enables SSL support and the ability to handle HTTPS requests. Requires OpenSSL. On Debian, this is libssl-dev.
–with-http_realip_module – ngx_http_realip_module
–with-http_addition_module – ngx_http_addition_module
–with-http_sub_module – ngx_http_sub_module
–with-http_dav_module – ngx_http_dav_module
–with-http_flv_module – ngx_http_flv_module
–with-http_stub_status_module – “server status” 页
–without-http_charset_module – ngx_http_charset_module
–without-http_gzip_module – ngx_http_gzip_module 。
–without-http_ssi_module – ngx_http_ssi_module
–without-http_userid_module – ngx_http_userid_module
–without-http_access_module – ngx_http_access_module
–without-http_auth_basic_module – ngx_http_auth_basic_module
–without-http_autoindex_module – ngx_http_autoindex_module
–without-http_geo_module – ngx_http_geo_module
–without-http_map_module -ngx_http_map_module
–without-http_referer_module – ngx_http_referer_module
–without-http_rewrite_module – ngx_http_rewrite_module.
–without-http_proxy_module – ngx_http_proxy_module
–without-http_fastcgi_module – ngx_http_fastcgi_module
–without-http_memcached_module – ngx_http_memcached_module
–without-http_limit_zone_module – ngx_http_limit_zone_module
–without-http_empty_gif_module – ngx_http_empty_gif_module
–without-http_browser_module – ngx_http_browser_module
–without-http_upstream_ip_hash_module – ngx_http_upstream_ip_hash_module
–with-http_perl_module – ngx_http_perl_module
–with-perl_modules_path=PATH – perlのパス
–with-perl=PATH – perl実行ファイルのパス
–http-log-path=PATH – Set path to the http access log
–http-client-body-temp-path=PATH – Set path to the http client request body temporary files
–http-proxy-temp-path=PATH – Set path to the http proxy temporary files
–http-fastcgi-temp-path=PATH – Set path to the http fastcgi temporary files
–without-http -HTTP server
–with-mail – IMAP4/POP3/SMTP
–with-mail_ssl_module – ngx_mail_ssl_module
–with-cc=PATH –
–with-cpp=PATH –
–with-cc-opt=OPTIONS – Additional parameters which will be added to the variable CFLAGS. With the use of the system library PCRE in FreeBSD, it is necessary to indicate –with-cc-opt=”-I /usr/local/include”. If we are using select() and it is necessary to increase the number of file descriptors, then this also can be assigned here: –with-cc-opt=”-D FD_SETSIZE=2048″.
–with-ld-opt=OPTIONS – Additional parameters passed to the linker. With the use of the system library PCRE in FreeBSD, it is necessary to indicate –with-ld-opt=”-L /usr/local/lib”.
–with-cpu-opt=CPU – pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64
–without-pcre – PCRE
–with-pcre=DIR –
–with-pcre-opt=OPTIONS – Set additional options for PCRE building.
–with-md5=DIR – Set path to md5 library sources.
–with-md5-opt=OPTIONS – Set additional options for md5 building.
–with-md5-asm – Use md5 assembler sources.
–with-sha1=DIR – Set path to sha1 library sources.
–with-sha1-opt=OPTIONS – Set additional options for sha1 building.
–with-sha1-asm – Use sha1 assembler sources.
–with-zlib=DIR – Set path to zlib library sources.
–with-zlib-opt=OPTIONS – Set additional options for zlib building.
–with-zlib-asm=CPU – Use zlib assembler sources optimized for specified CPU, valid values are: pentium, pentiumpro
–with-openssl=DIR – Set path to OpenSSL library sources
–with-openssl-opt=OPTIONS – Set additional options for OpenSSL building
–with-debug –
–add-module=PATH – Add in a third-party module found in directory PATH

6.nginxアンインストール
/usr/local/nginxを削除

Comments are closed.