






















在银河麒麟 V10 SP1(Kylin Linux Advanced Server V10 SP1)环境中,官方源提供的 Nginx 和 Redis 版本通常较低。为了满足更高性能、安全性和新特性需求,本文提供自行编译打包的 Nginx 1.29.8 和 Redis 8.6.2 RPM 安装包,支持 ARM64(aarch64) 和 x86_64 两种架构,可直接离线安装,特别适合信创和内网环境使用。
请根据您的服务器架构选择对应 RPM 包:
安装包已在银河麒麟 V10 SP1 对应架构下编译测试通过,其他系统及版本,请自测!
采用以下 configure 参数进行编译打包:
./configure \
--prefix=/app/nginx \
--sbin-path=/app/nginx/sbin/nginx \
--conf-path=/app/nginx/conf/nginx.conf \
--pid-path=/app/nginx/logs/nginx.pid \
--lock-path=/app/nginx/logs/nginx.lock \
--error-log-path=/app/nginx/logs/error.log \
--http-log-path=/app/nginx/logs/access.log \
--http-client-body-temp-path=/app/nginx/temp/client_body_temp \
--http-proxy-temp-path=/app/nginx/temp/proxy_temp \
--http-fastcgi-temp-path=/app/nginx/temp/fastcgi_temp \
--http-uwsgi-temp-path=/app/nginx/temp/uwsgi_temp \
--http-scgi-temp-path=/app/nginx/temp/scgi_temp \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-ipv6 \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--without-http_fastcgi_module \
--with-cc-opt="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -march=native" \
--with-ld-opt="-Wl,-z,relro -Wl,-z,now"
Redis 采用官方推荐方式编译,并特别添加 systemd-devel 依赖以支持 systemd 通知:
make %{?_smp_mflags} USE_SYSTEMD=yes MALLOC=libc
关键处理:
[Unit] Description=Redis In-Memory Data Store Documentation=https://redis.io/ After=network.target [Service] Type=notify ExecStart=/usr/bin/redis-server /etc/redis/redis.conf --supervised systemd ExecStop=/usr/bin/redis-cli shutdown Restart=always User=redis Group=redis RuntimeDirectory=redis RuntimeDirectoryMode=0755 LimitNOFILE=65535 [Install] WantedBy=multi-user.target
mkdir -p /root/packages && cd /root/packages
dnf install -y pcre openssl zlib libatomic rpm -ivh nginx-1.29.8-1.ky10.$(uname -m).rpm nginx -v
rpm -ivh redis-8.6.2-1.ky10.$(uname -m).rpm redis-server --version redis-cli --version
Nginx:
nginx -t systemctl daemon-reload systemctl start nginx systemctl enable nginx systemctl status nginx
Redis:
systemctl daemon-reload systemctl start redis systemctl enable redis systemctl status redis # 查看自动生成的随机密码 grep '^requirepass' /etc/redis/redis.conf
firewall-cmd --permanent --add-port=80/tcp --add-port=443/tcp --add-port=6379/tcp firewall-cmd --reload
rpm -e nginx rpm -e redis
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。