Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save gaptekupdate/6a942fd711b5c9c3a0ecb53788b32dfa to your computer and use it in GitHub Desktop.
Save gaptekupdate/6a942fd711b5c9c3a0ecb53788b32dfa to your computer and use it in GitHub Desktop.
#x86_64 processor march=native m64
cd /root;
sudo yum groupinstall -y "Development Tools"
sudo yum install -y git wget zlib zlib-devel pcre-devel google-perftools google-perftools-devel lua-devel GeoIP-devel
sudo yum install -y make gcc gcc-c++ wget git openssl-devel pcre-devel zlib-devel python python-devel gcc zlib perl libxml2 libxslt
sudo yum install -y autoconf automake libtool make cmake openssl openssl-devel pcre-devel build-essential libpcre3 libpcre3-dev zlib1g-dev unzip git patch
sudo yum install -y cmake gc libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools gperftools-devel libatomic_ops-devel perl-ExtUtils-Embed
sudo yum install -y gcc-c clang libatomic_ops-devel pcre-devel openssl-devel libxml2-devel libxslt-devel gd-devel GeoIP-devel gperftools-devel perl-devel
sudo yum install -y build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev
yum install -y build-essential cmake clang
yum install -y centos-release-scl
yum install -y devtoolset-7-gcc-c++
scl enable devtoolset-7 bash
cd /root;
wget https://raw.githubusercontent.com/nanqinlang/Nginx/master/dependence/pcre-8.42.tar.gz && tar -zxf pcre-8.42.tar.gz
cd /root/pcre-8.42 && ./configure --enable-jit && make -j 8 && cd /root
git clone https://github.com/openssl/openssl
git clone --depth=1 https://github.com/cloudflare/zlib.git zlib-cloudflare
cd /root/zlib-cloudflare && ./configure && make -j 8 && cd /root
git clone https://github.com/google/ngx_brotli.git && cd ngx_brotli && git submodule update --init && cd ..
bash <(curl -f -L -sS https://ngxpagespeed.com/install) \
--nginx-version latest
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib64/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--user=nginx --group=nginx --with-compat \
--with-file-aio \
--with-threads \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_mp4_module \
--with-http_random_index_module \
--with-http_realip_module \
--with-http_secure_link_module \
--with-http_slice_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_v2_module \
--with-mail \
--with-mail_ssl_module \
--with-stream \
--with-stream_realip_module \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--add-module=../ngx_brotli \
--with-openssl=../openssl \
--with-pcre=../pcre-8.42 \
--with-pcre-jit \
--with-zlib=../zlib-cloudflare \
--with-cc-opt='-I/usr/local/include -Ofast -fPIE -pie -g -pipe -Wall -Wformat -Werror=format-security -Wimplicit-fallthrough=0 -fcode-hoisting -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong -flto -fuse-linker-plugin -fuse-ld=gold --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -march=native -DTCP_FASTOPEN=23 -Wno-deprecated-declarations -gsplit-dwarf' \
--with-pcre-opt='-g -Ofast -fPIC -m64 -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2' \
--with-zlib-opt='-g -Ofast -fPIC -m64 -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2' \
--with-openssl-opt='enable-tls1_3 no-ssl3 enable-ec_nistp_64_gcc_128 -fPIC -g -Ofast -m64 -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2' \
--with-ld-opt='-lrt -ljemalloc -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment