@@ -131,7 +131,7 @@ function check_wget
131
131
function display_license
132
132
{
133
133
echoY ' **********************************************************************************************'
134
- echoY ' * Open LiteSpeed One click installation, Version 1.5 *'
134
+ echoY ' * Open LiteSpeed One click installation, Version 1.6 *'
135
135
echoY ' * Copyright (C) 2016 LiteSpeed Technologies, Inc. *'
136
136
echoY ' **********************************************************************************************'
137
137
}
@@ -240,25 +240,40 @@ function update_centos_hashlib
240
240
fi
241
241
}
242
242
243
+
243
244
function install_ols_centos
244
245
{
245
246
local action=install
246
247
if [ " x$1 " = " xUpdate" ] ; then
248
+ action=update
249
+ elif [ " x$1 " = " xReinstall" ] ; then
247
250
action=reinstall
248
251
fi
249
252
250
253
local ND=
251
254
if [ " x$LSPHPVER " = " x70" ] ; then
252
255
ND=nd
253
256
if [ " x$OSVER " = " x5" ] ; then
254
- rpm -ivh http://repo.mysql.com/mysql-community-release-el5.rpm
257
+ rpm -Uvh http://repo.mysql.com/mysql-community-release-el5.rpm
255
258
fi
256
259
fi
257
260
258
261
yum -y $action epel-release
259
- rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el$OSVER .noarch.rpm
262
+ rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el$OSVER .noarch.rpm
260
263
yum -y $action openlitespeed
264
+
265
+ if [ ! -e $SERVER_ROOT /lsphp$LSPHPVER /bin/lsphp ] ; then
266
+ action=install
267
+ fi
268
+
269
+ # special case for lsphp56
270
+ if [ " x$action " = " xreinstall" ] && [ " x$LSPHPVER " = " x56" ] ; then
271
+ yum -y remove lsphp56-mysql
272
+ yum -y install lsphp56-mysql
273
+ fi
274
+
261
275
yum -y $action lsphp$LSPHPVER lsphp$LSPHPVER -common lsphp$LSPHPVER -gd lsphp$LSPHPVER -process lsphp$LSPHPVER -mbstring lsphp$LSPHPVER -mysql$ND lsphp$LSPHPVER -xml lsphp$LSPHPVER -mcrypt lsphp$LSPHPVER -pdo lsphp$LSPHPVER -imap
276
+
262
277
if [ $? != 0 ] ; then
263
278
echoR " An error occured during openlitespeed installation."
264
279
ALLERRORS=1
@@ -270,6 +285,10 @@ function install_ols_centos
270
285
function uninstall_ols_centos
271
286
{
272
287
yum -y remove openlitespeed
288
+ if [ $? != 0 ] ; then
289
+ echoR " An error occured while uninstalling openlitespeed."
290
+ ALLERRORS=1
291
+ fi
273
292
274
293
# Need to find what is current lsphp version
275
294
yum list installed | grep lsphp | grep process > /dev/null 2>&1
@@ -283,15 +302,16 @@ function uninstall_ols_centos
283
302
ND=nd
284
303
fi
285
304
286
- yum -y remove lsphp$LSPHPVER lsphp$LSPHPVER -common lsphp$LSPHPVER -gd lsphp$LSPHPVER -process lsphp$LSPHPVER -mbstring lsphp$LSPHPVER -mysql$ND lsphp$LSPHPVER -xml lsphp$LSPHPVER -mcrypt lsphp$LSPHPVER -pdo lsphp$LSPHPVER -imap
305
+ yum -y remove lsphp$LSPHPVER lsphp$LSPHPVER -common lsphp$LSPHPVER -gd lsphp$LSPHPVER -process lsphp$LSPHPVER -mbstring lsphp$LSPHPVER -mysql$ND lsphp$LSPHPVER -xml lsphp$LSPHPVER -mcrypt lsphp$LSPHPVER -pdo lsphp$LSPHPVER -imap lsphp *
287
306
if [ $? != 0 ] ; then
288
- echoR " An error occured while uninstalling openlitespeed. "
307
+ echoR " An error occured while uninstalling lsphp $LSPHPVER "
289
308
ALLERRORS=1
290
309
fi
291
310
292
311
else
312
+ yum -y remove lsphp*
293
313
echoR " Uninstallation cannot get the version of the currently installed lsphp."
294
- echoR " Can not uninstall lsphp correctly."
314
+ echoY " May not uninstall lsphp correctly."
295
315
LSPHPVER=
296
316
fi
297
317
@@ -300,21 +320,34 @@ function uninstall_ols_centos
300
320
301
321
function install_ols_debian
302
322
{
303
- local action=install
323
+ local action=
304
324
if [ " x$1 " = " xUpdate" ] ; then
305
- action=reinstall
325
+ action=" --only-upgrade"
326
+ elif [ " x$1 " = " xReinstall" ] ; then
327
+ # FIXME: action="--reinstall"
328
+ action=
329
+ fi
330
+
331
+
332
+ grep -Fq " http://rpms.litespeedtech.com/debian/" /etc/apt/sources.list.d/lst_debian_repo.list
333
+ if [ $? != 0 ] ; then
334
+ echo " deb http://rpms.litespeedtech.com/debian/ $OSVER main" > /etc/apt/sources.list.d/lst_debian_repo.list
306
335
fi
307
336
308
- echo " deb http://rpms.litespeedtech.com/debian/ $OSVER main" > /etc/apt/sources.list.d/lst_debian_repo.list
309
337
wget -O /etc/apt/trusted.gpg.d/lst_debian_repo.gpg http://rpms.litespeedtech.com/debian/lst_debian_repo.gpg
310
338
apt-get -y update
311
- apt-get -y install openlitespeed
312
- apt-get -y install lsphp$LSPHPVER lsphp$LSPHPVER -mysql lsphp$LSPHPVER -imap
339
+ apt-get -y install $action openlitespeed
340
+
341
+ if [ ! -e $SERVER_ROOT /lsphp$LSPHPVER /bin/lsphp ] ; then
342
+ action=
343
+ fi
344
+ apt-get -y install $action lsphp$LSPHPVER lsphp$LSPHPVER -mysql lsphp$LSPHPVER -imap
313
345
346
+
314
347
if [ " x$LSPHPVER " != " x70" ] ; then
315
- apt-get -y install lsphp$LSPHPVER -gd lsphp$LSPHPVER -mcrypt
348
+ apt-get -y install $action lsphp$LSPHPVER -gd lsphp$LSPHPVER -mcrypt
316
349
else
317
- apt-get -y install lsphp$LSPHPVER -common
350
+ apt-get -y install $action lsphp$LSPHPVER -common
318
351
fi
319
352
320
353
if [ $? != 0 ] ; then
@@ -336,21 +369,21 @@ function uninstall_ols_debian
336
369
LSPHPVER=` echo $LSPHPSTR | awk ' {print substr($2,6,2)}' `
337
370
echoY " The installed version of lsphp is $LSPHPVER "
338
371
339
- apt-get -y --purge remove lsphp$LSPHPVER lsphp$LSPHPVER -mysql lsphp$LSPHPVER -imap
340
-
341
372
if [ " x$LSPHPVER " != " x70" ] ; then
342
373
apt-get -y --purge remove lsphp$LSPHPVER -gd lsphp$LSPHPVER -mcrypt
343
374
else
344
375
apt-get -y --purge remove lsphp$LSPHPVER -common
345
376
fi
346
-
377
+
378
+ apt-get -y --purge remove lsphp$LSPHPVER lsphp$LSPHPVER -mysql lsphp$LSPHPVER -imap ' lsphp*'
347
379
if [ $? != 0 ] ; then
348
380
echoR " An error occured while uninstalling openlitespeed/lsphp."
349
381
ALLERRORS=1
350
382
fi
351
383
else
384
+ apt-get -y --purge remove lsphp*
352
385
echoR " Uninstallation cannot get the version of the currently installed lsphp."
353
- echoR " Can not uninstall lsphp correctly."
386
+ echoR " May not uninstall lsphp correctly."
354
387
LSPHPVER=
355
388
fi
356
389
507
540
apt-get install software-properties-common
508
541
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
509
542
fi
510
- echo " deb [$MARIADBCPUARCH ] http://mirror.jaleco.com/mariadb/repo/10.1/$OSNAME $OSVER main" > /etc/apt/sources.list.d/mariadb_repo.list
511
-
543
+
544
+ grep -Fq " http://mirror.jaleco.com/mariadb/repo/" /etc/apt/sources.list.d/mariadb_repo.list
545
+ if [ $? != 0 ] ; then
546
+ echo " deb [$MARIADBCPUARCH ] http://mirror.jaleco.com/mariadb/repo/10.1/$OSNAME $OSVER main" > /etc/apt/sources.list.d/mariadb_repo.list
547
+ fi
548
+
512
549
apt-get -y -f --force-yes install mariadb-server
513
550
if [ $? != 0 ] ; then
514
551
echoR " An error occured during installation of MariaDB. Please fix this error and try again."
@@ -684,8 +721,17 @@ function install_ols
684
721
{
685
722
local STATUS=Install
686
723
if [ " x$OLSINSTALLED " = " x1" ] ; then
687
- echoY " OpenLiteSpeed is already installed, will attempt to update it."
688
- STATUS=Update
724
+ OLS_VERSION=$( cat " $SERVER_ROOT " /VERSION)
725
+ wget -O " $SERVER_ROOT " /release.tmp http://open.litespeedtech.com/packages/release? ver=$OLS_VERSION
726
+ LATEST_VERSION=$( cat " $SERVER_ROOT " /release.tmp)
727
+ rm " $SERVER_ROOT " /release.tmp
728
+ if [ " x$OLS_VERSION " = " x$LATEST_VERSION " ] ; then
729
+ STATUS=Reinstall
730
+ echoY " OpenLiteSpeed is already installed with the latest version, will attempt to reinstall it."
731
+ else
732
+ STATUS=Update
733
+ echoY " OpenLiteSpeed is already installed and newer version is available, will attempt to update it."
734
+ fi
689
735
fi
690
736
691
737
if [ " x$OSNAME " = " xcentos" ] ; then
@@ -726,16 +772,16 @@ map wordpress $SITEDOMAIN
726
772
module cache {
727
773
param <<<PARAMFLAG
728
774
729
- enableCache 1
775
+ enableCache 0
730
776
qsCache 1
731
777
reqCookieCache 1
732
778
respCookieCache 1
733
779
ignoreReqCacheCtrl 1
734
780
ignoreRespCacheCtrl 0
735
- expireInSeconds 2000
736
- maxStaleAge 1000
737
- enablePrivateCache 1
738
- privateExpireInSeconds 1000
781
+ expireInSeconds 3600
782
+ maxStaleAge 200
783
+ enablePrivateCache 0
784
+ privateExpireInSeconds 3600
739
785
checkPrivateCache 1
740
786
checkPublicCache 1
741
787
maxCacheObjSize 100000000
0 commit comments