系统平台:腾讯云服务器:CentOs 7.4
购买ESC及登录跳过
一、安装编译工具及库文件
[root@VM_0_3_centos ~]# yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
二、安装 PCRE
[root@VM_0_3_centos ~]# cd /usr/local/src/
[root@VM_0_3_centos ~]# wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
[root@VM_0_3_centos ~]# tar zxvf pcre-8.35.tar.gz
[root@VM_0_3_centos ~]# cd pcre-8.35
[root@VM_0_3_centos ~]# ./configure
[root@VM_0_3_centos ~]# make && make install
[root@VM_0_3_centos ~]# pcre-config --version
三、安装 Nginx
[root@VM_0_3_centos ~]# cd /usr/local/src/
[root@VM_0_3_centos ~]# wget http://nginx.org/download/nginx-1.6.2.tar.gz
[root@VM_0_3_centos ~]# tar zxvf nginx-1.6.2.tar.gz
[root@VM_0_3_centos ~]# cd nginx-1.6.2
[root@VM_0_3_centos ~]# ./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35
[root@VM_0_3_centos ~]# make && make install
[root@VM_0_3_centos ~]# /usr/local/webserver/nginx/sbin/nginx -v
四、Nginx 命令
/usr/local/webserver/nginx/sbin/nginx # 启动
/usr/local/webserver/nginx/sbin/nginx -s reload # 重新载入配置文件
/usr/local/webserver/nginx/sbin/nginx -s reopen # 重启 Nginx
/usr/local/webserver/nginx/sbin/nginx -s stop # 停止 Nginx