linux安装nginx和配置https

安装nginx:
cd /usr/local/src
下载:
wget http://nginx.org/download/nginx-1.9.9.tar.gz
解压:
tar -zxvf nginx-1.9.9.tar.gz
进入目录:
cd nginx-1.9.9
编译(nginx默认不支持https,安装时需要加载Https模块,–prefix:指定安装目录,–with-http_ssl_module支持HTTPS,如果这一步报错接着往下看):
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
安装:
make
make install
备注:make: *** No rule to make target `build', needed by `default'.  Stop.
执行:yum -y install make zlib-devel gcc-c++ libtool openssl openssl-devel;再./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

备注:#如果./configure 报错 OpenSSL library not found,说明缺失OpenSSL库( crypto是OpenSSL 加密库(lib), 这个库需要openssl-devel包 ,在ubuntu中就是 libssl-dev )
执行下面命令:
yum -y install openssl-devel ll
然后重新执行
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
make install
启动nginx:
cd /usr/local/nginx
启动:
./sbin/nginx

  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值