#在linux系统安装nginx [安装可参考:https://wizardforcel.gitbooks.io/nginx-doc/content/Text/1.3_install.html] 安装 版本 1.下载并解压 tar包 #useradd -s /sbin/nologin nginx #wget #tar -xvf 2.编译安装nginx 注意:nginx 与 apache 有端口冲突!在安装nginx之前应当停掉apache服务 (注意创建nginx用户和指定nginx目录) (1).安装依赖 #yum -y install make gcc gcc-c++ autoconf automake libtool pcre pcre-devel zlib openssl zlib-devel openssl-devel [需要先装pcre,zlib,前者为了重写rewrite,后者为了gzip压缩] (2).编译安装 #cd {path}/nginx-(版本)/ #./configure ....... (可通过 ./configure --help 加载或禁用相应模块) #make && make install 注:编译安装常用模块如下 -http 模块 -http_access_module 模块 -http_auth_basic_module 模块 -http_stub_status_module 模块 -http_log_module 模块 -http_gzip_module 模块 -http_ssl_module 模块 -http_rewrite_module 模块 -http_referer_module 模块 -http_proxy_module 模块 -http_headers_module 模块 -http_fastcgi_module 模块 -http_upstream_module 模块