安装Nginx
安装依赖
- 安装依赖
yum -y install gcc zlib zlib-devel pcre-devel
nginx
- 下载压缩包
cd /usr/local/
wget http://nginx.org/download/nginx-1.18.0.tar.gz
nginx下载地址在官网获取
- 解压
tar -zxvf nginx-1.18.0.tar.gz
编译安装
- 检查环境
cd nginx-1.18.0/
./configure
- 编译安装
make && make install
检查安装状态
/usr/local/nginx/sbin/nginx -v
启动
/usr/local/nginx/sbin/nginx
启动后访问:
curl localhost:80