1:安装nginx
先安装一些扩展:
yum -y install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel wget curl
创建www用户给web使用
groupadd -f www
useradd -g www www
下载nginx稳定版本安装包
wget http://nginx.org/download/nginx-1.18.0.tar.gz
解压安装包:
tar zxvf nginx-1.18.0.tar.gz
进入解压的安装包安装nginx
cd nginx-1.18.0
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module --with-openssl=/usr/local/src/openssl-1.0.2l
由于后面配置了openssl,所以这里要下载openssl(地址:http://www.linuxfromscratch.org/blfs/view/8.1/postlfs/openssl10.html)
cd /usr/local/src
wget https://openssl.org/source/openssl-1.0.2l.tar.gz
tar zxvf openssl-1.0.2l.tar.gz
等待nginx配置完成,这里进行编译
make && make install
等待流程完毕,我们就算是安装完成Nginx了,可以打开nginx来看看
标签:www,http,tar,--,openssl,centos7,nginx,源码
来源: https://www.cnblogs.com/willamwang/p/14333533.html