本文采用源码方式安装Nginx
下载 Nginx
解压 Nginx
tar -zxvf nginx-1.16.0.tar.gz
安装依赖
yum update
yum install pcre-devel openssl-devel
yum install gcc-c++ # 该选项非必选,若提示nginx c compiler cc is not found则安装
源码安装
./configure --prefix=/usr/local/nginx --with-http_ssl_module
make
make install
创建软连接
ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/
启动
nginx
配置vim语法高亮
将源码文件夹contrib
下的vim复制到~/.vim
cp -r /path/to/nginx-1.16.0/contrib/vim/ .vim