-
Notifications
You must be signed in to change notification settings - Fork 0
/
lnmp.sh
543 lines (489 loc) · 19.1 KB
/
lnmp.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
#!/bin/bash
# 变量配置列表
profile_path='/etc/profile'
custom_setting_file='/etc/my_custom_profile'
# 软件源列表
## 本地软件包列表
cmd_dir="$( cd "$( dirname $0 )" && pwd )"
local_nginx_source="${cmd_dir}/packages/nginx-1.10.3.tar.gz"
local_mysql_common_source="${cmd_dir}/packages/mysql-5.7.16/mysql-community-common-5.7.16-1.el6.x86_64.rpm"
local_mysql_libs_compat_source="${cmd_dir}/packages/mysql-5.7.16/mysql-community-libs-compat-5.7.16-1.el6.x86_64.rpm"
local_mysql_libs_source="${cmd_dir}/packages/mysql-5.7.16/mysql-community-libs-5.7.16-1.el6.x86_64.rpm"
local_mysql_server_source="${cmd_dir}/packages/mysql-5.7.16/mysql-community-server-5.7.16-1.el6.x86_64.rpm"
local_mysql_client_source="${cmd_dir}/packages/mysql-5.7.16/mysql-community-client-5.7.16-1.el6.x86_64.rpm"
local_php_source="${cmd_dir}/packages/php-5.6.30.tar.gz"
local_php_ext_redis_source="${cmd_dir}/packages/php-ext/redis-2.2.7.tgz"
local_php_ext_memcache_source="${cmd_dir}/packages/php-ext/memcache-2.2.7.tgz"
local_php_ext_igbinary_source="${cmd_dir}/packages/php-ext/igbinary-1.2.1.tgz"
local_php_ext_swoole_source="${cmd_dir}/packages/php-ext/swoole-v1.9.2-stable.tar.gz"
local_php_ext_mongo_source="${cmd_dir}/packages/php-ext/mongo-1.6.13.tgz"
local_php_ext_mongodb_source="${cmd_dir}/packages/php-ext/mongodb-1.1.5.tgz"
## 远程源列表
nginx_source='https://nginx.org/download/nginx-1.10.3.tar.gz'
mysql_source='http://repo.mysql.com//mysql57-community-release-el6-9.noarch.rpm'
php_source='http://cn2.php.net/distributions/php-5.6.30.tar.gz'
php_ext_redis_source='http://pecl.php.net/get/redis-2.2.7.tgz'
php_ext_memcache_source='http://pecl.php.net/get/memcache-2.2.7.tgz'
php_ext_igbinary_source='http://pecl.php.net/get/igbinary-1.2.1.tgz'
php_ext_swoole_source='https://github.com/swoole/swoole-src/archive/v1.9.2-stable.tar.gz'
php_ext_mongo_source='http://pecl.php.net/get/mongo-1.6.13.tgz'
php_ext_mongodb_source='http://pecl.php.net/get/mongodb-1.1.5.tgz'
# 软件包下载路径
source_download_path='/tmp/lnmp-tmp'
# nginx 安装路径
nginx_prefix='/usr/local/nginx'
# php 安装路径
php_prefix='/usr/local/php'
# mysql安装路径
mysql_prefix='/usr/local/mysql'
# 定义一些安装标记变量
install_var_init(){
start_time=`date +'%Y-%m-%d %H:%M:%S'`
status_nginx_install='×'
status_php_install='×'
status_php_redis_install='×'
status_php_memcache_install='×'
status_php_igbinary_install='×'
status_php_swoole_install='×'
status_php_mongo_install='×'
status_php_mongodb_install='×'
status_mysql_install='×'
}
install_info(){
echo -e "\r\n\E[1;33m==============安装列表================\e[0m";
echo -e "\E[1;33m= nginx \e[0m";
echo -e "\E[1;33m= php \e[0m";
echo -e "\E[1;33m= php-redis \e[0m";
echo -e "\E[1;33m= php-memcache \e[0m";
echo -e "\E[1;33m= php-igbinary \e[0m";
echo -e "\E[1;33m= php-swoole \e[0m";
echo -e "\E[1;33m= php-mongo \e[0m";
echo -e "\E[1;33m= php-mongodb \e[0m";
echo -e "\E[1;33m= mysql \e[0m";
echo -e "\E[1;33m======================================\r\n\e[0m";
}
install_yum_init(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r\n";
yum install -y epel-release \
wget \
libmcrypt \
libmcrypt-devel \
mcrypt \
mhash \
lrzsz \
gcc \
gcc-c++ \
autoconf \
libjpeg \
libjpeg-devel \
libpng \
libpng-devel \
freetype \
freetype-devel \
libxml2 \
libxml2-devel \
zlib \
zlib-devel \
glibc \
glibc-devel \
glib2 \
glib2-devel \
bzip2 \
bzip2-devel \
ncurses \
ncurses-devel \
curl \
curl-devel \
e2fsprogs \
e2fsprogs-devel \
krb5 \
krb5-devel \
libidn \
libidn-devel \
openssl \
openssl-devel \
openldap \
openldap-devel \
nss_ldap \
openldap-clients \
openldap-servers \
gd \
gd2 \
gd-devel \
gd2-devel \
perl-CPAN \
pcre-devel \
libmcrypt \
libmcrypt-devel \
mcrypt \
git \
mhash \
numactl \
ca-certificates \
postfix
yum update -y
if [ ! -d "${source_download_path}" ]; then
`mkdir ${source_download_path}`
fi
if [ ! -d "${custom_setting_file}" ]; then
touch ${custom_setting_file}
fi
profile_count=`cat ${profile_path} | grep '/etc/my_custom_profile' | wc -l`
if [ ${profile_count} -le 0 ]; then
echo "#加载自定义配置文件" >> ${profile_path}
echo "if [ -f ${custom_setting_file} ]; then
. ${custom_setting_file}
fi" >> ${profile_path}
fi
desc_content='echo -e "\\r\\n\\E[1;33m load '${custom_setting_file}' file.\\E[0m\\r\\n";'
desc_count=`cat ${custom_setting_file} | grep 'load /etc/my_custom_profile' | wc -l`
if [ ${desc_count} -le 0 ]; then
`echo -e ${desc_content} >> ${custom_setting_file}`
fi
}
install_nginx(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r\n";
version_nginx=`basename ${nginx_source} | sed -r 's/^(.*)\..*$/\1/g' | sed -r 's/^(.*)\..*$/\1/g'`
cd ${source_download_path}
if [ -f ${local_nginx_source} ]; then
echo -e "\r\n\E[1;33m local install...\E[0m\r"
cp ${local_nginx_source} nginx.tar.gz
else
echo -e "\r\n\E[1;33m remote install...\E[0m\r"
wget -O nginx.tar.gz ${nginx_source}
fi
tar -zvx -f nginx.tar.gz
cd ${source_download_path}/${version_nginx}
./configure --prefix=${nginx_prefix} --with-http_ssl_module && make && make install
nginx_sbin_count=`cat ${custom_setting_file} | grep "export PATH=/usr/local/nginx/sbin:"'$PATH' | wc -l`
if [ ${nginx_sbin_count} -le 0 ]; then
echo "export PATH=/usr/local/nginx/sbin:"'$PATH' >> ${custom_setting_file}
fi
source ${profile_path}
include_count=`cat /usr/local/nginx/conf/nginx.conf | grep 'include[ ]*vhost/\*.conf' | wc -l`
if [ ${include_count} -le 0 ]; then
nginx_conf_line_count=`cat ${nginx_prefix}/conf/nginx.conf | wc -l`
sed "${nginx_conf_line_count} iinclude vhost/*.conf;" -i ${nginx_prefix}/conf/nginx.conf
fi
restart_nginx
if [ $? -eq 0 ]; then
status_nginx_install='√'
fi
echo -e "\r\n\E[1;33m ${FUNCNAME} success!\E[0m\r\n";
}
install_php(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r\n";
cd ${source_download_path}
version_php=`basename ${php_source} | sed -r 's/^(.*)\..*$/\1/g' | sed -r 's/^(.*)\..*$/\1/g'`
if [ -f ${local_php_source} ]; then
echo -e "\r\n\E[1;33m local install...\E[0m\r"
cp ${local_php_source} php.tar.gz
else
echo -e "\r\n\E[1;33m remote install...\E[0m\r"
`wget -O php.tar.gz ${php_source}`
fi
`tar -zvx -f php.tar.gz`
cd ${source_download_path}/${version_php}
./configure --prefix=${php_prefix} --with-config-file-path=/etc/php \
--enable-fpm \
--enable-pcntl \
--enable-mysqlnd \
--enable-opcache \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-shmop \
--enable-zip \
--enable-ftp \
--enable-soap \
--enable-xml \
--enable-mbstring \
--disable-rpath \
--disable-debug \
--disable-fileinfo \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-pcre-regex \
--with-iconv \
--with-zlib \
--with-mcrypt \
--with-gd \
--with-openssl \
--with-mhash \
--with-xmlrpc \
--with-curl \
--with-imap-ssl && make && make install
php_bin_count=`cat ${custom_setting_file} | grep "export PATH=${php_prefix}/bin:"'$PATH' | wc -l`
if [ ${php_bin_count} -le 0 ]; then
echo "export PATH=${php_prefix}/bin:"'$PATH' >> ${custom_setting_file}
fi
php_sbin_count=`cat ${custom_setting_file} | grep "export PATH=${php_prefix}/sbin:"'$PATH' | wc -l`
if [ ${php_sbin_count} -le 0 ]; then
echo "export PATH=${php_prefix}/sbin:"'$PATH' >> ${custom_setting_file}
fi
source ${profile_path}
if [ ! -d "/etc/php" ]; then
`mkdir /etc/php`
fi
if [ ! -d "/etc/php/php.ini" ]; then
cp ${source_download_path}/${version_php}/php.ini-development /etc/php/php.ini
fi
if [ ! -d "${php_prefix}/etc/php-fpm.conf" ]; then
cp ${php_prefix}/etc/php-fpm.conf.default ${php_prefix}/etc/php-fpm.conf
fi
restart_php_fpm
if [ $? -eq 0 ]; then
status_php_install='√'
fi
echo -e "\r\n\E[1;33m ${FUNCNAME} success!\E[0m\r\n";
}
install_php_extend_redis(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r";
cd ${source_download_path}
version_php_redis=`basename ${php_ext_redis_source} | sed -r 's/^(.*)\..*$/\1/g' `
if [ -f ${local_php_ext_redis_source} ]; then
echo -e "\r\n\E[1;33m local install...\E[0m\r"
cp ${local_php_ext_redis_source} php_redis.tar.gz
else
echo -e "\r\n\E[1;33m remote install...\E[0m\r"
`wget -O php_redis.tar.gz ${php_ext_redis_source}`
fi
`tar -zvx -f php_redis.tar.gz`
cd ${source_download_path}/${version_php_redis}
source ${profile_path}
${php_prefix}/bin/phpize && ./configure --prefix=${php_prefix} && make && make install
redis_so_count=`cat /etc/php/php.ini | grep 'extension=redis.so' | wc -l`
if [ ${redis_so_count} -le 0 ]; then
echo "extension=redis.so" >> /etc/php/php.ini
fi
restart_php_fpm
if [ $? -eq 0 ]; then
status_php_redis_install='√'
fi
echo -e "\r\n\E[1;33m ${FUNCNAME} success!\E[0m\r\n";
}
install_php_extend_swoole(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r";
cd ${source_download_path}
if [ ! -d "${source_download_path}/php_swoole" ]; then
mkdir ${source_download_path}/php_swoole
fi
version_php_swoole=`basename ${php_ext_swoole_source} | sed -r 's/^(.*)\..*$/\1/g' | sed -r 's/^(.*)\..*$/\1/g' `
if [ -f ${local_php_ext_swoole_source} ]; then
echo -e "\r\n\E[1;33m local install...\E[0m\r"
cp ${local_php_ext_swoole_source} php_swoole.tar.gz
else
echo -e "\r\n\E[1;33m remote install...\E[0m\r"
`wget -O php_swoole.tar.gz ${php_ext_swoole_source}`
fi
`tar -zvx -C ${source_download_path}/php_swoole -f php_swoole.tar.gz`
cd ${source_download_path}/php_swoole
swoole_src_dir=`ls`
cd ${source_download_path}/php_swoole/${swoole_src_dir}
${php_prefix}/bin/phpize && ./configure --prefix=${php_prefix} && make && make install
swoole_so_count=`cat /etc/php/php.ini | grep 'extension=swoole.so' | wc -l`
if [ ${swoole_so_count} -le 0 ]; then
echo "extension=swoole.so" >> /etc/php/php.ini
fi
source ${profile_path}
restart_php_fpm
if [ $? -eq 0 ]; then
status_php_swoole_install='√'
fi
echo -e "\r\n\E[1;33m ${FUNCNAME} success!\E[0m\r\n";
}
install_php_extend_igbinary(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r";
cd ${source_download_path}
version_php_igbinary=`basename ${php_ext_igbinary_source} | sed -r 's/^(.*)\..*$/\1/g' `
if [ -f ${local_php_ext_igbinary_source} ]; then
echo -e "\r\n\E[1;33m local install...\E[0m\r"
cp ${local_php_ext_igbinary_source} php_igbinary.tgz
else
echo -e "\r\n\E[1;33m remote install...\E[0m\r"
`wget -O php_igbinary.tgz ${php_ext_igbinary_source}`
fi
`tar -zvx -f php_igbinary.tgz`
cd ${source_download_path}/${version_php_igbinary}
source ${profile_path}
${php_prefix}/bin/phpize && ./configure --prefix=${php_prefix} && make && make install
igbinary_so_count=`cat /etc/php/php.ini | grep 'extension=igbinary.so' | wc -l`
if [ ${igbinary_so_count} -le 0 ]; then
echo "extension=igbinary.so" >> /etc/php/php.ini
fi
restart_php_fpm
if [ $? -eq 0 ]; then
status_php_igbinary_install='√'
fi
echo -e "\r\n\E[1;33m ${FUNCNAME} success!\E[0m\r\n";
}
install_php_extend_memcache(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r";
cd ${source_download_path}
version_php_memcache=`basename ${php_ext_memcache_source} | sed -r 's/^(.*)\..*$/\1/g' `
if [ -f ${local_php_ext_memcache_source} ]; then
echo -e "\r\n\E[1;33m local install...\E[0m\r"
cp ${local_php_ext_memcache_source} php_memcache.tgz
else
echo -e "\r\n\E[1;33m remote install...\E[0m\r"
`wget -O php_memcache.tgz ${php_ext_memcache_source}`
fi
`tar -zvx -f php_memcache.tgz`
cd ${source_download_path}/${version_php_memcache}
source ${profile_path}
${php_prefix}/bin/phpize && ./configure --prefix=${php_prefix} && make && make install
memcache_so_count=`cat /etc/php/php.ini | grep 'extension=memcache.so' | wc -l`
if [ ${memcache_so_count} -le 0 ]; then
echo "extension=memcache.so" >> /etc/php/php.ini
fi
restart_php_fpm
if [ $? -eq 0 ]; then
status_php_memcache_install='√'
fi
echo -e "\r\n\E[1;33m ${FUNCNAME} success!\E[0m\r\n";
}
install_php_extend_mongo(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r";
cd ${source_download_path}
version_php_mongo=`basename ${php_ext_mongo_source} | sed -r 's/^(.*)\..*$/\1/g' `
if [ -f ${local_php_ext_mongo_source} ]; then
echo -e "\r\n\E[1;33m local install...\E[0m\r"
cp ${local_php_ext_mongo_source} php_mongo.tgz
else
echo -e "\r\n\E[1;33m remote install...\E[0m\r"
`wget -O php_mongo.tgz ${php_ext_mongo_source}`
fi
`tar -zvx -f php_mongo.tgz`
cd ${source_download_path}/${version_php_mongo}
source ${profile_path}
${php_prefix}/bin/phpize && ./configure --prefix=${php_prefix} && make && make install
mongo_so_count=`cat /etc/php/php.ini | grep 'extension=mongo.so' | wc -l`
if [ ${mongo_so_count} -le 0 ]; then
echo "extension=mongo.so" >> /etc/php/php.ini
fi
restart_php_fpm
if [ $? -eq 0 ]; then
status_php_mongo_install='√'
fi
echo -e "\r\n\E[1;33m ${FUNCNAME} success!\E[0m\r\n";
}
install_php_extend_mongodb(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r";
cd ${source_download_path}
version_php_mongodb=`basename ${php_ext_mongodb_source} | sed -r 's/^(.*)\..*$/\1/g' `
if [ -f ${local_php_ext_mongodb_source} ]; then
echo -e "\r\n\E[1;33m local install...\E[0m\r"
cp ${local_php_ext_mongodb_source} php_mongodb.tgz
else
echo -e "\r\n\E[1;33m remote install...\E[0m\r"
`wget -O php_mongodb.tgz ${php_ext_mongodb_source}`
fi
`tar -zvx -f php_mongodb.tgz`
cd ${source_download_path}/${version_php_mongodb}
source ${profile_path}
${php_prefix}/bin/phpize && ./configure --prefix=${php_prefix} && make && make install
mongodb_so_count=`cat /etc/php/php.ini | grep 'extension=mongodb.so' | wc -l`
if [ ${mongodb_so_count} -le 0 ]; then
echo "extension=mongodb.so" >> /etc/php/php.ini
fi
restart_php_fpm
if [ $? -eq 0 ]; then
status_php_mongodb_install='√'
fi
echo -e "\r\n\E[1;33m ${FUNCNAME} success!\E[0m\r\n";
}
install_mysql(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r";
`rpm -qa|grep mysql | xargs rpm -e --nodeps`
echo ${local_mysql_common_source}
echo ${local_mysql_libs_compat_source}
echo ${local_mysql_libs_source}
echo ${local_mysql_server_source}
echo ${local_mysql_client_source}
if [ -f ${local_mysql_common_source} ] && [ -f ${local_mysql_libs_compat_source} ] && [ -f ${local_mysql_libs_source} ] && [ -f ${local_mysql_server_source} ] && [ -f ${local_mysql_client_source} ] ; then
echo -e "\r\n\E[1;33m local install...\E[0m\r"
rpm -ivh ${local_mysql_common_source} && \
rpm -ivh ${local_mysql_libs_source} && \
rpm -ivh ${local_mysql_libs_compat_source} && \
rpm -ivh ${local_mysql_client_source} && \
rpm -ivh ${local_mysql_server_source} && \
sudo service mysqld start && \
sudo service mysqld status
else
echo -e "\r\n\E[1;33m remote install...\E[0m\r"
wget ${mysql_source} \
&& rpm -ivh mysql57-community-release-el6-9.noarch.rpm \
&& yum install -y mysql-community-server \
&& sudo service mysqld start \
&& sudo service mysqld status
fi
# 显示初始化密码
mysql_init_pass_string=`sudo grep 'temporary password' /var/log/mysqld.log`
mysql_init_pass=${mysql_init_pass_string##*' '}
echo -e "\r\n\E[1;33m mysql初始密码:${mysql_init_pass} \E[0m\r";
if [ $? -eq 0 ]; then
status_mysql_install='√'
fi
echo -e "\r\n\E[1;33m ${FUNCNAME} success!\E[0m\r\n";
}
restart_php_fpm(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r";
php_fpm_count=`ps aux | grep php-fpm | grep -v 'grep' | wc -l`
if [ ${php_fpm_count} -gt 0 ]; then
killall php-fpm
fi
php-fpm -RD
}
restart_nginx(){
echo -e "\r\n\E[1;33m ${FUNCNAME}...\E[0m\r";
nginx_count=`ps aux | grep nginx | grep -v 'grep' | awk '{print $2}' | wc -l`
if [ ${nginx_count} -gt 0 ]; then
ps aux | grep nginx | grep -v 'grep' | awk '{print $2}' | xargs kill -9
fi
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
/usr/local/nginx/sbin/nginx -s reload
}
installed_list(){
echo -e "\r\n\E[1;33m=============已安装列表===============\e[0m";
echo -e "\E[1;33m= ${version_nginx} ${status_nginx_install} \e[0m";
echo -e "\E[1;33m= ${version_php} ${status_php_install} \e[0m";
echo -e "\E[1;33m= PHP扩展安装列表: \e[0m";
echo -e "\E[1;33m= ${version_php_redis} ${status_php_redis_install} \e[0m";
echo -e "\E[1;33m= ${version_php_memcache} ${status_php_memcache_install} \e[0m";
echo -e "\E[1;33m= ${version_php_igbinary} ${status_php_igbinary_install} \e[0m";
echo -e "\E[1;33m= ${version_php_swoole} ${status_php_swoole_install} \e[0m";
echo -e "\E[1;33m= ${version_php_mongo} ${status_php_mongo_install} \e[0m";
echo -e "\E[1;33m= ${version_php_mongodb} ${status_php_mongodb_install} \e[0m";
echo -e "\E[1;33m= mysql : 5.7 ${status_mysql_install} \e[0m";
echo -e "\E[1;33m======================================\r\n\e[0m";
echo -e "\E[1;33m 运行时间:${start_time} - `date +'%Y-%m-%d %H:%M:%S'`\r\n\e[0m"
}
######### 执行列表 ############
# 安装前变量初始化
install_var_init
# 安装软件列表说明
install_info
# 安装前系统初始化更新
install_yum_init
# 安装nginx
install_nginx
# 安装php
install_php
# 安装php扩展:redis
install_php_extend_redis
# 安装php扩展:swoole
install_php_extend_swoole
# 安装php扩展:igbinary
install_php_extend_igbinary
# 安装php扩展:memcache
install_php_extend_memcache
# 安装php扩展:mongo
install_php_extend_mongo
# 安装php扩展:mongodb
install_php_extend_mongodb
# 安装mysql
install_mysql
# 安装结束清单
installed_list