forked from centminmod/centminmod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
centmin.sh
executable file
·3500 lines (3049 loc) · 131 KB
/
centmin.sh
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
#####################################################
export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
#####################################################
EMAIL='' # Server notification email address enter only 1 address
PUSHOVER_EMAIL='' # Signup pushover.net push email notifications to mobile & tablets
ZONEINFO=Etc/UTC # Set Timezone
NGINX_IPV='n' # option deprecated from 1.11.5+ IPV6 support
USEEDITOR='nano' # choice between nano or vim text editors for cmd shortcuts
FORCE_IPVFOUR='y' # curl/wget commands through script force IPv4
CUSTOMSERVERNAME='y'
CUSTOMSERVERSTRING='nginx centminmod'
PHPFPMCONFDIR='/usr/local/nginx/conf/phpfpmd'
UNATTENDED='y' # please leave at 'y' for best compatibility as at .07 release
CMVERSION_CHECK='n'
MENUEXIT_ALWAYS_YUMCHECK='y' # also do yum check on centmin.sh exit
CMSDEBUG='n'
#####################################################
DT=$(date +"%d%m%y-%H%M%S")
# for github support
branchname='123.09beta01'
SCRIPT_MAJORVER='1.2.3'
SCRIPT_MINORVER='09'
SCRIPT_INCREMENTVER='362'
SCRIPT_VERSIONSHORT="${branchname}"
SCRIPT_VERSION="${SCRIPT_VERSIONSHORT}.b${SCRIPT_INCREMENTVER}"
SCRIPT_DATE='31/12/2019'
SCRIPT_AUTHOR='eva2000 (centminmod.com)'
SCRIPT_MODIFICATION_AUTHOR='eva2000 (centminmod.com)'
SCRIPT_URL='https://centminmod.com'
COPYRIGHT="Copyright 2011-2019 CentminMod.com"
DISCLAIMER='This software is provided "as is" in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.'
#####################################################
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version. See the included license.txt for futher details.
#
# PLEASE MODIFY VALUES BELOW THIS LINE ++++++++++++++++++++++++++++++++++++++
# Note: Please enter y for yes or n for no.
#####################################################
shopt -s expand_aliases
for g in "" e f; do
alias ${g}grep="LC_ALL=C ${g}grep" # speed-up grep, egrep, fgrep
done
#####################################################
HN=$(uname -n)
# Pre-Checks to prevent screw ups
DIR_TMP='/svr-setup'
SCRIPT_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]}))
source "inc/memcheck.inc"
TMPFSLIMIT=2900000
if [ ! -d "$DIR_TMP" ]; then
if [[ "$TOTALMEM" -ge "$TMPFSLIMIT" ]]; then
TMPFSENABLED=1
RAMDISKTMPFS='y'
echo "setting up $DIR_TMP on tmpfs ramdisk for initial install"
mkdir -p "$DIR_TMP"
chmod 0750 "$DIR_TMP"
mount -t tmpfs -o size=2200M,mode=0755 tmpfs "$DIR_TMP"
df -hT
else
mkdir -p "$DIR_TMP"
chmod 0750 "$DIR_TMP"
fi
fi
if [[ -z "$(cat /etc/resolv.conf)" ]]; then
echo ""
echo "/etc/resolv.conf is empty. No nameserver resolvers detected !! "
echo "Please configure your /etc/resolv.conf correctly or you will not"
echo "be able to use the internet or download from your server."
echo "aborting script... please re-run centmin.sh"
echo ""
exit
fi
if [ ! -f /usr/bin/wget ]; then
echo "wget not found !! "
echo "installing wget"
yum -y -q install wget
echo "aborting script... please re-run centmin.sh"
exit
fi
if [ ! -f /usr/bin/lynx ]; then
echo "installing lynx..."
yum -y -q install lynx
fi
if [ ! -f /usr/bin/unzip ]; then
yum -y -q install unzip
fi
if [ ! -f /usr/bin/bc ]; then
echo "bc not found !! "
echo "installing bc"
yum -y -q install bc
echo "bc installed"
echo "aborting script... "
echo "please re-run centmin.sh again for install"
exit
fi
if [ ! -f /usr/bin/tee ]; then
#echo "tee not found !! "
#echo "installing tee"
yum -y -q install coreutils
fi
if [ -f /var/cpanel/cpanel.config ]; then
echo "WHM/Cpanel detected.. centmin mod NOT compatible"
echo "aborting script..."
exit
fi
if [ -f /etc/psa/.psa.shadow ]; then
echo "Plesk detected.. centmin mod NOT compatible"
echo "aborting script..."
exit
fi
if [ -f /etc/init.d/directadmin ]; then
echo "DirectAdmin detected.. centmin mod NOT compatible"
echo "aborting script..."
exit
fi
if [ ! -d /var/run/php-fpm/ ]; then
mkdir -p /var/run/php-fpm/
fi
TESTEDCENTOSVER='7.9'
CENTOSVER=$(awk '{ print $3 }' /etc/redhat-release)
KERNEL_NUMERICVER=$(uname -r | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }')
if [ "$CENTOSVER" == 'release' ]; then
CENTOSVER=$(awk '{ print $4 }' /etc/redhat-release | cut -d . -f1,2)
if [[ "$(cat /etc/redhat-release | awk '{ print $4 }' | cut -d . -f1)" = '7' ]]; then
CENTOS_SEVEN='7'
elif [[ "$(cat /etc/redhat-release | awk '{ print $4 }' | cut -d . -f1)" = '8' ]]; then
CENTOS_EIGHT='8'
fi
fi
if [[ "$(cat /etc/redhat-release | awk '{ print $3 }' | cut -d . -f1)" = '6' ]]; then
CENTOS_SIX='6'
fi
# Check for Redhat Enterprise Linux 7.x
if [ "$CENTOSVER" == 'Enterprise' ]; then
CENTOSVER=$(awk '{ print $7 }' /etc/redhat-release)
if [[ "$(awk '{ print $1,$2 }' /etc/redhat-release)" = 'Red Hat' && "$(awk '{ print $7 }' /etc/redhat-release | cut -d . -f1)" = '7' ]]; then
CENTOS_SEVEN='7'
REDHAT_SEVEN='y'
fi
fi
if [[ -f /etc/system-release && "$(awk '{print $1,$2,$3}' /etc/system-release)" = 'Amazon Linux AMI' ]]; then
CENTOS_SIX='6'
fi
if [[ "$FORCE_IPVFOUR" != [yY] ]]; then
ipv_forceopt=""
ipv_forceopt_wget=""
else
ipv_forceopt='4'
ipv_forceopt_wget=' -4'
fi
source "inc/centos_seven.inc"
seven_function
cmservice() {
servicename=$1
action=$2
if [[ "$CENTOS_SEVEN" != '7' ]] && [[ "${servicename}" = 'haveged' || "${servicename}" = 'pure-ftpd' || "${servicename}" = 'mysql' || "${servicename}" = 'php-fpm' || "${servicename}" = 'nginx' || "${servicename}" = 'memcached' || "${servicename}" = 'nsd' || "${servicename}" = 'csf' || "${servicename}" = 'lfd' ]]; then
echo "service ${servicename} $action"
if [[ "$CMSDEBUG" = [nN] ]]; then
service "${servicename}" "$action"
fi
else
if [[ "${servicename}" = 'php-fpm' || "${servicename}" = 'nginx' ]]; then
echo "service ${servicename} $action"
if [[ "$CMSDEBUG" = [nN] ]]; then
service "${servicename}" "$action"
fi
elif [[ "${servicename}" = 'mysql' || "${servicename}" = 'mysqld' ]]; then
servicename='mariadb'
echo "systemctl $action ${servicename}.service"
if [[ "$CMSDEBUG" = [nN] ]]; then
systemctl "$action" "${servicename}.service"
fi
fi
fi
}
cmchkconfig() {
servicename=$1
status=$2
if [[ "$CENTOS_SEVEN" != '7' ]] && [[ "${servicename}" = 'haveged' || "${servicename}" = 'pure-ftpd' || "${servicename}" = 'mysql' || "${servicename}" = 'php-fpm' || "${servicename}" = 'nginx' || "${servicename}" = 'memcached' || "${servicename}" = 'nsd' || "${servicename}" = 'csf' || "${servicename}" = 'lfd' ]]; then
echo "chkconfig ${servicename} $status"
if [[ "$CMSDEBUG" = [nN] ]]; then
chkconfig "${servicename}" "$status"
fi
else
if [[ "${servicename}" = 'mysql' || "${servicename}" = 'php-fpm' || "${servicename}" = 'nginx' ]]; then
echo "chkconfig ${servicename} $status"
if [[ "$CMSDEBUG" = [nN] ]]; then
chkconfig "${servicename}" "$status"
fi
else
if [ "$status" = 'on' ]; then
status=enable
fi
if [ "$status" = 'off' ]; then
status=disable
fi
echo "systemctl $status ${servicename}.service"
if [[ "$CMSDEBUG" = [nN] ]]; then
systemctl "$status" "${servicename}.service"
fi
fi
fi
}
if [ -f /proc/user_beancounters ]; then
# CPUS='1'
# MAKETHREADS=" -j$CPUS"
# speed up make
CPUS=$(grep -c "processor" /proc/cpuinfo)
if [[ "$CPUS" -gt '8' ]]; then
if [[ "$(grep -o 'AMD EPYC 7601' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7601' ]]; then
# 7601 at 12 cpu cores has 3.20hz clock frequency https://en.wikichip.org/wiki/amd/epyc/7601
# while greater than 12 cpu cores downclocks to 2.70Ghz
CPUS=12
elif [[ "$(grep -o 'AMD EPYC 7551' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7551' ]]; then
# 7551P at 12 cpu cores has 3.0Ghz clock frequency https://en.wikichip.org/wiki/amd/epyc/7551p
# while greater than 12 cpu cores downclocks to 2.55Ghz
CPUS=12
elif [[ "$(grep -o 'AMD EPYC 7501' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7501' ]]; then
# 7501P at 12 cpu cores has 3.0Ghz clock frequency https://en.wikichip.org/wiki/amd/epyc/7501p
# while greater than 12 cpu cores downclocks to 2.6Ghz
CPUS=12
elif [[ "$(grep -o 'AMD EPYC 7451' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7451' ]]; then
# 7451 at 12 cpu cores has 3.2Ghz clock frequency https://en.wikichip.org/wiki/amd/epyc/7451
# while greater than 12 cpu cores downclocks to 2.9Ghz
CPUS=12
elif [[ "$(grep -o 'AMD EPYC 7401' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7401' ]]; then
# 7401P at 12 cpu cores has 3.0Ghz clock frequency https://en.wikichip.org/wiki/amd/epyc/7401p
# while greater than 12 cpu cores downclocks to 2.8Ghz
CPUS=12
elif [[ "$(grep -o 'AMD EPYC 7371' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7371' ]]; then
# 7371 at 8 cpu cores has 3.8Ghz clock frequency https://en.wikichip.org/wiki/amd/epyc/7371
# while greater than 8 cpu cores downclocks to 3.6Ghz
CPUS=8
else
CPUS=$(echo $(($CPUS+2)))
fi
else
CPUS=$(echo $(($CPUS+1)))
fi
MAKETHREADS=" -j$CPUS"
else
# speed up make
CPUS=$(grep -c "processor" /proc/cpuinfo)
if [[ "$CPUS" -gt '8' ]]; then
if [[ "$(grep -o 'AMD EPYC 7601' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7601' ]]; then
# 7601 at 12 cpu cores has 3.20hz clock frequency https://en.wikichip.org/wiki/amd/epyc/7601
# while greater than 12 cpu cores downclocks to 2.70Ghz
CPUS=12
elif [[ "$(grep -o 'AMD EPYC 7551' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7551' ]]; then
# 7551P at 12 cpu cores has 3.0Ghz clock frequency https://en.wikichip.org/wiki/amd/epyc/7551p
# while greater than 12 cpu cores downclocks to 2.55Ghz
CPUS=12
elif [[ "$(grep -o 'AMD EPYC 7501' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7501' ]]; then
# 7501P at 12 cpu cores has 3.0Ghz clock frequency https://en.wikichip.org/wiki/amd/epyc/7501p
# while greater than 12 cpu cores downclocks to 2.6Ghz
CPUS=12
elif [[ "$(grep -o 'AMD EPYC 7451' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7451' ]]; then
# 7451 at 12 cpu cores has 3.2Ghz clock frequency https://en.wikichip.org/wiki/amd/epyc/7451
# while greater than 12 cpu cores downclocks to 2.9Ghz
CPUS=12
elif [[ "$(grep -o 'AMD EPYC 7401' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7401' ]]; then
# 7401P at 12 cpu cores has 3.0Ghz clock frequency https://en.wikichip.org/wiki/amd/epyc/7401p
# while greater than 12 cpu cores downclocks to 2.8Ghz
CPUS=12
elif [[ "$(grep -o 'AMD EPYC 7371' /proc/cpuinfo | sort -u)" = 'AMD EPYC 7371' ]]; then
# 7371 at 8 cpu cores has 3.8Ghz clock frequency https://en.wikichip.org/wiki/amd/epyc/7371
# while greater than 8 cpu cores downclocks to 3.6Ghz
CPUS=8
else
CPUS=$(echo $(($CPUS+4)))
fi
elif [[ "$CPUS" -eq '8' ]]; then
CPUS=$(echo $(($CPUS+2)))
else
CPUS=$(echo $(($CPUS+1)))
fi
MAKETHREADS=" -j$CPUS"
fi
# configure .ini directory
CONFIGSCANBASE='/etc/centminmod'
CONFIGSCANDIR="${CONFIGSCANBASE}/php.d"
if [ ! -d "$CONFIGSCANBASE" ]; then
mkdir -p "$CONFIGSCANBASE"
fi
if [ ! -d "$CONFIGSCANDIR" ]; then
mkdir -p "$CONFIGSCANDIR"
if [ -d /root/centminmod/php.d/ ]; then
cp -a /root/centminmod/php.d/* "${CONFIGSCANDIR}/"
fi
fi
# MySQL non-tmpfs based tmpdir for MySQL temp files
if [ ! -d "/home/mysqltmp" ]; then
mkdir -p /home/mysqltmp
chmod 1777 /home/mysqltmp
CHOWNMYSQL=y
fi
#####################################################
# Centmin Mod Git Repo URL - primary repo
# https://github.com/centminmod/centminmod
CMGIT='https://github.com/centminmod/centminmod.git'
# Gitlab backup repo
# https://gitlab.com/centminmod/centminmod
#CMGIT='https://gitlab.com/centminmod/centminmod.git'
# With AUTO_GITUPDATE='y' if centmin mod code install
# directory has been setup with git environment via
# centmin.sh menu option 23 # submenu option 1, then
# allow centmin.sh to auto update # the centmin mod
# code at /usr/local/src/centminmod
# silently in background
#
# if you want to retain local centmin mod code changes
# made to files in /usr/local/src/centminmod for variables
# in centmin.sh, use persistent config file you create
# or append to at /etc/centminmod/custom_config.inc as
# outlined on official site at
# https://centminmod.com/upgrade.html#persistent
AUTO_GITUPDATE='n'
#####################################################
LOCALCENTMINMOD_MIRROR='https://centminmod.com'
#####################################################
# Timestamp Install
TS_INSTALL='y'
TIME_NGINX='n'
TIME_PHPCONFIGURE='n'
TIME_MEMCACHED='n'
TIME_IMAGEMAGICK='n'
TIME_REDIS='n'
#####################################################
# Enable or disable menu mode
ENABLE_MENU='y'
#####################################################
# CentOS 7 specific
FIREWALLD_DISABLE='y'
DNF_ENABLE='n'
DNF_COPR='y'
#####################################################
# CSF FIREWALL
# PORTFLOOD Configuration
# https://community.centminmod.com/threads/14708/
# Setting CSFPORTFLOOD_OVERRIDE='y' allows you to
# override default CSF Firewall PORTFLOOD values set
# by Centmin Mod initial install. If end user made
# custom changes to PORTFLOOD values, the override
# will not work. Override only works if end user has
# not made custom changes to PORTFLOOD values to ensure
# end users customisations do not get overwritten
CSFPORTFLOOD_OVERRIDE='n'
# max hit count value allowed is 20
PORTFLOOD_COUNT=20
# lowering interval in seconds allows for more
# port flood hits against default TCP port 21
PORTFLOOD_INTERVAL=300
#####################################################
# MariaDB Jemalloc
# doh forgot MariaDB already uses jemalloc by default
MARIADB_JEMALLOC='n'
#####################################################
# CCACHE Configuration
CCACHEINSTALL='y'
CCACHE_VER="3.7.4"
CCACHESIZE='2.5G'
#####################################################
# Networking
# do not edit below variables but instead set them in
# /etc/centminmod/custom_config.inc as outlined on
# official site at
# https://centminmod.com/upgrade.html#persistent to
# override defaults
# disable system IPv6 support
# https://wiki.centos.org/FAQ/CentOS7#head-8984faf811faccca74c7bcdd74de7467f2fcd8ee
DISABLE_IPVSIX='n'
#####################################################
# experimental use of subshells to download some
# tarballs in parallel for faster initial installs
PARALLEL_MODE=y
# compiler related
MARCH_TARGETNATIVE='y' # for intel 64bit only set march=native, if no set to x86-64
MARCH_TARGETNATIVE_ALWAYS='n' # force native compiler to override smarter vps detection routine
CLANG='n' # Nginx and LibreSSL
CLANG_FOUR='n' # Clang 4.0+ optional support https://community.centminmod.com/threads/13729/
CLANG_FIVE='n' # Clang 5.0+ optional support https://community.centminmod.com/threads/13729/
CLANG_SIX='n' # Clang 6.0+ optional support https://community.centminmod.com/threads/13729/
CLANG_PHP='n' # PHP
CLANG_APC='n' # APC Cache
CLANG_MEMCACHED='n' # Memcached menu option 10 routine
GCCINTEL_PHP='y' # enable PHP-FPM GCC compiler with Intel cpu optimizations
PHP_PGO='n' # Profile Guided Optimization https://software.intel.com/en-us/blogs/2015/10/09/pgo-let-it-go-php
PHP_PGO_ALWAYS='n' # override for PHP_PGO enable for 1 cpu thread servers too
PHP_PGO_TRAINRUNS='10' # number of runs done during PGO PHP 7 training runs
PHP_PGO_CENTOSSIX='n' # CentOS 6 may need GCC >4.4.7 fpr PGO so use devtoolset-4 GCC 5.3
DEVTOOLSET_PHP='n' # use devtoolset GCC for GCCINTEL_PHP='y'
DEVTOOLSETSIX='n' # Enable or disable devtoolset-6 GCC 6.2 support instead of devtoolset-4 GCC 5.3 support
DEVTOOLSETSEVEN='n' # Enable or disable devtoolset-7 GCC 7.1 support instead of devtoolset-6 GCC 6.2 support
DEVTOOLSETEIGHT='y' # source compiled GCC 8 from latest snapshot builds
NGINX_DEVTOOLSETGCC='y' # Use devtoolset-4 GCC 5.3 even for CentOS 7 nginx compiles
GENERAL_DEVTOOLSETGCC='n' # Use devtoolset-4 GCC 5.3 whereever possible/coded
CRYPTO_DEVTOOLSETGCC='n' # Use devtoolset-4 GCC 5.3 for libressl or openssl compiles
NGX_GSPLITDWARF='y' # for Nginx compile https://community.centminmod.com/posts/44072/
PHP_GSPLITDWARF='y' # for PHP compile https://community.centminmod.com/posts/44072/
PHP_LTO='n' # enable -flto compiler for GCC 4.8.5+ PHP-FPM compiles currently not working with PHP 7.x
NGX_LDGOLD='y' # for Nginx compile i.e. passing ld.gold linker -fuse-ld=bfd or -fuse-ld=gold https://community.centminmod.com/posts/44037/
NGINX_FATLTO_OBJECTS='n' # enable -ffat-lto-objects flag for nginx builds - much slower compile times
NGINX_NOFATLTO_OBJECTS='n' # enable -fno-fat-lto-objects flag for nginx builds - much slower compile times
# recommended to keep NGINXOPENSSL_FATLTO_OBJECTS and NGINXOPENSSL_NOFATLTO_OBJECTS set to = n
NGINXOPENSSL_FATLTO_OBJECTS='n' # enable -ffat-lto-objects flag for nginx OpenSSL builds - much slower compile times
NGINXOPENSSL_NOFATLTO_OBJECTS='n' # enable -fno-fat-lto-objects flag for nginx OpenSSL builds - much slower compile times
NGINXCOMPILE_FORMATSEC='y' # whether or not nginx is compiled with -Wformat -Werror=format-security flags
# When set to =y, will disable those listed installed services
# by default. The service is still installed but disabled
# by default and can be re-enabled with commands:
# service servicename start; chkconfig servicename on
NSD_DISABLED='n' # when set to =y, NSD disabled by default with chkconfig off
MEMCACHED_DISABLED='n' # when set to =y, Memcached server disabled by default via chkconfig off
PHP_DISABLED='n' # when set to =y, PHP-FPM disabled by default with chkconfig off
MYSQLSERVICE_DISABLED='n' # when set to =y, MariaDB MySQL service disabled by default with chkconfig off
PUREFTPD_DISABLED='n' # when set to =y, Pure-ftpd service disabled by default with chkconfig off
# Nginx Dynamic Module Switches
NGXDYNAMIC_MANUALOVERRIDE='n' # set to 'y' if you want to manually drop in nginx dynamic modules into /usr/local/nginx/modules
NGXDYNAMIC_NJS='n'
NGXDYNAMIC_XSLT='n'
NGXDYNAMIC_PERL='n'
NGXDYNAMIC_IMAGEFILTER='y'
NGXDYNAMIC_GEOIP='n'
NGXDYNAMIC_GEOIPTWOLITE='n'
NGXDYNAMIC_STREAM='n'
NGXDYNAMIC_STREAMGEOIP='n' # nginx 1.11.3+ option http://hg.nginx.org/nginx/rev/558db057adaa
NGXDYNAMIC_STREAMREALIP='n' # nginx 1.11.4+ option http://hg.nginx.org/nginx/rev/9cac11efb205
NGXDYNAMIC_HEADERSMORE='y'
NGXDYNAMIC_SETMISC='y'
NGXDYNAMIC_ECHO='y'
NGXDYNAMIC_LUA='y' #
NGXDYNAMIC_SRCCACHE='n'
NGXDYNAMIC_DEVELKIT='y' #
NGXDYNAMIC_MEMC='n'
NGXDYNAMIC_REDISTWO='n'
NGXDYNAMIC_NGXPAGESPEED='n'
NGXDYNAMIC_BROTLI='y'
NGXDYNAMIC_FANCYINDEX='y'
NGXDYNAMIC_HIDELENGTH='y'
NGXDYNAMIC_TESTCOOKIE='n'
NGXDYNAMIC_VHOSTSTATS='n'
# set = y to put nginx, php and mariadb major version updates into 503
# maintenance mode https://community.centminmod.com/posts/26485/
NGINX_UPDATEMAINTENANCE='n'
PHP_UPDATEMAINTENANCE='n'
MARIADB_UPDATEMAINTENANCE='n'
# General Configuration
NGINXCOMPILE_PIE='n' # build nginx with Position-independent code (PIC) / Position-indendendent executables (PIEs)
NGINXUPGRADESLEEP='3'
AUTOTUNE_CLIENTMAXBODY='y' # auto tune client_max_body_size option in nginx.conf
AUTOHARDTUNE_NGINXBACKLOG='n' # on non-openvz systems, if enabled will override nginx default NGX_LISTEN_BACKLOG in src/os/unix/ngx_linux_config.h
USE_NGINXMAINEXTLOGFORMAT='n' # use default combined nginx log format instead of main_ext custom format for nginx amplify
NGINX_ALLOWOVERRIDE='y' # allow centmin mod to update nginx.conf setting defaults when the defaults are revised
NGINX_SSLCACHE_ALLOWOVERRIDE='n' # dynamically tune nginx ssl_session_cache in /usr/local/nginx/conf/ssl_include.conf based on system detected memory
NSD_INSTALL='n' # Install NSD (DNS Server)
NSD_VERSION='3.2.18' # NSD Version
NTP_INSTALL='y' # Install Network time protocol daemon
NGINXPATCH='y' # Set to y to allow NGINXPATCH_DELAY seconds time before Nginx configure and patching Nginx
NGINX_IOURING_PATCH='n' # Experimental Nginx AIO patch for Linux 5.1+ Kernel systems only
NGINXPATCH_DELAY='1' # Number of seconds to pause Nginx configure routine during Nginx upgrades
STRIPNGINX='y' # set 'y' to strip nginx binary to reduce size
NGXMODULE_ALTORDER='y' # nginx configure module ordering alternative order
NGINX_COMPILE_EXPORT='y' # nginx compile export symbols when mixing nginx static and dynamic compiled libraries
NGINX_ZERODT='n' # nginx zero downtime reloading on nginx upgrades
NGINX_MAXERRBYTELIMIT='2048' # modify NGX_MAX_ERROR_STR hardcoded 2048 limit by editing value i.e. http://openresty-reference.readthedocs.io/en/latest/Lua_Nginx_API/#print
NGINX_INSTALL='y' # Install Nginx (Webserver)
NGINX_DEBUG='n' # Enable & reinstall Nginx debug log nginx.org/en/docs/debugging_log.html & wiki.nginx.org/Debugging
NGINX_HTTP2='y' # Nginx http/2 patch https://community.centminmod.com/threads/4127/
NGINX_HTTPPUSH='n' # Nginx http/2 push patch https://community.centminmod.com/threads/11910/
NGINX_ZLIBNG='n' # 64bit OS only for Nginx compiled against zlib-ng https://github.com/Dead2/zlib-ng
NGINX_MODSECURITY='n' # modsecurity module support https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#Installation_for_NGINX
NGINX_MODSECURITY_MAXMIND='y' # modsecurity built with libmaxminddb is failing to compile so disable it in favour of GeoIP legacy
MODSECURITY_OWASPVER='3.1.1' # owasp modsecurity ruleset https://github.com/SpiderLabs/owasp-modsecurity-crs/releases
NGINX_REALIP='y' # http://nginx.org/en/docs/http/ngx_http_realip_module.html
NGINX_RDNS='n' # https://github.com/flant/nginx-http-rdns
NGINX_NJS='n' # nginScript https://www.nginx.com/blog/launching-nginscript-and-looking-ahead/
NGINX_GEOIP='y' # Nginx GEOIP module install
NGINX_GEOIPMEM='y' # Nginx caches GEOIP databases in memory (default), setting 'n' caches to disk instead
NGINX_GEOIPTWOLITE='n' # https://github.com/leev/ngx_http_geoip2_module
NGINX_SPDY='n' # Nginx SPDY support
NGINX_SPDYPATCHED='n' # Cloudflare HTTP/2 + SPDY patch https://github.com/cloudflare/sslconfig/blob/master/patches/nginx__http2_spdy.patch
NGINX_STUBSTATUS='y' # http://nginx.org/en/docs/http/ngx_http_stub_status_module.html required for nginx statistics
NGINX_SUB='y' # http://nginx.org/en/docs/http/ngx_http_sub_module.html
NGINX_ADDITION='y' # http://nginx.org/en/docs/http/ngx_http_addition_module.html
NGINX_IMAGEFILTER='y' # http://nginx.org/en/docs/http/ngx_http_image_filter_module.html
NGINX_PERL='n' # http://nginx.org/en/docs/http/ngx_http_perl_module.html
NGINX_XSLT='n' # http://nginx.org/en/docs/http/ngx_http_xslt_module.html
NGINX_LENGTHHIDE='n' # https://github.com/nulab/nginx-length-hiding-filter-module
NGINX_LENGTHHIDEGIT='y' # triggers only if NGINX_LENGTHHIDE='y'
NGINX_TESTCOOKIE='n' # https://github.com/kyprizel/testcookie-nginx-module
NGINX_TESTCOOKIEGIT='n' # triggers only if NGINX_TESTCOOKIE='y'
NGINX_CACHEPURGE='y' # https://github.com/FRiCKLE/ngx_cache_purge/
NGINX_ACCESSKEY='n' #
NGINX_HTTPCONCAT='n' # https://github.com/alibaba/nginx-http-concat
NGINX_THREADS='y' # https://www.nginx.com/blog/thread-pools-boost-performance-9x/
NGINX_SLICE='n' # https://nginx.org/en/docs/http/ngx_http_slice_module.html
NGINX_STREAM='y' # http://nginx.org/en/docs/stream/ngx_stream_core_module.html
NGINX_STREAMGEOIP='y' # nginx 1.11.3+ option http://hg.nginx.org/nginx/rev/558db057adaa
NGINX_STREAMREALIP='y' # nginx 1.11.4+ option http://hg.nginx.org/nginx/rev/9cac11efb205
NGINX_STREAMSSLPREREAD='y' # nginx 1.11.5+ option https://nginx.org/en/docs/stream/ngx_stream_ssl_preread_module.html
NGINX_RTMP='n' # Nginx RTMP Module support https://github.com/arut/nginx-rtmp-module
NGINX_FLV='n' # http://nginx.org/en/docs/http/ngx_http_flv_module.html
NGINX_MP4='n' # Nginx MP4 Module http://nginx.org/en/docs/http/ngx_http_mp4_module.html
NGINX_AUTHREQ='n' # http://nginx.org/en/docs/http/ngx_http_auth_request_module.html
NGINX_SECURELINK='y' # http://nginx.org/en/docs/http/ngx_http_secure_link_module.html
NGINX_FANCYINDEX='y' # https://github.com/aperezdc/ngx-fancyindex/releases
NGINX_FANCYINDEXVER='0.4.2' # https://github.com/aperezdc/ngx-fancyindex/releases
NGINX_VHOSTSTATS='n' # https://github.com/vozlt/nginx-module-vts
NGINX_LIBBROTLI='n' # https://github.com/eustas/ngx_brotli
NGINX_LIBBROTLISTATIC='n' # only enable if you want pre-compress brotli support and on the fly brotli disabled
NGINX_BROTLIDEP_UPDATE='n' # experimental manual update of Google Brotli dependency in ngx_brotli
NGINX_PAGESPEED='n' # Install ngx_pagespeed
NGINX_PAGESPEEDGITMASTER='n' # Install ngx_pagespeed from official github master instead
NGXPGSPEED_VER='1.13.35.2-stable'
NGINX_PAGESPEEDPSOL_VER='1.13.35.2'
NGINX_PASSENGER='n' # Install Phusion Passenger requires installing addons/passenger.sh before hand
NGINX_WEBDAV='n' # Nginx WebDAV and nginx-dav-ext-module
NGINX_EXTWEBDAVVER='0.0.3' # nginx-dav-ext-module version
NGINX_LIBATOMIC='y' # Nginx configured with libatomic support
NGINX_HTTPREDIS='y' # Nginx redis http://wiki.nginx.org/HttpRedisModule
NGINX_HTTPREDISVER='0.3.7' # Nginx redis version
NGINX_PCREJIT='y' # Nginx configured with pcre & pcre-jit support
NGINX_PCRE_DYNAMIC='y' # compile nginx pcre as dynamic instead of static library
NGINX_PCREVER='8.43' # Version of PCRE used for pcre-jit support in Nginx
NGINX_ZLIBCUSTOM='y' # Use custom zlib instead of system version
NGINX_ZLIBVER='1.2.11' # http://www.zlib.net/
NGINX_VIDEO='n' # control variable when 'y' set for NGINX_SLICE='y', NGINX_RTMP='y', NGINX_FLV='y', NGINX_MP4='y'
ORESTY_HEADERSMORE='y' # openresty headers more https://github.com/openresty/headers-more-nginx-module
ORESTY_HEADERSMOREGIT='n' # use git master instead of version specific
NGINX_HEADERSMORE='0.33'
NGINX_CACHEPURGEVER='2.5'
NGINX_STICKY='n' # nginx sticky module https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng
NGINX_STICKYVER='master'
NGINX_UPSTREAMCHECK='n' # nginx upstream check https://github.com/yaoweibin/nginx_upstream_check_module
NGINX_UPSTREAMCHECKVER='0.3.0'
NGINX_OPENRESTY='y' # Agentzh's openresty Nginx modules
ORESTY_MEMCVER='0.18' # openresty memc module https://github.com/openresty/memc-nginx-module
ORESTY_SRCCACHEVER='0.31' # openresty subrequest cache module https://github.com/openresty/srcache-nginx-module
ORESTY_DEVELKITVER='0.3.0' # openresty ngx_devel_kit module https://github.com/simpl/ngx_devel_kit
ORESTY_SETMISCGIT='n' # use git master instead of version specific
ORESTY_SETMISC='y' # openresty set-misc-nginx module https://github.com/openresty/echo-nginx-module
ORESTY_SETMISCVER='0.32' # openresty set-misc-nginx module https://github.com/openresty/set-misc-nginx-module
ORESTY_ECHOGIT='n' # use git master instead of version specific
ORESTY_ECHOVER='0.61' # openresty set-misc-nginx module https://github.com/openresty/echo-nginx-module
ORESTY_REDISVER='0.15' # openresty redis2-nginx-module https://github.com/openresty/redis2-nginx-module
LUAJIT_GITINSTALL='y' # opt to install luajit 2.1 from dev branch http://repo.or.cz/w/luajit-2.0.git/shortlog/refs/heads/v2.1
LUAJIT_GITINSTALLVER='2.1-agentzh' # branch version = v2.1 will override ORESTY_LUAGITVER if LUAJIT_GITINSTALL='y'
ORESTY_LUANGINX='n' # enable or disable or ORESTY_LUA* nginx modules below
ORESTY_LUANGINXVER='0.10.15' # openresty lua-nginx-module https://github.com/openresty/lua-nginx-module
ORESTY_LUAGITVER='2.0.5' # luagit http://luajit.org/
ORESTY_LUAMEMCACHEDVER='0.14' # openresty https://github.com/openresty/lua-resty-memcached
ORESTY_LUAMYSQLVER='0.21' # openresty https://github.com/openresty/lua-resty-mysql
ORESTY_LUAREDISVER='0.27' # openresty https://github.com/openresty/lua-resty-redis
ORESTY_LUADNSVER='0.21' # openresty https://github.com/openresty/lua-resty-dns
ORESTY_LUAUPLOADVER='0.10' # openresty https://github.com/openresty/lua-resty-upload
ORESTY_LUAWEBSOCKETVER='0.07' # openresty https://github.com/openresty/lua-resty-websocket
ORESTY_LUALOCKVER='0.08' # openresty https://github.com/openresty/lua-resty-lock
ORESTY_LUASTRINGVER='0.11rc1' # openresty https://github.com/openresty/lua-resty-string
ORESTY_LUAREDISPARSERVER='0.13' # openresty https://github.com/openresty/lua-redis-parser
ORESTY_LUAUPSTREAMCHECKVER='0.06' # openresty https://github.com/openresty/lua-resty-upstream-healthcheck
ORESTY_LUALRUCACHEVER='0.09' # openresty https://github.com/openresty/lua-resty-lrucache
ORESTY_LUARESTYCOREVER='0.1.17' # openresty https://github.com/openresty/lua-resty-core
ORESTY_LUASTREAMVER='0.0.7' # https://github.com/openresty/stream-lua-nginx-module
ORESTY_LUASTREAM='y' # control https://github.com/openresty/stream-lua-nginx-module
NGX_LUASTREAM_FORCED='y' # control stream-lua-nginx enabling for nginx 1.17+
ORESTY_LUAUPSTREAMVER='0.06' # openresty https://github.com/openresty/lua-upstream-nginx-module
NGX_LUAUPSTREAM='n' # disable https://github.com/openresty/lua-upstream-nginx-module
ORESTY_LUALOGGERSOCKETVER='0.1' # cloudflare openresty https://github.com/cloudflare/lua-resty-logger-socket
ORESTY_LUACOOKIEVER='master' # cloudflare openresty https://github.com/cloudflare/lua-resty-cookie
ORESTY_LUAUPSTREAMCACHEVER='0.1.1' # cloudflare openresty https://github.com/cloudflare/lua-upstream-cache-nginx-module
NGX_LUAUPSTREAMCACHE='n' # disable https://github.com/cloudflare/lua-upstream-cache-nginx-module
LUACJSONVER='2.1.0.7' # https://github.com/openresty/lua-cjson
STRIPPHP='y' # set 'y' to strip PHP binary to reduce size
PHP_INSTALL='y' # Install PHP /w Fast Process Manager
SWITCH_PHPFPM_SYSTEMD='y' # Switch to centos 7 systemd php-fpm service file https://community.centminmod.com/threads/16511/
ZSTD_LOGROTATE_PHPFPM='n' # initial install only for zstd compressed log rotation community.centminmod.com/threads/16371/
PHP_PATCH='y' # Apply PHP patches if they exist
PHP_TUNING='n' # initial php-fpm install auto tuning
PHP_HUGEPAGES='n' # Enable explicit huge pages support for PHP 7 on CentOS 7.x systems
PHP_CUSTOMSSL='n' # compile php-fpm against openssl 1.0.2+ or libressl 2.3+ whichever nginx uses
PHPMAKETEST=n # set to y to enable make test after PHP make for diagnostic purposes
AUTODETECPHP_OVERRIDE='n' # when enabled, php updates will always reinstall all php extensions even if minor php version
PHP_PCREJIT_STACKSIZE_ADJUST='n' # when enabled, allows you to raise PHP's default PCRE JIT stack size https://github.com/php/php-src/pull/2910
PHP_PCREJIT_STACKSIZE='512' # value to raise PHP PCRE JIT stack size when PHP_PCREJIT_STACKSIZE_ADJUST='y' set on centmin.sh menu option 5 runs
PHPGEOIP_ALWAYS='y' # GeoIP php extension is always reinstalled on php recompiles
PHPIMAGICK_ALWAYS='y' # imagick php extension is always reinstalled on php recompiles
PHPDEBUGMODE='n' # --enable-debug PHP compile flag
PHPIMAP='y' # Disable or Enable PHP Imap extension
PHPFINFO='n' # Disable or Enable PHP File Info extension
PHPFINFO_STANDALONE='n' # Disable or Enable PHP File Info extension as standalone module
PHPPCNTL='y' # Disable or Enable PHP Process Control extension
PHPINTL='y' # Disable or Enable PHP intl extension
PHPRECODE=n # Disable or Enable PHP Recode extension
PHPSNMP='y' # Disable or Enable PHP SNMP extension
PHPIMAGICK='y' # Disable or Enable PHP ImagicK extension
PHPMAILPARSE='y' # Disable or Enable PHP mailparse extension
PHPIONCUBE='n' # Disable or Enable Ioncube Loader via addons/ioncube.sh
PHPMSSQL='n' # Disable or Enable MSSQL server PHP extension
PHPTIMEZONEDB='y' # timezonedb PHP extension updated https://pecl.php.net/package/timezonedb
PHPTIMEZONEDB_VER='2019.3' # timezonedb PHP extension version
PHPMSSQL_ALWAYS='n' # mssql php extension always install on php recompiles
PHPEMBED='y' # built php with php embed SAPI library support --enable-embed=shared
PHP_FTPEXT='y' # ftp PHP extension
PHP_MEMCACHE='y' # memcache PHP extension
PHP_MEMCACHED='y' # memcached PHP extension
FFMPEGVER='0.6.0'
SUHOSINVER='0.9.38'
PHPREDIS='y' # redis PHP extension install
REDISPHP_VER='4.3.0' # redis PHP version for PHP <7.x
REDISPHPSEVEN_VER='5.1.1' # redis PHP version for PHP =>7.x
REDISPHP_GIT='n' # pull php 7 redis extension from git or pecl downloads
PHPMONGODB='n' # MongoDB PHP extension install
MONGODBPHP_VER='1.6.1' # MongoDB PHP version
MONGODB_SASL='n' # SASL not working yet leave = n
PDOPGSQL_PHPVER='11' # pdo-pgsql PHP extension version for postgresql
PHP_LIBZIP='n' # use newer libzip instead of PHP embedded zip
PHP_ARGON='n' # alias for PHP_LIBZIP, when PHP_ARGON='y' then PHP_LIBZIP='y'
LIBZIP_VER='1.5.2' # required for PHP 7.2 + with libsodium & argon2
LIBSODIUM_VER='1.0.18' # https://github.com/jedisct1/libsodium/releases
LIBSODIUM_NATIVE='n' # optimise for specific cpu not portable between different cpu modules
LIBARGON_VER='20171227' # https://github.com/P-H-C/phc-winner-argon2
PHP_MCRYPTPECL='y' # PHP 7.2 deprecated mcrypt support so this adds it back as PECL extension
PHP_MCRYPTPECLVER='1.0.1' # https://pecl.php.net/package/mcrypt
PHPZOPFLI='n' # enable zopfli php extension https://github.com/kjdev/php-ext-zopfli
PHPZOPFLI_ALWAYS='n' # zopfli php extension always install on php recompiles
PHP_BROTLI='n' # brotli php extension https://github.com/kjdev/php-ext-brotli
PHP_LZFOUR='n' # lz4 php extension https://github.com/kjdev/php-ext-lz4
PHP_LZF='n' # lzf php extension https://github.com/php/pecl-file_formats-lzf php-ext-lzf
PHP_ZSTD='n' # zstd php extension https://github.com/kjdev/php-ext-zstd
SHORTCUTS='y' # shortcuts
POSTGRESQL='n' # set to =y to install PostgreSQL 9.6 server, devel packages and pdo-pgsql PHP extension
POSTGRESQL_BRANCHVER='11' # PostgresSQL branch version https://www.postgresql.org/ i.e. 9.6, 10 or 11
########################################################
# Choice of installing MariaDB 5.2 via RPM or via MariaDB 5.2 CentOS YUM Repo
# If MDB_YUMREPOINSTALL=y and MDB_INSTALL=n then MDB_VERONLY version
# number won't have any effect in determining version of MariaDB 5.2.x to install.
# YUM Repo will install whatever is latest MariaDB 5.2.x version available via the YUM REPO
# MariaDB MySQL default client and server character set utf8 or utf8mb4 options
# only applies during initial Centmin Mod install and can be overrident via
# persistent config file /etc/centminmod/custom_config.inc prior to initial Centmin Mod install
SET_DEFAULT_MYSQLCHARSET='utf8'
MDB_INSTALL='n' # Install via RPM MariaDB MySQL Server replacement (Not recommended for VPS with less than 256MB RAM!)
MDB_YUMREPOINSTALL='y' # Install MariaDB 5.5 via CentOS YUM Repo
MARIADB_INSTALLTENTWO='n' # MariaDB 10.2 YUM default install if set to yes
MARIADB_INSTALLTENTHREE='y' # MariaDB 10.3 YUM default install if set to yes
MARIADB_INSTALLTENFOUR='n' # MariaDB 10.4 YUM default install if set to yes
# Define current MariaDB version
MDB_VERONLY='5.2.14'
MDB_BUILD='122'
MDB_VERSION="${MDB_VERONLY}-${MDB_BUILD}" # Use this version of MariaDB ${MDB_VERONLY}
# Define previous MariaDB version for proper upgrade
MDB_PREVERONLY='5.2.12'
MDB_PREBUILD='115'
MDB_PREVERSION="${MDB_PREVERONLY}-${MDB_PREBUILD}" # Use this version of MariaDB ${MDB_VERONLY}
########################################################
# Optionally, if you want to install MariaDB instead of standard MySQL you can do.
# Set MDB_INSTALL=y and MYSQL_INSTALL='n'
MYSQL_INSTALL='n' # Install official Oracle MySQL Server (MariaDB alternative recommended)
SENDMAIL_INSTALL='n' # Install Sendmail (and mailx) set to y and POSTFIX_INSTALL=n for sendmail
POSTFIX_INSTALL=y # Install Postfix (and mailx) set to n and SENDMAIL_INSTALL=y for sendmail
# Nginx
NGINX_VERSION='1.17.6' # Use this version of Nginx
NGINX_VHOSTSSL='y' # enable centmin.sh menu 2 prompt to create self signed SSL vhost 2nd vhost conf
NGINXBACKUP='y'
NGINXCPU_AUTOTUNE_NEW='y' # revised nginx worker_proccess auto tuned settings for >12 cpu thread based servers
ZSTD_LOGROTATE_NGINX='n' # initial install only for zstd compressed log rotation community.centminmod.com/threads/16371/
VHOST_PRESTATICINC='y' # add pre-staticfiles-local.conf & pre-staticfiles-global.conf include files
NGINXDIR='/usr/local/nginx'
NGINXCONFDIR="${NGINXDIR}/conf"
NGINXBACKUPDIR='/usr/local/nginxbackup'
# control variables post vhost creation
# whether cloudflare.conf include file is uncommented (enabled) or commented out (disabled)
VHOSTCTRL_CLOUDFLAREINC='n'
# whether autoprotect-$vhostname.conf include file is uncommented (enabled) or commented out (disabled)
VHOSTCTRL_AUTOPROTECTINC='y'
##################################
## Nginx SSL options
# OpenSSL
NGINX_PRIORITIZECHACHA='n' # https://community.centminmod.com/posts/67042/
DISABLE_TLSONEZERO_PROTOCOL='n' # disable TLS 1.0 protocol by default industry is moving to deprecate for security
NOSOURCEOPENSSL='y' # set to 'y' to disable OpenSSL source compile for system default YUM package setup
OPENSSL_VERSION='1.1.1d' # Use this version of OpenSSL http://openssl.org/
OPENSSL_VERSIONFALLBACK='1.1.1d' # fallback if OPENSSL_VERSION uses openssl 1.1.x branch
OPENSSL_VERSION_OLDOVERRIDE='1.1.1d' # override version if persist config OPENSSL_VERSION variable is out of date
OPENSSL_THREADS='y' # control whether openssl 1.1 branch uses threading or not
OPENSSL_TLSONETHREE='y' # whether OpenSSL 1.1.1 builds enable TLSv1.3
OPENSSL_CUSTOMPATH='/opt/openssl' # custom directory path for OpenSSL 1.0.2+
CLOUDFLARE_PATCHSSL='n' # set 'y' to implement Cloudflare's chacha20 patch https://github.com/cloudflare/sslconfig
CLOUDFLARE_ZLIB='y' # use Cloudflare optimised zlib fork https://blog.cloudflare.com/cloudflare-fights-cancer/
CLOUDFLARE_ZLIB_DYNAMIC='y' # compile nginx CF zlib as a dynamically instead of statically
CLOUDFLARE_ZLIB_OPENSSL='n' # compile dynamically custom OpenSSL against Cloudflare zlib library
CLOUDFLARE_ZLIBRESET='y' # if CLOUDFLARE_ZLIB='n' set, then revert gzip compression level from 9 to 5 automatically
CLOUDFLARE_ZLIBRAUTOMAX='n' # don't auto raise nginx gzip compression level to 9 if using Cloudflare zlib
CLOUDFLARE_ZLIBPHP='n' # use Cloudflare optimised zlib fork for PHP-FPM zlib instead of system zlib
CLOUDFLARE_ZLIBDEBUG='n' # make install debug verbose mode
CLOUDFLARE_ZLIBVER='1.3.0'
NGINX_DYNAMICTLS='n' # set 'y' and recompile nginx https://blog.cloudflare.com/optimizing-tls-over-tcp-to-reduce-latency/
OPENSSLECDSA_PATCH='n' # https://community.centminmod.com/posts/57725/
OPENSSLECDHX_PATCH='n' # https://community.centminmod.com/posts/57726/
OPENSSLEQUALCIPHER_PATCH='n' # https://community.centminmod.com/posts/57916/
PRIORITIZE_CHACHA_OPENSSL='n' # https://community.centminmod.com/threads/15708/
# LibreSSL
LIBRESSL_SWITCH='n' # if set to 'y' it overrides OpenSSL as the default static compiled option for Nginx server
LIBRESSL_VERSION='3.0.2' # Use this version of LibreSSL http://www.libressl.org/
# BoringSSL
# not working yet just prep work
BORINGSSL_SWITCH='n' # if set to 'y' it overrides OpenSSL as the default static compiled option for Nginx server
BORINGSSL_SHARED='y' # build boringssl as shared library so nginx can dynamically compile boringssl
BORINGSSL_DIR="/opt"
##################################
# Choose whether to compile Nginx --with-google_perftools_module
# no longer used in Centmin Mod v1.2.3-eva2000.01 and higher
GPERFTOOLS_SOURCEINSTALL='n'
GPERFTOOLS_TMALLOCLARGEPAGES='y' # set larger page size for tcmalloc --with-tcmalloc-pagesize=32
LIBUNWIND_VERSION='1.2.1' # note google perftool specifically requies v0.99 and no other
GPERFTOOLS_VERSION='2.6.3' # Use this version of google-perftools
# Choose whether to compile PCRE from source. Note PHP 5.3.8 already includes PCRE
PCRE_SOURCEINSTALL='n'
PCRE_VERSION='8.43' # PCRE version
# PHP and Cache/Acceleration
IMAGICKPHP_VER='3.4.4' # PHP extension for imagick
MAILPARSEPHP_VER='2.1.6' # https://pecl.php.net/package/mailparse
MAILPARSEPHP_COMPATVER='3.0.2' # For PHP 7
MEMCACHED_INSTALL='y' # Install Memcached
LIBEVENT_VERSION='2.1.8' # Use this version of Libevent
MEMCACHED_VERSION='1.5.20' # Use this version of Memcached server
MEMCACHED_TLS='n' # TLS support https://github.com/memcached/memcached/wiki/ReleaseNotes1513
MEMCACHE_VERSION='3.0.8' # Use this version of Memcache
MEMCACHEDPHP_VER='2.2.0' # Memcached PHP extension not server
MEMCACHEDPHP_SEVENVER='3.1.5' # Memcached PHP 7 only extension version
LIBMEMCACHED_YUM='y' # switch to YUM install instead of source compile
LIBMEMCACHED_VER='1.0.18' # libmemcached version for source compile
TWEMPERF_VER='0.1.1'
PHP_OVERWRITECONF='y' # whether to show the php upgrade prompt to overwrite php-fpm.conf
PHP_VERSION='5.6.40' # Use this version of PHP
PHP_MIRRORURL='https://www.php.net'
PHPUPGRADE_MIRRORURL="$PHP_MIRRORURL"
XCACHE_VERSION='3.2.0' # Use this version of Xcache
APCCACHE_VERSION='3.1.13' # Use this version of APC Cache
IGBINARY_VERSION='1.2.1'
IGBINARY_INSTALL='y' # install or not igbinary support for APC and Memcached server
IGBINARYGIT='y'
ZOPCACHEDFT='y'
ZOPCACHECACHE_VERSION='7.0.5' # for PHP <=5.4 https://pecl.php.net/package/ZendOpcache
ZOPCACHE_OVERRIDE='n' # =y will override PHP 5.5, 5.6, 7.0 inbuilt Zend OpCache version
# Python
PYTHON_VERSION='2.7.10' # Use this version of Python
SIEGE_VERSION='4.0.4'
CURL_TIMEOUTS=' --max-time 5 --connect-timeout 5'
WGETOPT="-cnv --no-dns-cache${ipv_forceopt_wget}"
AXEL_VER='2.6' # Axel source compile version https://github.com/axel-download-accelerator/axel/releases
USEAXEL='y' # whether to use axel download accelerator or wget
###############################################################
# experimental Intel compiled optimisations
# when auto detect Intel based processors
INTELOPT='n'
# GCC optimization level choices: -O2 or -O3 or -Ofast (only for GCC via CLANG=n)
GCC_OPTLEVEL='-O3'
# https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
# enabled will set -falign-functions=32 for GCC compiles of Nginx and PHP-FPM and pigz
GCC_FALIGN_FUNCTION='n'
# experimental custom RPM compiled packages to replace source
# compiled versions for 64bit systems only
FPMRPM_LIBEVENT='n'
FPMRPM_MEMCACHED='n'
CENTALTREPO_DISABLE='y'
RPMFORGEREPO_DISABLE='n'
AXIVOREPO_DISABLE='y'
REMIREPO_DISABLE='n'
ATRPMSREPO_DISABLE='y'
VARNISHREPO_DISABLE='y'
# custom curl/libcurl RPM for 7.44 and higher
# enable with CUSTOM_CURLRPM='y'
# use at own risk as it can break the system
# info at http://mirror.city-fan.org/ftp/contrib/sysutils/Mirroring/
CUSTOM_CURLRPM='n'
CUSTOM_CURLRPMVER='7.47.1-2.0' # custom curl/libcurl version
CUSTOM_CURLLIBSSHVER='1.6.0-4.0' # libssh2 version
CUSTOM_CURLRPMCARESVER='1.10.0-6.0' # c-ares version
CUSTOM_CURLRPMSYSURL='http://mirror.city-fan.org/ftp/contrib/sysutils/Mirroring'
CUSTOM_CURLRPMLIBURL='http://mirror.city-fan.org/ftp/contrib/libraries'
# wget source compile version
WGET_VERSION='1.20.3'
WGET_VERSION_SEVEN='1.20.3'
###############################################################
# cloudflare authenticated origin pull cert
# setup https://community.centminmod.com/threads/13847/
CLOUDFLARE_AUTHORIGINPULLCERT='https://support.cloudflare.com/hc/en-us/article_attachments/201243967/origin-pull-ca.pem'
VHOST_CFAUTHORIGINPULL='y'
###############################################################
# Settings for centmin.sh menu option 2 and option 22 for
# the details of the self-signed SSL certificate that is auto
# generated. The default values where vhostname variable is
# auto added based on what you input for your site name
#
# -subj "/C=US/ST=California/L=Los Angeles/O=${vhostname}/OU=${vhostname}/CN=${vhostname}"
#
# You can only customise the first 5 variables for
# C = Country 2 digit code
# ST = state
# L = Location as in city
# 0 = organisation
# OU = organisational unit
#
# if left blank # defaults to same as vhostname that is your domain
# if set it overrides that
SELFSIGNEDSSL_C='US'
SELFSIGNEDSSL_ST='California'
SELFSIGNEDSSL_L='Los Angeles'
SELFSIGNEDSSL_O=''
SELFSIGNEDSSL_OU=''
###############################################################
# centmin.sh menu option 22 specific options
WPPLUGINS_ALL='n' # do not install additional plugins
WPCLI_SUPERCACHEPLUGIN='n' # https://community.centminmod.com/threads/5102/
###############################################################
# php configured --with-mysql-sock=${PHP_MYSQLSOCKPATH}/mysql.sock
PHP_MYSQLSOCKPATH='/var/lib/mysql'
###############################################################
# Letsencrypt integration via addons/acmetool.sh auto detection
# in centmin.sh menu option 2, 22, and /usr/bin/nv nginx vhost
# generators. You can control whether or not to enable or disable
# integration detection in these menu options
LETSENCRYPT_DETECT='n'
###############################################################
MACHINE_TYPE=$(uname -m) # Used to detect if OS is 64bit or not.
if [ "${ARCH_OVERRIDE}" ]; then
ARCH=${ARCH_OVERRIDE}
else
if [ "${MACHINE_TYPE}" == 'x86_64' ]; then
ARCH='x86_64'
MDB_ARCH='amd64'
else
ARCH='i386'
fi
fi
if [[ "$CENTOS_SEVEN" -eq '7' ]]; then
AXEL_VER='2.16.1'
fi
if [[ "$CENTOS_SIX" -eq '6' ]]; then
# disable axel due to issues with php.net new cdn download system
# https://community.centminmod.com/posts/72398/
USEAXEL='n'
fi
# ensure clang alternative to gcc compiler is used only for 64bit OS
# if [[ "$(uname -m)" != 'x86_64' ]]; then
# CLANG='n'
# fi
if [[ "$1" = 'install' ]]; then
INITIALINSTALL='y'
export INITIALINSTALL='y'
fi
# source "inc/mainmenu.inc"
# source "inc/mainmenu_cli.inc"
# source "inc/ramdisk.inc"
source "inc/fastmirrors.conf"
source "inc/qrencode.inc"
source "inc/tcp.inc"
source "inc/customrpms.inc"
source "inc/pureftpd.inc"
source "inc/htpasswdsh.inc"
source "inc/gcc.inc"
source "inc/entropy.inc"
source "inc/cpucount.inc"
source "inc/motd.inc"
source "inc/cpcheck.inc"
source "inc/lowmem.inc"
source "inc/memcheck.inc"
source "inc/ccache.inc"
source "inc/bookmark.inc"
source "inc/centminlogs.inc"
source "inc/yumskip.inc"
source "inc/questions.inc"
source "inc/downloads_centosfive.inc"
source "inc/downloads_centossix.inc"
source "inc/downloads_centosseven.inc"
source "inc/downloadlinks.inc"
source "inc/libzip.inc"
source "inc/downloads.inc"
source "inc/yumpriorities.inc"
source "inc/yuminstall.inc"
source "inc/centoscheck.inc"
source "inc/axelsetup.inc"
source "inc/phpfpmdir.inc"
source "inc/nginx_backup.inc"
source "inc/nsd_submenu.inc"
source "inc/nsd_install.inc"
source "inc/nsdsetup.inc"
source "inc/nsd_reinstall.inc"
source "inc/compress.inc"
source "inc/compress_php.inc"
source "inc/nginx_logformat.inc"
source "inc/logrotate_nginx.inc"
source "inc/logrotate_phpfpm.inc"
source "inc/logrotate_mysql.inc"
source "inc/nginx_mimetype.inc"
source "inc/openssl_install.inc"
source "inc/brotli.inc"
source "inc/nginx_patch.inc"
source "inc/fastopen.inc"
source "inc/mod_security.inc"
source "inc/nginx_configure.inc"
# source "inc/nginx_configure_openresty.inc"
source "inc/geoip.inc"
source "inc/luajit.inc"
source "inc/phpinfo.inc"
source "inc/nginx_install.inc"
source "inc/nginx_upgrade.inc"
source "inc/mailparse.inc"
source "inc/imagick_install.inc"
source "inc/memcached_install.inc"
source "inc/redis_submenu.inc"
source "inc/redis.inc"
source "inc/mongodb.inc"
source "inc/zopfli.inc"
source "inc/php_mssql.inc"
source "inc/mysql_proclimit.inc"
source "inc/mysqltmp.inc"
source "inc/setmycnf.inc"
source "inc/mariadb_install102.inc"