-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.sh
More file actions
93 lines (66 loc) · 3.48 KB
/
config.sh
File metadata and controls
93 lines (66 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/sh
# ------------------------------------------------------------------------------
# COMMON CONFIGURATION
# ------------------------------------------------------------------------------
# The version string of the nginx release that should be installed.
# Defaults to `false` and the code is cloned from my personal repository.
readonly NGINX_VERSION=false
# Whether to perform an on-the-fly upgrade or not.
readonly NGINX_ONTHEFLY_UPGRADE=false
# The version string of the PCRE release that should be installed.
readonly PCRE_VERSION='8.38'
# The name of the SSL/TLS library nginx should be compiled against.
#
# Possible values: 'openssl' (default), 'boringssl', and 'libressl'
#
# IMPORTANT! Right now only 'openssl' is supported, so do not touch.
readonly TLS_LIBRARY_NAME="${1:-openssl}"
# The version string of the SSL/TLS library release that should be installed.
readonly TLS_LIBRARY_VERSION='1.0.2h'
# Determines if the Accept-Language module should be compiled or not.
readonly ACCEPT_LANGUAGE=false
# Determines if the Google PageSpeed module should be compiled or not.
readonly GOOGLE_PAGESPEED=false
# The version string of the Google PageSpeed library.
readonly GOOGLE_PAGESPEED_VERSION='1.11.33.2'
# The name of the user nginx should use.
readonly USER='www-data'
# The name of the group nginx should use.
readonly GROUP="${USER}"
# ------------------------------------------------------------------------------
# CUSTOM CONFIGURATION
# ------------------------------------------------------------------------------
# Whether to install the SysVinit script or not.
readonly NGINX_INITD=true
# Please see official nginx documentation for all of the following or check out
# the configure call at the bottom of this script.
readonly NGINX_PREFIX='/usr/local'
readonly NGINX_SBIN_PATH="${NGINX_PREFIX}/sbin"
readonly NGINX_CONF_PATH="${NGINX_PREFIX}/etc/nginx"
readonly NGINX_CONF_SUFFIX='ngx'
readonly NGINX_PID_PATH='/run/nginx.pid'
readonly NGINX_LOCK_PATH='/run/nginx.lock'
readonly NGINX_LOG_PATH='/var/log/nginx'
readonly NGINX_TMP_PATH='/tmp'
# Additional flags that should be passed to the C compiler.
NGINX_CFLAGS='-Ofast -march=native -pipe -DFD_SETSIZE=131072'
# Add 64bit option to C compiler flags if applicable.
[ $(uname -m) = 'x86_x64' ] && NGINX_CFLAGS="${NGINX_CFLAGS} -m64"
# Additional flags that should be passed to the linker.
NGINX_LDFLAGS=
# Options to pass to the TLS library.
readonly TLS_LIBRARY_OPTIONS='enable-ec_nistp_64_gcc_128 enable-gmp no-comp -no-deprecated no-dso no-dtls no-dynamic-engine no-engine no-err no-hash-comp no-heartbeats no-idea no-md2 no-md4 no-mdc2 no-rc2 no-rc4 no-rc5 no-speed no-static-engine'
# The absolute path to the downloaded and extracted source files.
readonly SOURCE_DIRECTORY='/usr/local/src'
# Absolute path to the nginx init.d script.
readonly INITD_PATH='/etc/init.d/nginx'
# ------------------------------------------------------------------------------
# INTERNAL VARIABLES (DO NOT TOUCH)
# ------------------------------------------------------------------------------
# For more information on shell colors and other text formatting see:
# https://stackoverflow.com/a/4332530/1251219
readonly RED=$(tput bold; tput setaf 1)
readonly GREEN=$(tput bold; tput setaf 2)
readonly YELLOW=$(tput bold; tput setaf 3)
readonly BLUE=$(tput bold; tput setaf 4)
readonly NORMAL=$(tput sgr0)