军哥的一键lnmp包有带–with-http_sub_module,但是有些人习惯用oneinstack,没有这个模块,不方便反代,添加额外模块需要重新编译。
所以这里在安装oneinstack一键脚本前,在nginx.sh里添加这个模块即可。
--with-http_sub_module
原文脚本如下:
yum -y install wget screen #for CentOS/Redhat
# apt-get -y install wget screen #for Debian/Ubuntu
wget http://mirrors.linuxeye.com/lnmp-full.tar.gz
tar xzf lnmp-full.tar.gz
#tar xzf lnmp.tar.gz
cd lnmp # 如果需要修改目录(安装、数据存储、Nginx日志),请修改options.conf文件
screen -S lnmp # 如果网路出现中断,可以执行命令`screen -R lnmp`重新连接安装窗口
./install.sh
在解压lnmp-full.tar.gz后,找到nginx.sh
vi /root/lnmp/include/nginx.sh
找到
![bc3d3543a6386f4a648739f6cb5e9d9b.png](https://i-blog.csdnimg.cn/blog_migrate/0397e6ce78b0d72d99059b875b415e9e.jpeg)
sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' auto/cc/gcc
[ ! -d "${nginx_install_dir}" ] && mkdir -p ${nginx_install_dir}
./configure --prefix=${nginx_install_dir} --user=${run_user} --group=${run_group} --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-${openssl11_ver} --with-pcre=../pcre-${pcre_ver} --with-pcre-jit --with-ld-opt='-ljemalloc' ${nginx_modules_options}
make -j ${THREAD} && make install
在这个段里加上
--with-http_sub_module
然后再运行 ./install.sh
运行 nginx -V检查是否成功安装成功。