- Linux安装nginx
安装Nginx并支持SSL步骤
- 下载依赖
yum -y install gcc gcc-c++ autoconf automake libtool make cmake yum -y install zlib zlib-devel openssl openssl-devel pcre-devel
- 下载安装包
cd /opt/package //下载目录 wget http://nginx.org/download/nginx-1.15.7.tar.gz
- 解压
tar -zxvf nginx-1.15.7.tar.gz -C /home/ //-c 指定目录(也可省略) cd /home/nginx-1.15.7/ ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-pcre
- 安装
make && make install
- 系统安装目录默认:
/usr/local/nginx
- 启动
cd /usr/local/nginx/sbin/ ./nginx //启动 ./nginx -s reload //重新启动 ./nginx -s stop //停止
- 下载依赖
查看nginx 安装目录
ps -ef | grep nginx