Nginx教程

CentOS7安装Nginx

本文主要是介绍CentOS7安装Nginx,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
#安装依赖
yum install gcc gcc-c++ pcre-devel zlib-devel openssl-devel -y

#下载安装包
wget http://nginx.org/download/nginx-1.9.9.tar.gz

#进入安装文件目录
cd nginx-1.9.9

#configure --prefix表示将nginx安装至哪个目录
#下面的是一些常用module
./configure --prefix=/usr/local/nginx
 --with-http_stub_status_module
 --with-http_realip_module --with-http_ssl_module
 --with-http_gzip_static_module
 --http-client-body-temp-path=/var/tmp/nginx/client
 --http-proxy-temp-path=/var/tmp/nginx/proxy
 --http-fastcgi-temp-path=/var/tmp/nginx/fcgi

make && make install

示例中nginx版本:1.9.9,其他版本:点此下载

这篇关于CentOS7安装Nginx的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!