alpine linux安装ftp,Linux Alpine安装 Nginx

Linux Alpine安装 Nginx

安装需要编译Nginx的扩展

apk add wget gcc g++ make

安装Nginx URL重定向,正则表达式模块pcre

Pcre 源码下载地址:https://ftp.pcre.org/pub/pcre

1. 先安装下载pcre模块,选择需要的pcre版本,这里选择8.44版本

cd /home # 安装到Home目录中

wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz && \

tar xvf pcre-8.44.tar.gz

> 注意:nginx安装pcre,不需要对pcre模块进行编译安装

2. 下载需要的nginx版本,解压

cd /home &&\

wget"http://nginx.org/download/nginx-1.18.0.tar.gz" &&\

tar xvf nginx-1.18.0.tar.gz

2. 编译安装nginx,安装到/usr/local/nginx目录中

cd /home/nginx-1.18.0 &&\

./configure --prefix=/usr/local/nginx --with-pcre=/home/pcre-8.44 --without-http_gzip_module &&\

make&& make install &&\

ln-s /usr/local/nginx/sbin/nginx /usr/sbin/ &&\

mkdir-p /usr/local/nginx/conf/vhost/

3.这里编译安装pcre模块,--with-pcre指定的是pcre下载的源码地址,而不是编译后的pcre安装地址,如有的安装在/usr/local/pcre,不是这个安装地址,而是刚wget后,tar解压后的地址,这里是/home/pcre-8.44

4. 执行:nginx启动nginx

5. 访问地址:localhost,出现如下页面

Welcome to nginx!If you seethis page, the nginx web server is successfully installed and working. Further configuration isrequired.

For online documentation and support please refer to nginx.org.

Commercial supportisavailable at nginx.com.

Thank youfor using nginx.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值