方案一:Nginx的源码简单安装
(1)进入官网查找需要下载版本链接地址,然后使用wget命令进行下载
mkdir -p /opt/src/
wget https://nginx.org/download/nginx-1.16.1.tar.gz
yum install -y gcc pcre pcre-devel zlib zilib-devel openssl openssl-devel
(2)下载资源进行包管理
mkdir -p /nginx/core/
mv nginx-1.16.1.tar.gz nginx/core
(3)解压缩
cd /nginx/core/
tar -xzf nginx-1.16.1.tar.gz
(4)进入资源文件中,发现configure
./configure
(5)编译、安装
make && make install
(6)启动nginx
[root@linux-base nginx-1.16.1]# cd /usr/local/nginx/
[root@linux-base nginx]# ls
conf html logs sbin
[root@linux-base nginx]# cd sbin/
[root@linux-base sbin]# ./nginx