当前位置: > Linux服务器 > nginx >

Nginx指南

时间:2014-08-23 03:47来源:linux.it.net.cn 作者:it

Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名了。更多的请见官方wiki:http://wiki.nginx.org/Main 。



其优点:

Nginx做为HTTP服务器,有以下几项基本特性:

处理静态文件,索引文件以及自动索引;打开文件描述符缓冲.
无缓存的反向代理加速,简单的负载均衡和容错.


一、依赖的程序

gzip module requires zlib library
rewrite module requires pcre library
ssl support requires openssl library

二、安装

$./configure
$make
$make install
默认安装的路径是/usr/local/nginx
更多的安装配置

$./configure --prefix=/usr/local/nginx
                 --with-openssl=/usr/include (启用ssl)
                 --with-pcre=/usr/include/pcre/ (启用正规表达式)
                 --with-http_stub_status_module (安装可以查看nginx状态的程序)
                 --with-http_memcached_module (启用memcache缓存)
                 --with-http_rewrite_module (启用支持url重写)

三、nginx命令

复制代码
  -?,-h         : this help
  -v            : show version and exit
  -V            : show version and configure options then exit
  -t            : test configuration and exit
  -q            : suppress non-error messages during configuration testing
  -s signal     : send signal to a master process: stop, quit, reopen, reload
  -p prefix     : set prefix path (default: /usr/local/nginx/)
  -c filename   : set configuration file (default: conf/nginx.conf)
  -g directives : set global directives out of configuration file
复制代码


启动:nginx

重启:nginx -s reload

退出:nginx -s quit

测试配置文件:nginx -t

(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容