下载页面:http://nginx.org/en/download.html
安装必备工具:
# yum -y install gcc gcc-c++ autoconf automake
# yum -y install zlib zlib-devel openssl openssl-devel pcre-devel
说明:
pcre:
用来作地址重写的功能。
zlib
:nginx 的gzip模块,传输数据打包,省流量(但消耗资源)。
openssl
:提供ssl加密协议。
解压编译:
# tar -zxvf nginx-1.9.2.tar.gz
# cd nginx-1.9.6
# ./configure
安装:
# make && make install
启动:
# ./nginx -c /usr/local/nginx/conf/nginx.conf
检查启动清空:
检测进程
# ps -ef|grep nginx
检测端口
# netstat -nlp|grep 80
如果都没问题就可以访问 http://ip 了