Nginx安装流程
Linux版本: CentOS 8.3.2011
在安装nginx前首先要确认系统中安装了gcc、pcre-devel、zlib-devel、openssl-devel
安装命令:yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
nginx下载地址:https://nginx.org/download/
新建nginx文件夹,并将下载的安装包放于此文件夹下
当前实例为 /usr/local/nginx
## 解压 tar -zxvf nginx-1.19.9.tar ##进入nginx目录 cd nginx-1.9.9 ## 配置 ./configure --prefix=/usr/local/nginx # make make make install
测试是否安装成功
##cd到sbin目录 cd /usr/local/nginx/sbin ./nginx -t
正常情况下输出
启动nginx
cd /usr/local/nginx/sbin ./nginx
将nginx命令设置为全局命令
ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/