Loading
0

Alpine Linux安装nginx

安装gcc:

apk add build-base;

安装库:

apk add pcre-dev openssl openssl-dev zlib zlib-dev

配置:

./configure --prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-pcre \
--with-stream \
--with-stream_ssl_module \
--with-stream_realip_module

编译安装:

make && make install

创建软连接:

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

创建nginx用户:

adduser -s /sbin/nologin -D nginx

参考:

最后编辑于:2022/6/29作者: joycode

评论已关闭