在安装nginx之前我们需要安装一些必要的软件包
yum install gcc make pcre* zlib* -y
1:下载nginx
[[email protected]_64 ~]#wget http://nginx.org/download/nginx-1.6.2.tar.gz
[[email protected]_64 ~]# tar -zxvf nginx-1.6.2.tar.gz
[[email protected]_64 ~]# cd nginx-1.6.2
[[email protected]_64 nginx-1.6.2]# ./configure --prefix=/usr/local/nginx/
[[email protected]_64 nginx-1.6.2]# make && make install
[[email protected]_64 nginx-1.6.2]# cd /usr/local/nginx/sbin/
[[email protected]_64 sbin]# ./nginx
[[email protected]_64 sbin]# ./nginx -t
nginx: the configuration file /usr/local/nginx//conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx//conf/nginx.conf test is successful
检查下nginx的配置文件有没有问题
[[email protected]_64 sbin]#./nginx -s reload 在不重启的情况下重新加载nginx的配置文件