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 init() { LSINSTALL_DIR=`pwd` LS_VER=`cat VERSION` export LSINSTALL_DIR DIR_MOD=755 SDIR_MOD=700 EXEC_MOD=555 CONF_MOD=600 DOC_MOD=644 INST_USER=`id` INST_USER=`expr "$INST_USER" : 'uid=.*(\(.*\)) gid=.*'` ARCH=`arch` SYS_NAME=`uname -s` if [ "x$SYS_NAME" = "xFreeBSD" ] || [ "x$SYS_NAME" = "xNetBSD" ] || [ "x$SYS_NAME" = "xDarwin" ] ; then PS_CMD="ps -ax" ID_GROUPS="id" TEST_BIN="/bin/test" ROOTGROUP="wheel" else PS_CMD="ps -ef" ID_GROUPS="id -a" TEST_BIN="/usr/bin/test" ROOTGROUP="root" fi SETUP_PHP=0 SET_LOGIN=0 ADMIN_PORT=7080 INSTALL_TYPE="upgrade" SERVER_NAME=`uname -n` ADMIN_EMAIL="root@localhost" AP_PORT_OFFSET=2000 PHP_SUEXEC=2 WS_USER=nobody WS_GROUP=nobody DIR_OWN=$WS_USER:$WS_GROUP CONF_OWN=$WS_USER:$WS_GROUP BUILD_ROOT="$LSWS_HOME/../../../" WHM_CGIDIR="$BUILD_ROOT/usr/local/cpanel/whostmgr/docroot/cgi" if [ -d "$WHM_CGIDIR" ] ; then HOST_PANEL="cpanel" fi install_missing_packages } license() { more ./LICENSE cat <" "$LSWS_HOME/conf/httpd_config.xml"` OLD_GROUP_CONF=`grep -m1 "" "$LSWS_HOME/conf/httpd_config.xml"` OLD_USER=`expr "$OLD_USER_CONF" : '.*\(.*\).*'` OLD_GROUP=`expr "$OLD_GROUP_CONF" : '.*\(.*\).*'` if [ "x$OLD_USER" != "x" ]; then WS_USER=$OLD_USER fi if [ "x$OLD_GROUP" != "x" ]; then WS_GROUP=$OLD_GROUP else D_GROUP=`$ID_GROUPS $WS_USER` WS_GROUP=`expr "$D_GROUP" : '.*gid=[0-9]*(\(.*\)) groups=.*'` fi DIR_OWN=$WS_USER:$WS_GROUP CONF_OWN=$WS_USER:$WS_GROUP } # Get destination directory install_dir() { SUCC=0 INSTALL_TYPE="reinstall" SET_LOGIN=1 if [ $INST_USER = "root" ]; then DEST_RECOM="/usr/local/lsws" if [ -f "/opt/lsws/conf/httpd_config.xml" ]; then DEST_RECOM="/opt/lsws" fi WS_USER="nobody" else cat < "$LSINSTALL_DIR/admin/conf/htpasswd" fi } getUserGroup() { if [ $INST_USER = "root" ]; then cat </dev/null` TST_USER=`expr "$USER_INFO" : 'uid=.*(\(.*\)) gid=.*'` if [ "x$TST_USER" = "x$TMP_USER" ]; then USER_ID=`expr "$USER_INFO" : 'uid=\(.*\)(.*) gid=.*'` if [ $USER_ID -gt 10 ]; then WS_USER=$TMP_USER SUCC=1 else cat <:/ EOF SUCC=0 DEFAULT_PORT=8088 while [ $SUCC -eq "0" ]; do printf "%s" "HTTP port [$DEFAULT_PORT]: " read TMP_PORT if [ "x$TMP_PORT" = "x" ]; then TMP_PORT=$DEFAULT_PORT fi SUCC=1 if [ `expr "$TMP_PORT" : '.*[^0-9]'` -gt 0 ]; then echo "[ERROR] Only digits is allowed, try again!" SUCC=0 fi if [ $SUCC -eq 1 ]; then if [ $INST_USER != "root" ]; then if [ $TMP_PORT -le 1024 ]; then echo "[ERROR] Only 'root' can use port below 1024, try again!" SUCC=0 fi fi fi if [ $SUCC -eq 1 ]; then if [ `netstat -aln | awk '{print $4}' | grep -e ":$TMP_PORT$" | wc -l` -gt 0 ]; then echo "[ERROR] Port $TMP_PORT is in use now, stop the server using this port first," echo " or choose another port." SUCC=0 fi fi done HTTP_PORT=$TMP_PORT } # get administration TCP port getAdminPort() { cat <:/ EOF SUCC=0 DEFAULT_PORT=7080 while [ $SUCC -eq "0" ]; do printf "%s" "Admin HTTP port [$DEFAULT_PORT]: " read TMP_PORT if [ "x$TMP_PORT" = "x" ]; then TMP_PORT=$DEFAULT_PORT fi SUCC=1 if [ `expr "$TMP_PORT" : '.*[^0-9]'` -gt 0 ]; then echo "[ERROR] Only digits is allowed, try again!" SUCC=0 fi if [ $SUCC -eq 1 ]; then if [ $INST_USER != "root" ]; then if [ $TMP_PORT -le 1024 ]; then echo "[ERROR] Only 'root' can use port below 1024, try again!" SUCC=0 fi fi fi if [ $SUCC -eq 1 ]; then if [ $TMP_PORT -eq $HTTP_PORT ]; then echo "[ERROR] The admin HTTP port must be different from the normal HTTP port!" SUCC=0 fi fi if [ $SUCC -eq 1 ]; then if [ `netstat -aln | awk '{print $4}' | grep -e ":$TMP_PORT$" | wc -l` -gt 0 ]; then echo "[ERROR] Port $TMP_PORT is in use, stop the server that using this port first," echo " or choose another port." SUCC=0 fi fi done ADMIN_PORT=$TMP_PORT } configAdminEmail() { cat < "$LSINSTALL_DIR/admin/conf/admin_config.xml" sed -e "s/%ADMIN_PORT%/$ADMIN_PORT/" "$LSINSTALL_DIR/admin/conf/admin_config.xml.in" > "$LSINSTALL_DIR/admin/conf/admin_config.xml" sed -e "s/%USER%/$WS_USER/" -e "s/%GROUP%/$WS_GROUP/" -e "s#%APACHE_PID_FILE%#$APACHE_PID_FILE#" -e "s/%ADMIN_EMAIL%/$ADMIN_EMAIL/" -e "s#%RUBY_BIN%#$RUBY_PATH#" -e "s/%SERVER_NAME%/$SERVER_NAME/" -e "s/%AP_PORT_OFFSET%/$AP_PORT_OFFSET/" -e "s/%PHP_SUEXEC%/$PHP_SUEXEC/" "$LSINSTALL_DIR/add-ons/$HOST_PANEL/httpd_config.xml${PANEL_VARY}" > "$LSINSTALL_DIR/conf/httpd_config.xml" } # pass $1 = "$LSWS_HOME/httpd_config.xml" updateCagefsConfig() { if [ "x$1" = "x" ]; then conf_file=/usr/local/lsws/conf/httpd_config.xml else conf_file="$1" fi if [ ! -f "$conf_file" ]; then return 1 fi cagefsctl --cagefs-status 2>/dev/null 1>&2 if [ $? = 0 ]; then cp "$conf_file" "$conf_file.tmp" grep enableLVE "$conf_file" | grep -v grep > /dev/null if [ $? = 0 ]; then grep -e "[23]" "$conf_file" | grep -v grep > /dev/null if [ $? = 0 ]; then return 0 fi sed -e "s#.*#2#" "$conf_file.tmp" > "$conf_file" else sed -e "s##2#" "$conf_file.tmp" > "$conf_file" fi fi } # detect download method detect_dlcmd() { DLCMD=x if [ "x$SYS_NAME" = "xFreeBSD" ] ; then DL=`which fetch` if [ $? -eq 0 ] ; then DLCMD="$DL -o" fi fi if [ "$DLCMD" = "x" ] ; then DL=`which wget` if [ $? -eq 0 ] ; then DLCMD="$DL -nv -O" fi fi if [ "$DLCMD" = "x" ] ; then DL=`which curl` if [ $? -eq 0 ] ; then DLCMD="$DL -L -o" fi fi } buildAdminSslCert() { if [ ! -f "$LSWS_HOME/admin/conf/cert/admin.crt" ]; then HN=`hostname` if [ "x${DLCMD}" != 'xx' ]; then $DLCMD $LSWS_HOME/myip http://cyberpanel.sh/?ip MYIP=`cat $LSWS_HOME/myip` rm $LSWS_HOME/myip fi openssl rand -out $HOME/.rnd -hex 256 openssl req -subj "/CN=$HN/O=webadmin/C=US/subjectAltName=DNS.1=${MYIP}/" -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout "$LSWS_HOME/admin/conf/cert/admin.key" -out "$LSWS_HOME/admin/conf/cert/admin.crt" fi } download_quic_cloud_ips() { if [ "x${DLCMD}" != 'xx' ]; then $DLCMD $LSWS_HOME/admin/tmp/download-quic-cloud-ips https://quic.cloud/ips?ln fi } cPanelSwitchPathsConf() { mode=shift if [ "x$mode" = 'xapache' ]; then cp /etc/cpanel/ea4/paths.conf /etc/cpanel/ea4/paths.conf.tmp sed -e 's#/usr/local/lsws/bin/lswsctrl#/usr/sbin/apachectl#' /etc/cpanel/ea4/paths.conf else cp /etc/cpanel/ea4/paths.conf /etc/cpanel/ea4/paths.conf.tmp sed -e 's#/usr/sbin/apachectl#/usr/local/lsws/bin/lswsctrl#' /etc/cpanel/ea4/paths.conf fi } # generate configuration from template buildConfigFiles() { #sed -e "s/%ADMIN_PORT%/$ADMIN_PORT/" -e "s/%PHP_FCGI_PORT%/$ADMIN_PHP_PORT/" "$LSINSTALL_DIR/admin/conf/admin_config.xml.in" > "$LSINSTALL_DIR/admin/conf/admin_config.xml" sed -e "s/%ADMIN_PORT%/$ADMIN_PORT/" "$LSINSTALL_DIR/admin/conf/admin_config.xml.in" > "$LSINSTALL_DIR/admin/conf/admin_config.xml" sed -e "s/%USER%/$WS_USER/" -e "s/%GROUP%/$WS_GROUP/" -e "s/%ADMIN_EMAIL%/$ADMIN_EMAIL/" -e "s/%HTTP_PORT%/$HTTP_PORT/" -e "s/%RUBY_BIN%/$RUBY_PATH/" -e "s/%SERVER_NAME%/$SERVER_NAME/" "$LSINSTALL_DIR/conf/httpd_config.xml.in" > "$LSINSTALL_DIR/conf/httpd_config.xml.tmp" if [ $SETUP_PHP -eq 1 ]; then sed -e "s/%PHP_BEGIN%//" -e "s/%PHP_END%//" -e "s/%PHP_SUFFIX%/$PHP_SUFFIX/" -e "s/%PHP_PORT%/$PHP_PORT/" "$LSINSTALL_DIR/conf/httpd_config.xml.tmp" > "$LSINSTALL_DIR/conf/httpd_config.xml" else sed -e "s/%PHP_BEGIN%//" -e "s/%PHP_SUFFIX%/php/" -e "s/%PHP_PORT%/5201/" "$LSINSTALL_DIR/conf/httpd_config.xml.tmp" > "$LSINSTALL_DIR/conf/httpd_config.xml" fi } util_mkdir() { OWNER=$1 PERM=$2 shift shift for arg do if [ ! -d "$LSWS_HOME/$arg" ]; then mkdir "$LSWS_HOME/$arg" fi chown "$OWNER" "$LSWS_HOME/$arg" chmod $PERM "$LSWS_HOME/$arg" done } util_cpfile() { OWNER=$1 PERM=$2 shift shift for arg do cp -f "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg" chown "$OWNER" "$LSWS_HOME/$arg" chmod $PERM "$LSWS_HOME/$arg" done } util_ccpfile() { OWNER=$1 PERM=$2 shift shift for arg do if [ ! -f "$LSWS_HOME/$arg" ]; then cp "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg" fi chown "$OWNER" "$LSWS_HOME/$arg" chmod $PERM "$LSWS_HOME/$arg" done } util_cpdir() { OWNER=$1 PERM=$2 shift shift for arg do cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg/" chown -R "$OWNER" "$LSWS_HOME/$arg/"* #chmod -R $PERM $LSWS_HOME/$arg/* done } util_cpdirv() { OWNER=$1 PERM=$2 shift shift COPY_VER=$1 shift for arg do cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg.$COPY_VER/" chown -R "$OWNER" "$LSWS_HOME/$arg.$COPY_VER" $TEST_BIN -L "$LSWS_HOME/$arg" if [ $? -eq 0 ]; then rm -f "$LSWS_HOME/$arg" fi FILENAME=`basename $arg` ln -sf "./$FILENAME.$COPY_VER/" "$LSWS_HOME/$arg" #chmod -R $PERM $LSWS_HOME/$arg/* done } util_cpfilev() { OWNER=$1 PERM=$2 shift shift COPY_VER=$1 shift for arg do cp -f "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg.$COPY_VER" chown "$OWNER" "$LSWS_HOME/$arg.$COPY_VER" chmod $PERM "$LSWS_HOME/$arg.$COPY_VER" $TEST_BIN -L "$LSWS_HOME/$arg" if [ $? -eq 0 ]; then rm -f "$LSWS_HOME/$arg" fi FILENAME=`basename $arg` ln -sf "./$FILENAME.$COPY_VER" "$LSWS_HOME/$arg" done } installation1() { umask 022 if [ $INST_USER = "root" ]; then SDIR_OWN="root:$ROOTGROUP" chown $SDIR_OWN $LSWS_HOME else SDIR_OWN=$DIR_OWN fi sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc" OWNER=$1 PERM=$2 shift shift for arg do if [ ! -f "$LSWS_HOME/$arg" ]; then cp "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg" fi chown "$OWNER" "$LSWS_HOME/$arg" chmod $PERM "$LSWS_HOME/$arg" done } util_cpdir() { OWNER=$1 PERM=$2 shift shift for arg do cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg/" chown -R "$OWNER" "$LSWS_HOME/$arg/"* #chmod -R $PERM $LSWS_HOME/$arg/* done } util_cpdirv() { OWNER=$1 PERM=$2 shift shift COPY_VER=$1 shift for arg do cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg.$COPY_VER/" chown -R "$OWNER" "$LSWS_HOME/$arg.$COPY_VER" $TEST_BIN -L "$LSWS_HOME/$arg" if [ $? -eq 0 ]; then rm -f "$LSWS_HOME/$arg" fi FILENAME=`basename $arg` ln -sf "./$FILENAME.$COPY_VER/" "$LSWS_HOME/$arg" #chmod -R $PERM $LSWS_HOME/$arg/* done } util_cpfilev() { OWNER=$1 PERM=$2 shift shift COPY_VER=$1 shift for arg do cp -f "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg.$COPY_VER" chown "$OWNER" "$LSWS_HOME/$arg.$COPY_VER" chmod $PERM "$LSWS_HOME/$arg.$COPY_VER" $TEST_BIN -L "$LSWS_HOME/$arg" if [ $? -eq 0 ]; then rm -f "$LSWS_HOME/$arg" fi FILENAME=`basename $arg` ln -sf "./$FILENAME.$COPY_VER" "$LSWS_HOME/$arg" done } compress_admin_file() { TMP_DIR=`pwd` cd $LSWS_HOME/admin/html find . | grep -e '\.js$' | xargs -n 1 ../misc/gzipStatic.sh 9 find . | grep -e '\.css$' | xargs -n 1 ../misc/gzipStatic.sh 9 cd $TMP_DIR } install_whm_plugin() { WHM_PLUGIN_SRCDIR="$LSINSTALL_DIR/add-ons/cpanel/lsws_whm_plugin" $DLCMD $WHM_PLUGIN_SRCDIR/lsws_whm_plugin_install.sh https://www.litespeedtech.com/packages/cpanel/lsws_whm_plugin_install.sh $WHM_PLUGIN_SRCDIR/lsws_whm_plugin_install.sh if [ ! -f /usr/local/cpanel/whostmgr/docroot/cgi/lsws/LSWS_HOME.config ]; then echo "LSWS_HOME=$LSWS_HOME" > /usr/local/cpanel/whostmgr/docroot/cgi/lsws/LSWS_HOME.config fi /usr/local/cpanel/bin/whmapi1 configureservice service=httpd enabled=1 #monitored=1 } create_lsadm_freebsd() { pw group add lsadm lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'` pw user add -g $lsadm_gid -d / -s /usr/sbin/nologin -n lsadm pw usermod lsadm -G $WS_GROUP } create_lsadm() { groupadd lsadm 1>/dev/null 2>&1 lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'` useradd -g $lsadm_gid -d / -r -s /sbin/nologin lsadm usermod -a -G $WS_GROUP lsadm 1>/dev/null 2>&1 } create_lsadm_solaris() { groupadd lsadm #1>/dev/null 2>&1 lsadm_gid=`grep "^lsadm:" /etc/group | awk -F: '{ print $3; }'` useradd -g $lsadm_gid -d / -s /bin/false lsadm usermod -G $WS_GROUP lsadm #1>/dev/null 2>&1 } create_self_signed_cert_for_admin() { #$1 = filename #$2 = domain_name openssl req -x509 -sha256 -newkey rsa:2048 -keyout $1.key -out $1.crt -days 1024 -nodes -subj '/CN=$2' } fix_cloudlinux() { if [ -d /proc/lve ]; then lvectl set-user $WS_USER --unlimited if [ "x$ARCH" != 'xi386' ]; then lvectl set-user $WS_USER --pmem=2000G else lvectl set-user $WS_USER --pmem=2G fi lvectl set-user lsadm --unlimited lvectl set-user lsadm --pmem=2G $LSWS_HOME/admin/misc/fix_cagefs.sh updateCagefsConfig $LSWS_HOME/conf/httpd_config.xml fi } fix_alt_ruby_install() { RUBY_LSAPI_VER="5\\." # $1 = ruby version if [ "x$1" != "x" ] && [ -f "/opt/alt/ruby$1/bin/gem" ]; then /opt/alt/ruby$1/bin/gem list ruby-lsapi | grep $RUBY_LSAPI_VER >/dev/null if [ $? -ne 0 ]; then echo "Alt-ruby $1 misses ruby-lsapi 5.x gem, install latest version." /opt/alt/ruby$1/bin/gem install ruby-lsapi echo "" fi fi } fix_alt_ruby() { for VER in '18' '19' '20' '21' '22' '23' '24' '25' '26' '27' '30' do fix_alt_ruby_install $VER done } install_missing_packages() { if [ -f /etc/redhat-release ] ; then output=$(cat /etc/redhat-release) if echo $output | grep " 9."; then yum -y install libxcrypt-compat libnsl fi if [ "${ARCH}" = "aarch64" ]; then yum -y install libatomic fi elif [ -f /etc/debian_version ] ; then if [ "${ARCH}" = "aarch64" ]; then apt -y install libatomic1 fi fi } installation() { umask 022 if [ $INST_USER = "root" ]; then export PATH=/sbin:/usr/sbin:$PATH if [ "x$SYS_NAME" = "xLinux" ]; then create_lsadm elif [ "x$SYS_NAME" = "xFreeBSD" ] || [ "x$SYS_NAME" = "xNetBSD" ]; then create_lsadm_freebsd elif [ "x$SYS_NAME" = "xSunOS" ]; then create_lsadm_solaris fi grep "^lsadm:" /etc/passwd 1>/dev/null 2>&1 if [ $? -eq 0 ]; then CONF_OWN="lsadm:lsadm" fi SDIR_OWN="root:$ROOTGROUP" LOGDIR_OWN="root:$WS_GROUP" chown $SDIR_OWN $LSWS_HOME else SDIR_OWN=$DIR_OWN LOGDIR_OWN=$DIR_OWN fi sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc" sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo" sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lshttpd.service.in" > "$LSINSTALL_DIR/admin/misc/lshttpd.service" if [ -d "$LSWS_HOME/admin/html.$LS_VER" ]; then rm -rf "$LSWS_HOME/admin/html.$LS_VER" fi detect_dlcmd util_mkdir "$SDIR_OWN" $DIR_MOD admin bin docs fcgi-bin lib add-ons share admin/fcgi-bin util_mkdir "$LOGDIR_OWN" "0750" logs admin/logs util_mkdir "$SDIR_OWN" $DIR_MOD admin/html.$LS_VER admin/misc util_mkdir "$CONF_OWN" $SDIR_MOD conf conf/cert conf/templates admin/conf admin/conf/cert admin/tmp phpbuild autoupdate util_mkdir "$SDIR_OWN" $SDIR_MOD admin/cgid admin/cgid/secret util_mkdir "$CONF_OWN" $DIR_MOD admin/htpasswds chgrp $WS_GROUP $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds chmod g+x $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds chown $CONF_OWN $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1 util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT buildAdminSslCert find "$LSWS_HOME/admin/tmp" -type s -atime +1 -delete 2>/dev/null if [ $? -ne 0 ]; then find "$LSWS_HOME/admin/tmp" -type s -atime +1 2>/dev/null | xargs rm -f fi find "/tmp/lshttpd" -type s -atime +1 -delete 2>/dev/null if [ $? -ne 0 ]; then find "/tmp/lshttpd" -type s -atime +1 2>/dev/null | xargs rm -f fi util_cpdir "$SDIR_OWN" $DOC_MOD add-ons util_cpfile "$SDIR_OWN" $EXEC_MOD add-ons/modsec/inspectmulti.sh util_ccpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/lsperld.fpl util_cpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/RackRunner.rb fcgi-bin/RailsRunner.rb fcgi-bin/RailsRunner.rb.2.3 fcgi-bin/lsnode.js fcgi-bin/lsnodesm.js fcgi-bin/lswsgi_wrapper util_cpfile "$SDIR_OWN" $EXEC_MOD admin/fcgi-bin/admin_php5 util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/rc-inst.sh admin/misc/admpass.sh admin/misc/rc-uninst.sh admin/misc/uninstall.sh util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lsws.rc admin/misc/lshttpd.service admin/misc/lsws.rc.gentoo admin/misc/enable_ruby_python_selector.sh util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/mgr_ver.sh admin/misc/gzipStatic.sh admin/misc/fp_install.sh util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/create_admin_keypair.sh admin/misc/awstats_install.sh admin/misc/update.sh util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/cleancache.sh admin/misc/cleanlitemage.sh admin/misc/lsup6.sh util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/fix_cagefs.sh admin/misc/cp_switch_ws.sh util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lscmctl ln -sf ./lsup6.sh "$LSWS_HOME/admin/misc/lsup.sh" util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/ap_lsws.sh.in admin/misc/build_ap_wrapper.sh admin/misc/cpanel_restart_httpd.in admin/misc/purge_cache_by_url util_cpfile "$SDIR_OWN" $DOC_MOD admin/misc/gdb-bt admin/misc/htpasswd.php admin/misc/php.ini admin/misc/genjCryptionKeyPair.php if [ -f "$LSINSTALL_DIR/admin/misc/chroot.sh" ]; then util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/chroot.sh fi if [ "x$HOST_PANEL" = "xcpanel" ]; then if [ ! -d "$BUILD_ROOT/usr/local/lib/php/autoindex/" ]; then mkdir -p $BUILD_ROOT/usr/local/lib/php/autoindex fi if [ -f "$BUILD_ROOT/usr/local/lib/php/autoindex/default.php" ]; then mv -f "$BUILD_ROOT/usr/local/lib/php/autoindex/default.php" "$BUILD_ROOT/usr/local/lib/php/autoindex/default.php.old" fi cp -R "$LSINSTALL_DIR/share/autoindex/"* $BUILD_ROOT/usr/local/lib/php/autoindex/ if [ -d "$LSWS_HOME/share/autoindex" ]; then rm -rf "$LSWS_HOME/share/autoindex" fi ln -sf /usr/local/lib/php/autoindex "$LSWS_HOME/share/autoindex" if [ -d "$WHM_CGIDIR" ]; then ## # This call should be made after copying over lsws/admin/misc files # so that lscmctl script can be used. ## install_whm_plugin fi else util_mkdir "$SDIR_OWN" $DIR_MOD share/autoindex if [ -f "$LSWS_HOME/share/autoindex/default.php" ]; then mv -f "$LSWS_HOME/share/autoindex/default.php" "$LSWS_HOME/share/autoindex/default.php.old" fi util_cpdir "$SDIR_OWN" $DOC_MOD share/autoindex util_cpfile "$SDIR_OWN" $DOC_MOD share/autoindex/default.php fi if [ $SET_LOGIN -eq 1 ]; then util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/htpasswd else util_ccpfile "$CONF_OWN" $CONF_MOD admin/conf/htpasswd fi if [ ! -f "$LSWS_HOME/admin/htpasswds/status" ]; then cp -p "$LSWS_HOME/admin/conf/htpasswd" "$LSWS_HOME/admin/htpasswds/status" fi chown $CONF_OWN "$LSWS_HOME/admin/htpasswds/status" chgrp $WS_GROUP "$LSWS_HOME/admin/htpasswds/status" chmod 0640 "$LSWS_HOME/admin/htpasswds/status" if [ -e "$LSWS_HOME/bin/.lshttpd" ]; then rm "$LSWS_HOME/bin/.lshttpd" $TEST_BIN ! -L "$LSWS_HOME/bin/lshttpd" if [ $? -eq 0 ]; then rm "$LSWS_HOME/bin/lshttpd" fi if [ -d "$LSWS_HOME/../ecp/lsws" ]; then rm -rf "$LSWS_HOME/../ecp/lsws" fi fi if [ $INSTALL_TYPE = "upgrade" ]; then util_ccpfile "$CONF_OWN" $CONF_MOD admin/conf/admin_config.xml util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/php.ini util_ccpfile "$CONF_OWN" $CONF_MOD conf/httpd_config.xml conf/mime.properties conf/templates/ccl.xml conf/templates/phpsuexec.xml conf/templates/rails.xml util_ccpfile "$CONF_OWN" $CONF_MOD conf/templates/ccl.xml $TEST_BIN ! -L "$LSWS_HOME/bin/lshttpd" if [ $? -eq 0 ]; then mv -f "$LSWS_HOME/bin/lshttpd" "$LSWS_HOME/bin/lshttpd.old" fi $TEST_BIN ! -L "$LSWS_HOME/bin/lscgid" if [ $? -eq 0 ]; then mv -f "$LSWS_HOME/bin/lscgid" "$LSWS_HOME/bin/lscgid.old" fi $TEST_BIN ! -L "$LSWS_HOME/bin/lswsctrl" if [ $? -eq 0 ]; then mv -f "$LSWS_HOME/bin/lswsctrl" "$LSWS_HOME/bin/lswsctrl.old" fi $TEST_BIN ! -L "$LSWS_HOME/admin/html" if [ $? -eq 0 ]; then mv -f "$LSWS_HOME/admin/html" "$LSWS_HOME/admin/html.old" fi if [ ! -f "$LSWS_HOME/DEFAULT/conf/vhconf.xml" ]; then util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf fi else util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/admin_config.xml util_cpfile "$CONF_OWN" $CONF_MOD conf/templates/ccl.xml conf/templates/phpsuexec.xml conf/templates/rails.xml util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/php.ini util_cpfile "$CONF_OWN" $CONF_MOD conf/httpd_config.xml conf/mime.properties util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT/html DEFAULT/cgi-bin util_cpdir "$SDIR_OWN" $DOC_MOD DEFAULT/html DEFAULT/cgi-bin fi "$LSWS_HOME/admin/fcgi-bin/admin_php5" -v 2>&1 1>/dev/null if [ $? -ne 0 ] && [ -e /etc/redhat-release ]; then yum install -y libnsl fi if [ $SETUP_PHP -eq 1 ]; then if [ ! -s "$LSWS_HOME/fcgi-bin/lsphp" ]; then cp -f "$LSWS_HOME/admin/fcgi-bin/admin_php5" "$LSWS_HOME/fcgi-bin/lsphp" chown "$SDIR_OWN" "$LSWS_HOME/fcgi-bin/lsphp" chmod "$EXEC_MOD" "$LSWS_HOME/fcgi-bin/lsphp" fi if [ ! -f "$LSWS_HOME/fcgi-bin/lsphp4" ]; then ln -sf "./lsphp" "$LSWS_HOME/fcgi-bin/lsphp4" fi if [ ! -f "$LSWS_HOME/fcgi-bin/lsphp5" ]; then ln -sf "./lsphp" "$LSWS_HOME/fcgi-bin/lsphp5" fi fi chown -R "$CONF_OWN" "$LSWS_HOME/conf/" chmod -R o-rwx "$LSWS_HOME/conf/" util_mkdir "$DIR_OWN" $SDIR_MOD tmp util_mkdir "$DIR_OWN" $DIR_MOD DEFAULT/logs DEFAULT/fcgi-bin util_cpdirv "$SDIR_OWN" $DOC_MOD $LS_VER admin/html if [ -f "$LSWS_HOME/admin/conf/htaccess" ]; then ln "$LSWS_HOME/admin/conf/htaccess" "$LSWS_HOME/admin/html.$LS_VER/.htaccess" fi if [ -f "$LSINSTALL_DIR/bin/lshttpd.sse4" ]; then grep pclmulqdq /proc/cpuinfo > /dev/null if [ $? -eq 0 ]; then mv "$LSINSTALL_DIR/bin/lshttpd" "$LSINSTALL_DIR/bin/lshttpd.regular" mv "$LSINSTALL_DIR/bin/lshttpd.sse4" "$LSINSTALL_DIR/bin/lshttpd" fi fi util_cpfile "$SDIR_OWN" $EXEC_MOD bin/wswatch.sh util_cpfilev "$SDIR_OWN" $EXEC_MOD $LS_VER bin/lswsctrl bin/lshttpd bin/lscgid util_cpfilev "$SDIR_OWN" $DOC_MOD $LS_VER BUILD $TEST_BIN ! -L "$LSWS_HOME/modules" if [ $? -eq 0 ]; then mv -f "$LSWS_HOME/modules" "$LSWS_HOME/modules.old" fi if [ -d "$LSWS_HOME/modules.$LS_VER" ]; then rm -rf "$LSWS_HOME/modules.$LS_VER" fi util_mkdir "$SDIR_OWN" $DIR_MOD modules.$LS_VER util_cpdirv "$SDIR_OWN" $EXEC_MOD $LS_VER modules #if [ -e "$LSINSTALL_DIR/bin/lshttpd.dbg" ]; then # if [ -f "$LSINSTALL_DIR/bin/lshttpd.dbg.$LS_VER" ]; then # rm "$LSINSTALL_DIR/bin/lshttpd.dbg.$LS_VER" # fi # util_cpfilev "$SDIR_OWN" $EXEC_MOD $LS_VER bin/lshttpd.dbg # # #enable debug build for beta release # ln -sf ./lshttpd.dbg.$LS_VER $LSWS_HOME/bin/lshttpd #fi ln -sf ./lshttpd.$LS_VER $LSWS_HOME/bin/lshttpd ln -sf lshttpd $LSWS_HOME/bin/litespeed ln -sf BUILD.$LS_VER $LSWS_HOME/BUILD ln -sf lscgid.$LS_VER $LSWS_HOME/bin/httpd if [ $INST_USER = "root" ]; then chmod u+s "$LSWS_HOME/bin/lscgid.$LS_VER" fi pkill _recaptcha util_mkdir "$SDIR_OWN" $DIR_MOD lsrecaptcha util_cpfile "$SDIR_OWN" $EXEC_MOD lsrecaptcha/_recaptcha util_cpfile "$SDIR_OWN" $DOC_MOD lsrecaptcha/_recaptcha.shtml util_cpdir "$SDIR_OWN" $DOC_MOD docs/ util_cpfile "$SDIR_OWN" $DOC_MOD VERSION LICENSE* if [ -f $LSWS_HOME/autoupdate/download ]; then rm $LSWS_HOME/autoupdate/download fi #compress_admin_file if [ ! -f "$LSWS_HOME/admin/conf/jcryption_keypair" ]; then $LSWS_HOME/admin/misc/create_admin_keypair.sh fi chown "$CONF_OWN" "$LSWS_HOME/admin/conf/jcryption_keypair" chmod 0600 "$LSWS_HOME/admin/conf/jcryption_keypair" fix_cloudlinux fix_alt_ruby if [ $INST_USER = "root" ]; then $LSWS_HOME/admin/misc/rc-inst.sh fi # restart detached PHP touch "$LSWS_HOME/admin/tmp/.lsphp_restart.txt" "${LSWS_HOME}/admin/misc/lscmctl" --update-lib if [ -d "/dev/shm/lsws" ]; then rm -rf /dev/shm/lsws fi if [ -d "/tmp/lshttpd/swap" ]; then rm -rf /tmp/lshttpd/swap/* fi download_quic_cloud_ips } setupPHPAccelerator() { cat </ or http://:/ EOF if [ $INST_USER = "root" ]; then if [ $INSTALL_TYPE != "upgrade" ]; then printf "%s\n%s" "Would you like to have LiteSpeed Web Server started automatically" "when the server restarts [Y/n]? " read START_SERVER echo if [ "x$START_SERVER" = "x" ]; then START_SERVER=y fi if [ `expr "$START_SERVER" : '[Yy]'` -gt 0 ]; then $LSWS_HOME/admin/misc/rc-inst.sh else cat <