Linux安装Nginx

1.Linux前置环境准备(gcc,openssl等):

yum -y install gcc pcre-devel zlib-devel openssl openssl-devel

2.下载Nginx安装包:

https://nginx.org/download/

3.将安装包上传至服务器后(/usr/local/)解压编译安装

## 解压
cd /usr/local/
tar -zxvf nginx-1.17.8.tar.gz

##进入nginx目录
cd nginx-1.17.8/

## 配置(包含ssl模块)
./configure --prefix=/usr/local/nginx --with-http_ssl_module

## make
make
make install

## 测试nginx

#cd到刚才配置的安装目录
cd /usr/local/nginx/
./sbin/nginx -t

 

#启动nginx
./sbin/nginx

 

posted @ 2020-03-10 11:09  lujuhao  阅读(106)  评论(0编辑  收藏  举报