linux 安装 nginx
版本:1.16.1
地址:http://nginx.org/en/download.html
1: 提前安装需要的依赖
{
1: yum -y install gcc (编译依赖gcc环境)
2:yum install -y pcre pcre-devel(需要安装pcre库)
3:yum install -y zlib zlib-devel(nginx使用zlib对http包的内容进行gzip)
4:yum install -y openssl openssl-devel (openssl安装)
}
2:下载nginx -> wget http://nginx.org/download/nginx-1.16.1.tar.gz
3:解压nginx -> tar -zxvf nginx-1.9.9.tar.gz
4: 安装nginx
{
1: 进入解压的nginx目录
2:./configure
3: make
4: make install
}
5: 配置nginx
{
1: cd /usr/local/nginx/conf
2: vi nginx.conf
}
6: 启动nginx
{
1: cd /usr/local/nginx/sbin
2: ./nginx
[ 重启nginx ./nginx -s reload ]
}