在Centos中安装Nginx有两种方法,一种通过yum安装,一种源码编译安装,这里介绍编译安装的过程。如果需要yum安装可以参考官方的介绍:http://nginx.org/en/linux_packages.html#RHEL-CentOS 。
先安装gcc、openssl 库。
yum -y install gcc gcc-c++ wget openssl openssl-devel