setup.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # nodejs
  2. curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
  3. yum install -y \
  4. gcc gcc-c++ clang \
  5. zlib zlib-devel unzip \
  6. git bc sed tree \
  7. make autoconf automake libtool \
  8. nodejs
  9. npm i -g webpack webpack-cli
  10. npm i -g html-minifier
  11. # install openresty
  12. mkdir -p install
  13. cd install
  14. curl -O https://ftp.pcre.org/pub/pcre/pcre-8.42.zip
  15. unzip pcre-*
  16. curl -O https://www.openssl.org/source/openssl-1.0.2p.tar.gz
  17. tar zxvf openssl-*
  18. git clone --recurse-submodules --depth 1 https://github.com/google/ngx_brotli.git
  19. curl -O https://openresty.org/download/openresty-1.13.6.2.tar.gz
  20. tar zxvf openresty-*
  21. cd openresty-*
  22. export NGX_BROTLI_STATIC_MODULE_ONLY=1
  23. ./configure \
  24. --add-module=../ngx_brotli \
  25. --with-http_ssl_module \
  26. --with-openssl=../openssl-1.0.2p \
  27. --with-pcre=../pcre-8.42 \
  28. --with-pcre-jit
  29. make
  30. make install
  31. # install brotli
  32. # https://www.howtoforge.com/how-to-compile-brotli-from-source-on-centos-7/
  33. git clone --depth 1 https://github.com/google/brotli.git
  34. cd ./brotli
  35. cp docs/brotli.1 /usr/share/man/man1 && gzip /usr/share/man/man1/brotli.1
  36. ./bootstrap
  37. ./configure --prefix=/usr \
  38. --bindir=/usr/bin \
  39. --sbindir=/usr/sbin \
  40. --libexecdir=/usr/lib64/brotli \
  41. --libdir=/usr/lib64/brotli \
  42. --datarootdir=/usr/share \
  43. --mandir=/usr/share/man/man1 \
  44. --docdir=/usr/share/doc
  45. make
  46. make install
  47. # install acme.sh
  48. curl https://get.acme.sh | sh