Ubuntu编译Nginx准备工作# apt-get update
# apt-get install gcc g++ automake libpcre3 libpcre3-dev zlib1g zlib1g.dev openssl libssl-dev
Centos编译Nginx准备工作# yum update
# yum install gcc-c++ zlib zlib-devel openssl openssl-devel pcre pcre-devel
Linux编译Nginx过程# cd /usr/local/
# mkdir nginx_162
# cd nginx_162
# wget http://nginx.org/download/nginx-1.6.2.tar.gz
# tar -xf nginx.tar.gz
# cd nginx.1.6.2
# ./configure --prefix=/usr/local/nginx_162 --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module
//根据自己需要加入对应模块,本文加入ssl模块
# ls -l //查看Makefile文件是否成功
# make //编译
# make install //安装
# ls -l /usr/local/nginx_162 ls //可看到安装后的资源
Nginx服务器的启动停止重启1,Nginx主程序命令,./sbin/nginx -h 查看帮助后 -V版本号,-t配置文件是否有错误语法 等......
2,启动Nginx服务器:./sbin/n