您现在的位置是:今夕何夕> LINUX 文章详情

Centos7.6安装nginx1.17.1

久伴轻尘 2019-08-06 22:32 LINUX 0人已浏览

1:安装依赖
yum install -y openssl-devel pcre-devel​
2:创建nginx目录
cd /usr/local
mdkir nginx
cd nginx​
3:下载nginx安装包
wget http://nginx.org/download/nginx-1.17.1.tar.gz
tar -zxvf nginx-1.17.1.tar.gz
cd nginx-1.17.1​
4:安装nginx
./configure --prefix=/usr/local/nginx --with-http_dav_module --with-http_stub_status_module  --with-http_addition_module 
--with-http_sub_module  --with-http_flv_module --with-http_mp4_module --with-pcre --with-http_ssl_module 
--with-http_gzip_static_module  --user=nginx  --group=nginx 
make
make install

ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/        //将nginx添加到/usr/local/sbin/​
5:添加nginx用户
useradd -s /sbin/nologin -M nginx
id nginx​
6:启动nginx
cd /usr/local/nginx/sbin 
./nginx