PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` #!/bin/sh # /******************************************************************** # LiteSpeed Web Server autoinstaller for cPanel/WHM # # @author LiteSpeed Technologies, Inc. (https://www.litespeedtech.com) # @copyright (c) 2013-2023 # @version 1.6.2.3 # *********************************************************************/ show_help() { cat </dev/null 2>&1 check_errs "${?}" "error encountered when checking file: Not a valid .tar.gz file (reCAPTCHA?)." } test_license() { if [ -f "${LSWS_HOME}/conf/license.key" ] && [ ! -f "${LSINSTALL_DIR}/license.key" ]; then cp "${LSWS_HOME}/conf/license.key" "${LSINSTALL_DIR}/license.key" fi if [ -f "${LSWS_HOME}/conf/serial.no" ] && [ ! -f "${LSINSTALL_DIR}/serial.no" ]; then cp "${LSWS_HOME}/conf/serial.no" "${LSINSTALL_DIR}/serial.no" fi if [ -f "${LSINSTALL_DIR}/license.key" ] && [ -f "${LSINSTALL_DIR}/serial.no" ]; then echo "License key and serial number are available, testing..." echo if "${LSINSTALL_DIR}/bin/lshttpd" -t; then LICENSE_OK=1 fi echo fi if [ "x${LICENSE_OK}" = "x" ]; then if [ -f "${LSINSTALL_DIR}/serial.no" ]; then echo "Serial number is available." echo "Contacting licensing server ..." echo "" if "${LSINSTALL_DIR}/bin/lshttpd" -r; then echo "[OK] License key received." if "${LSINSTALL_DIR}/bin/lshttpd" -t; then LICENSE_OK=1 else echo "The license key received does not work." fi fi fi fi if [ "x${LICENSE_OK}" = "x" ]; then if [ -f "${LSINSTALL_DIR}/trial.key" ]; then "${LSINSTALL_DIR}/bin/lshttpd" -t check_errs "${?}" "Invalid license key, abort!" else check_errs 1 "Invalid license key, abort!" fi fi } installLicense() { if [ -f "${LSINSTALL_DIR}/serial.no" ]; then cp -f "${LSINSTALL_DIR}/serial.no" "${LSWS_HOME}/conf" chown "${DIR_OWN}" "${LSWS_HOME}/conf/serial.no" chmod "${CONF_MOD}" "${LSWS_HOME}/conf/serial.no" fi if [ -f "${LSINSTALL_DIR}/license.key" ]; then cp -f "${LSINSTALL_DIR}/license.key" "${LSWS_HOME}/conf" chown "${DIR_OWN}" "${LSWS_HOME}/conf/license.key" chmod "${CONF_MOD}" "${LSWS_HOME}/conf/license.key" fi if [ -f "${LSINSTALL_DIR}/trial.key" ]; then cp -f "${LSINSTALL_DIR}/trial.key" "${LSWS_HOME}/conf" chown "${DIR_OWN}" "${LSWS_HOME}/conf/trial.key" chmod "${CONF_MOD}" "${LSWS_HOME}/conf/trial.key" fi } DownloadTrialKey() { if [ "${OS}" = "FreeBSD" ]; then fetch -q -T 3 -o "${LSINSTALL_DIR}/trial.key" "${1}" else # -t is tries, -T is timeout wget -q -t 1 -T 3 --output-document="${LSINSTALL_DIR}/trial.key" "${1}" fi } GetTrialKey() { LICENSE_SITE="https://license.litespeedtech.com/reseller/trial.key" LICENSE_SITE_2="https://license2.litespeedtech.com/reseller/trial.key" if ! DownloadTrialKey "${LICENSE_SITE}"; then DownloadTrialKey "${LICENSE_SITE_2}" fi } install_lsws() { cd "${WGET_TEMP}/" echo "... Extracting... tar -zxf ${WGET_TEMP}/${LOCAL_DIR}.tar.gz" LSINSTALL_DIR="${WGET_TEMP}/${LOCAL_DIR}" if [ -e "${LSINSTALL_DIR}" ]; then /bin/rm -rf "${LSINSTALL_DIR}" fi tar -zxf "${WGET_TEMP}/${LOCAL_DIR}.tar.gz" check_errs "${?}" "Could not extract ${LOCAL_DIR}.tar.gz" if [ "${SERIAL}" = "TRIAL" ] ; then GetTrialKey else echo "${SERIAL}" > "${LSINSTALL_DIR}/serial.no" fi echo "" echo "Prepare Installing ..." echo " LSWS_HOME=${LSWS_HOME} AP_PORT_OFFSET=${AP_PORT_OFFSET} PHP_SUEXEC=${PHP_SUEXEC} ADMIN_USER=${ADMIN_USER} " cd "${LSINSTALL_DIR}" if ! . ./functions.sh 2>/dev/null; then . ./functions.sh check_errs "${?}" "Can not include 'functions.sh'." fi init ## # The variables below must be set after init() call. shellcheck disabled variables are used in functions.sh. ## # shellcheck disable=SC2034 INSTALL_TYPE="reinstall" ADMIN_EMAIL="${ADMIN_EMAIL_INPUT}" AP_PORT_OFFSET="${AP_PORT_OFFSET_INPUT}" # shellcheck disable=SC2034 PHP_SUEXEC="${PHP_SUEXEC_INPUT}" # shellcheck disable=SC2034 PHP_SUFFIX="php" # shellcheck disable=SC2034 SETUP_PHP=1 # shellcheck disable=SC2034 ADMIN_PORT=7080 # shellcheck disable=SC2034 DEFAULT_PORT=8088 # shellcheck disable=SC2034 HOST_PANEL="cpanel" # shellcheck disable=SC2034 WS_USER="nobody" # shellcheck disable=SC2034 WS_GROUP="nobody" # shellcheck disable=SC2034 PANEL_VARY=".ea4" if [ "x${ADMIN_USER}" != 'x' ] && [ "x${ADMIN_PASS}" != 'x' ]; then ENCRYPT_PASS="$("${LSINSTALL_DIR}/admin/fcgi-bin/admin_php5" -q "${LSINSTALL_DIR}/admin/misc/htpasswd.php" "${ADMIN_PASS}")" echo "${ADMIN_USER}:${ENCRYPT_PASS}" > "${LSINSTALL_DIR}/admin/conf/htpasswd" fi configRuby if [ ! -e "${LSWS_HOME}" ]; then mkdir "${LSWS_HOME}" fi test_license echo "" echo "Installing LiteSpeed web server, please wait... " echo "" buildApConfigFiles installation installLicense echo "" "${LSWS_HOME}/admin/misc/rc-inst.sh" "${LSWS_HOME}/admin/misc/fix_cagefs.sh" } # check if root user and cPanel check_permission download_lsws install_lsws echo "" echo "" if [ -e "/opt/cpanel/ea-php56/root/usr/bin/lsphp" ] ; then if ! rpm -qf /usr/local/bin/lsphp | grep -r "ea-php-cli.*"; then /bin/cp -pf /opt/cpanel/ea-php56/root/usr/bin/lsphp /usr/local/bin/lsphp fi ln -sf /opt/cpanel/ea-php56/root/usr/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5 fi if [ -e "/opt/cpanel/ea-php70/root/usr/bin/lsphp" ] ; then echo "link lsphp7 to lsws directory" ln -sf /opt/cpanel/ea-php70/root/usr/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp7 fi echo "" echo "" if [ "x${AP_PORT_OFFSET}" = "x0" ] && [ "x${AUTO_SWITCH}" = "x1" ]; then echo "Trying to automatically switch to LiteSpeed." "${WHM_PLUGIN_CGIDIR}/lsws/bin/lsws_cmd.sh" "${LSWS_HOME}" SWITCH_TO_LSWS else echo "You can now login to WHM, go to plugins - LiteSpeed Web Server to switch to LiteSpeed." fi echo "" echo "" if [ "x${DEPLOY_LSCWP}" = "x1" ] ; then echo "Attempting to deploy the LSCache Plugin for WordPress across all WordPress installations." "${LSWS_HOME}/admin/misc/lscmctl" scan -e else echo "Skipping LSCache Plugin for WordPress deployment..." fi echo "" echo "**LITESPEED AUTOINSTALLER COMPLETE**"