Merge branch 'stable' into v1.9.4

This commit is contained in:
Usman Nasir 2020-02-22 10:37:24 +05:00
commit 8bcdc43c66
4 changed files with 119 additions and 25 deletions

View File

@ -329,8 +329,16 @@ fi
install_lscwp() {
ssh_v="ssh -o StrictHostKeyChecking=no root@$server_ip -p$server_port -i /root/.ssh/cyberpanel_migration_key"
$ssh_v "ls -l /usr/bin/wp"
if [[ $? != "0" ]] ; then
$ssh_v "$sudoer wget -O /usr/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar"
$ssh_v "$sudoer chmod +x /usr/bin/wp"
fi
#install WP CLI if not yet installed.
$ssh_v "sudo -u $owner_user -i -- wp --path=/home/${domains[$i]}/public_html plugin install litespeed-cache"
echo -e "\nInstalling LiteSpeed Cache for WordPress..."
}
export_database() {
@ -397,6 +405,16 @@ echo -e "\nNo file on this server will be touched.\n"
read -rsn1 -p "Please press any key to continue..."
}
db_length_check() {
ssh_v="ssh -o StrictHostKeyChecking=no root@$server_ip -p$server_port -i /root/.ssh/cyberpanel_migration_key"
output=$($ssh_v "$sudoer cat /usr/local/CyberCP/plogical/mysqlUtilities.py")
if echo $output | grep -q "should be 16 at max" ; then
echo -e "\nPlease upgrade your CyberPanel to latest first..."
clean_up
exit
fi
}
check_dir
#check if this is an easyengine server and create a temp dir for storing files during the process.
@ -429,9 +447,10 @@ echo -e "\n\nchecking necessary package..."
fi
fetch_cyberpanel_key
#function to get cyberpanel server key so future SSH command won't require password input.
db_length_check
tLen=${#domains[@]}
#get the domain list and number of domains.

View File

@ -4,15 +4,6 @@
SUDO_TEST=$(set)
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
if [[ $? != "0" ]] ; then
apt upgrade
DEBIAN_FRONTEND=noninteractive apt install -y locales
locale-gen "en_US.UTF-8"
update-locale LC_ALL="en_US.UTF-8"
fi
DEV="OFF"
BRANCH="stable"
POSTFIX_VARIABLE="ON"
@ -35,6 +26,7 @@ TOTAL_RAM=$(free -m | awk '/Mem\:/ { print $2 }')
CENTOS_8="False"
WATCHDOG="OFF"
BRANCH_NAME="v${TEMP:12:3}.${TEMP:25:1}"
VIRT_TYPE=""
check_return() {
#check previous command result , 0 = ok , non-0 = something wrong.
@ -110,14 +102,46 @@ echo ${WEBADMIN_PASS} > /etc/cyberpanel/webadmin_passwd
chmod 600 /etc/cyberpanel/webadmin_passwd
}
openvz_change() {
if [[ $VIRT_TYPE == "OpenVZ" ]] ; then
if [[ ! -d /etc/systemd/system/pure-ftpd.service.d ]] ; then
mkdir /etc/systemd/system/pure-ftpd.service.d
echo "[Service]
PIDFile=/run/pure-ftpd.pid" > /etc/systemd/system/pure-ftpd.service.d/override.conf
echo -e "PureFTPd service file modified for OpenVZ..."
fi
if [[ ! -d /etc/systemd/system/lshttpd.service.d ]] ; then
mkdir /etc/systemd/system/lshttpd.service.d
echo "[Service]
PIDFile=/tmp/lshttpd/lshttpd.pid" > /etc/systemd/system/lshttpd.service.d/override.conf
echo -e "LiteSPeed service file modified for OpenVZ..."
fi
if [[ ! -d /etc/systemd/system/spamassassin.service.d ]] ; then
mkdir /etc/systemd/system/spamassassin.service.d
echo "[Service]
PIDFile=/run/spamassassin.pid" > /etc/systemd/system/spamassassin.service.d/override.conf
echo -e "SpamAssassin service file modified for OpenVZ..."
fi
fi
}
check_virtualization() {
echo -e "Checking virtualization type..."
if hostnamectl | grep "Virtualization: lxc" ; then
if hostnamectl | grep -q "Virtualization: lxc" ; then
echo -e "\nLXC detected..."
echo -e "CyberPanel does not support LXC"
echo -e "Exiting..."
exit
fi
if hostnamectl | grep -q "Virtualization: openvz" ; then
echo -e "\nOpenVZ detected..."
VIRT_TYPE="OpenVZ"
openvz_change
fi
}
license_validation() {
@ -168,7 +192,7 @@ sed -i 's|cyberpanel.sh|'$DOWNLOAD_SERVER'|g' install.py
sed -i 's|mirror.cyberpanel.net|'$DOWNLOAD_SERVER'|g' install.py
sed -i 's|git clone https://github.com/usmannasir/cyberpanel|echo downloaded|g' install.py
#change to CDN first, regardless country
sed -i 's|http://|https://|g' install.py
#sed -i 's|http://|https://|g' install.py
if [[ $PROVIDER == "Alibaba Cloud" ]] ; then
if ! grep -q "100.100.2.136" /etc/resolv.conf ; then
@ -1058,10 +1082,10 @@ fi
echo -e "\nWould you like to set up a WatchDog \e[31m(beta)\e[39m for Web service and Database service ?"
echo -e "The watchdog script will be automatically started up after installation and server reboot"
echo -e "If you want to kill the watchdog , run \e[31mwatchdog kill\e[39m"
echo -e "Please type Yes or no (with capital \e[31mY\e[39m):"
echo -e "Please type Yes or no (with capital \e[31mY\e[39m, default Yes):"
printf "%s"
read TMP_YN
if [[ $TMP_YN == "Yes" ]] ; then
if [[ $TMP_YN == "Yes" ]] || [[ $TMP_YN == "" ]] ; then
WATCHDOG="ON"
else
WATCHDOG="OFF"
@ -1099,6 +1123,9 @@ if [[ $debug == "0" ]] ; then
fi
if [[ $debug == "1" ]] ; then
wget -O requirements.txt https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/requirments.txt
/usr/local/CyberPanel/bin/pip3 install --ignore-installed -r requirements.txt
rm -f requirements.txt
/usr/local/CyberPanel/bin/python install.py $SERVER_IP $SERIAL_NO $LICENSE_KEY --postfix $POSTFIX_VARIABLE --powerdns $POWERDNS_VARIABLE --ftp $PUREFTPD_VARIABLE
if grep "CyberPanel installation successfully completed" /var/log/installLogs.txt > /dev/null; then
@ -1119,6 +1146,16 @@ fi
}
pip_virtualenv() {
if [[ $SERVER_OS == "Ubuntu" ]] ; then
DEBIAN_FRONTEND=noninteractive apt install -y locales
locale-gen "en_US.UTF-8"
update-locale LC_ALL="en_US.UTF-8"
fi
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
#need to set lang to address some pip module installation issue.
if [[ $DEV == "OFF" ]] ; then
if [[ $SERVER_COUNTRY == "CN" ]] ; then
mkdir /root/.config
@ -1336,14 +1373,18 @@ if [[ ! -f /usr/local/lsws/lsphp74/lib64/php/modules/zip.so ]] && [[ $SERVER_OS
if [[ $? == "0" ]] ; then
yum remove -y libzip-devel
fi
yum install -y http://packages.psychotic.ninja/7/plus/x86_64/RPMS/libzip-0.11.2-6.el7.psychotic.x86_64.rpm
yum install -y http://packages.psychotic.ninja/7/plus/x86_64/RPMS/libzip-devel-0.11.2-6.el7.psychotic.x86_64.rpm
yum install -y https://$DOWNLOAD_SERVER/misc/libzip-0.11.2-6.el7.psychotic.x86_64.rpm
yum install -y https://$DOWNLOAD_SERVER/misc/libzip-devel-0.11.2-6.el7.psychotic.x86_64.rpm
/usr/local/lsws/lsphp74/bin/pecl install zip
echo "extension=zip.so" > /usr/local/lsws/lsphp74/etc/php.d/20-zip.ini
chmod 755 /usr/local/lsws/lsphp74/lib64/php/modules/zip.so
fi
#fix the lsphp74-zip missing issue.
if [[ $SERVER_OS == "CentOS" ]] ; then
sed -i 's|error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_STRICT|error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_STRICT|g' /usr/local/lsws/{lsphp72,lsphp73}/etc/php.ini
fi
#fix php.ini & issue
clear
echo "###################################################################"
@ -1361,12 +1402,9 @@ echo " Panel password: $ADMIN_PASS "
echo " WebAdmin console username: admin "
echo " WebAdmin console password: $WEBADMIN_PASS "
echo " "
echo " Please change your default admin password "
echo " If you need to reset your panel password, please run: "
echo " adminPass YOUR_NEW_PASSWORD "
echo " "
echo " If you change mysql password, please modify file in "
echo -e " \e[31m/etc/cyberpanel/mysqlPassword\e[39m with new password as well "
echo -e " Run \e[31mcyberpanel help\e[39m to get FAQ info"
echo -e " Run \e[31mcyberpanel upgrade\e[39m to upgrade it to latest version."
echo -e " Run \e[31mcyberpanel utility\e[39m to access some handy tools ."
echo " "
echo " Website : https://www.cyberpanel.net "
echo " Forums : https://forums.cyberpanel.net "
@ -1593,8 +1631,10 @@ fi
SECONDS=0
install_required
openvz_change
pip_virtualenv
system_tweak
main_install
main_install

View File

@ -208,6 +208,10 @@ fi
install_utility
if [[ $SERVER_OS == "CentOS7" ]] ; then
sed -i 's|error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_STRICT|error_reporting = E_ALL \& ~E_DEPRECATED \& ~E_STRICT|g' /usr/local/lsws/{lsphp72,lsphp73}/etc/php.ini
#fix php.ini & issue
yum list installed lsphp74-devel
if [[ $? != "0" ]] ; then
yum install -y lsphp74-devel
@ -227,8 +231,8 @@ if [[ ! -f /usr/local/lsws/lsphp74/lib64/php/modules/zip.so ]] && [[ $SERVER_OS
yum remove -y libzip-devel
fi
yum install -y http://packages.psychotic.ninja/7/plus/x86_64/RPMS/libzip-0.11.2-6.el7.psychotic.x86_64.rpm
yum install -y http://packages.psychotic.ninja/7/plus/x86_64/RPMS/libzip-devel-0.11.2-6.el7.psychotic.x86_64.rpm
yum install -y https://cdn.cyberpanel.sh/misc/libzip-0.11.2-6.el7.psychotic.x86_64.rpm
yum install -y https://cdn.cyberpanel.sh/misc/libzip-devel-0.11.2-6.el7.psychotic.x86_64.rpm
yum install lsphp74-devel
if [[ ! -d /usr/local/lsws/lsphp74/tmp ]] ; then

31
faq.sh
View File

@ -80,4 +80,35 @@ ${BLUE}------------------------------------------------------------${NC}
${PURPLE}9.${NC} How to enable Auto-Index for my site ?
Please check this post ${GREEN}https://forums.cyberpanel.net/discussion/3850/tutorial-how-to-enable-auto-index-on-openlitespeed-and-litespeed-enterprise${NC}
${BLUE}------------------------------------------------------------${NC}
${PURPLE}10.${NC} How to add additional headers for my website ?
Please check this post ${GREEN}https://openlitespeed.org/kb/how-to-set-up-custom-headers/${NC}
${BLUE}------------------------------------------------------------${NC}
${PURPLE}11.${NC} How to mimic Apache deny/allow directive ?
Please check this post ${GREEN}https://openlitespeed.org/kb/access-control/${NC}
${BLUE}------------------------------------------------------------${NC}
${PURPLE}12.${NC} How to fix max_allowed_packet error ?
You may see this error when your PHP script requires a larger packet size
add following code into ${RED}/etc/my.cnf${NC}
${GREEN}[mysqld]
max_allowed_packet=500M${NC}
and then restart MariaDB by command ${RED}systemctl restart mariadb${NC}
${BLUE}------------------------------------------------------------${NC}
${PURPLE}13.${NC} How to enable PHP error log ?
Please check this post ${GREEN}https://forums.cyberpanel.net/discussion/3977/tutorial-how-to-enable-php-error-log/p1${NC}
"