Several new features
- cht.sh stack : linux online cheatsheet. Usage : `cheat <command>`. Example for tar : `cheat tar` - ClamAV anti-virus with weekly cronjob to update signatures database - Internal function to add daily cronjobs - Additional comment to detect previous configuration tuning (MariaDB & Redis) - Domain/Subdomain detection based on public domain suffixes list - Increase Nginx & MariaDB systemd open_files limits - Cronjob to update Cloudflare IPs list
This commit is contained in:
40
install
40
install
@@ -494,7 +494,7 @@ wo_upgrade_nginx() {
|
||||
# install new nginx package
|
||||
if [ -n "$CHECK_NGINX_EE" ]; then
|
||||
if [ -x /usr/local/bin/wo ]; then
|
||||
[ -f /etc/apt/preferences.d/nginx-block ] && { mv /etc/apt/preferences.d/nginx-block .;}
|
||||
[ -f /etc/apt/preferences.d/nginx-block ] && { mv /etc/apt/preferences.d/nginx-block /var/lib/wo/tmp/nginx-block; }
|
||||
# stop nginx
|
||||
service nginx stop
|
||||
# remove previous package
|
||||
@@ -545,7 +545,7 @@ wo_upgrade_nginx() {
|
||||
systemctl stop nginx
|
||||
systemctl start nginx
|
||||
fi
|
||||
[ -f ./nginx-block ] && { mv nginx-block /etc/apt/preferences.d/nginx-block ;}
|
||||
[ -f /var/lib/wo/tmp/nginx-block ] && { mv /var/lib/wo/tmp/nginx-block /etc/apt/preferences.d/nginx-block; }
|
||||
|
||||
} \
|
||||
>> "$wo_install_log" 2>&1
|
||||
@@ -655,7 +655,6 @@ wo_tweak_kernel() {
|
||||
# apply sysctl tweaks
|
||||
sysctl -eq -p /etc/sysctl.d/60-wo-tweaks.conf
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
wo_systemd_tweak() {
|
||||
@@ -678,6 +677,37 @@ wo_systemd_tweak() {
|
||||
|
||||
}
|
||||
|
||||
wo_domain_suffix() {
|
||||
curl -sL https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat | sed '/^\/\//d' | sed '/^$/d' | sed 's/^\s+//g' > /var/lib/wo/public_suffix_list.dat
|
||||
}
|
||||
|
||||
wo_mariadb_tweak() {
|
||||
# increase mariadb open_files_limit
|
||||
{
|
||||
if [ -d /etc/systemd/system/mariadb.service.d ] && [ ! -f /etc/systemd/system/mariadb.service.d/limits.conf ]; then
|
||||
echo -e '[Service]\nLimitNOFILE=500000' > /etc/systemd/system/mariadb.service.d/limits.conf
|
||||
systemctl daemon-reload
|
||||
service mysql restart
|
||||
fi
|
||||
} >> /var/log/wo/install.log 2>&1
|
||||
}
|
||||
|
||||
wo_nginx_tweak() {
|
||||
# increase nginx open_files_limit
|
||||
{
|
||||
if [ -x /usr/sbin/nginx ]; then
|
||||
if [ ! -d /etc/systemd/system/nginx.service.d ]; then
|
||||
mkdir -p /etc/systemd/system/nginx.service.d
|
||||
if [ ! -f /etc/systemd/system/nginx.service.d/limits.conf ]; then
|
||||
echo -e '[Service]\nLimitNOFILE=500000' > /etc/systemd/system/nginx.service.d/limits.conf
|
||||
systemctl daemon-reload
|
||||
nginx -t && service nginx restart
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
} >> /var/log/wo/install.log 2>&1
|
||||
}
|
||||
|
||||
wo_clean() {
|
||||
rm -rf /usr/local/lib/python3.*/dist-packages/wo-*
|
||||
}
|
||||
@@ -794,6 +824,8 @@ else
|
||||
wo_lib_echo "Adding systemd service tweak" | tee -ai $wo_install_log
|
||||
wo_systemd_tweak | tee -ai $wo_install_log
|
||||
fi
|
||||
wo_nginx_tweak | tee -ai $wo_install_log
|
||||
wo_mysql_tweak | tee -ai $wo_install_log
|
||||
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
|
||||
wo_update_wp_cli | tee -ai $wo_install_log
|
||||
else
|
||||
@@ -836,6 +868,8 @@ else
|
||||
wo_lib_echo "Adding systemd service tweak" | tee -ai $wo_install_log
|
||||
wo_systemd_tweak | tee -ai $wo_install_log
|
||||
fi
|
||||
wo_nginx_tweak | tee -ai $wo_install_log
|
||||
wo_mysql_tweak | tee -ai $wo_install_log
|
||||
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
|
||||
wo_git_init | tee -ai $wo_install_log
|
||||
wo_update_wp_cli | tee -ai $wo_install_log
|
||||
|
||||
Reference in New Issue
Block a user