Compare commits

...

2 Commits

Author SHA1 Message Date
邱博亞 d103562362 Fix install_orbit_environment.sh 2024-01-01 10:44:53 +08:00
邱博亞 a1dc79f11f Fix install_nginx.sh 2024-01-01 10:44:53 +08:00
2 changed files with 14 additions and 12 deletions

View File

@ -90,6 +90,8 @@ if [ -z "$cpu_cores" ]; then
cpu_cores="1";
fi
if [[ $(vercomp "$ubuntu_ver" "16") == "<" ]]; then #Need update ca-certificates manual
sudo apt-get install -y apt-transport-https ca-certificates
sudo update-ca-certificates
sudo bash -l -c "
cd /root &&
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/ca-certificates/20210119~20.04.2/ca-certificates_20210119~20.04.2.tar.xz --no-check-certificate -O ca-certificates_20210119~20.04.2.tar.xz &&
@ -241,7 +243,7 @@ if [[ $(vercomp "$nginx_ver" "$nginx_target_ver") == "<" ]] || [[ "$1" == '--fo
cp -f objs/ngx_http_modsecurity_module.so /etc/nginx/modules/. && \
echo 'load_module modules/ngx_http_modsecurity_module.so;' > /etc/nginx/modules-enabled/50-mod-modsecurity.conf && \
mkdir -p /etc/nginx/modsec && \
wget --no-check-certificate -P /etc/nginx/modsec/ https://raw.githubusercontent.com/SpiderLabs/ModSecurity/v3/master/modsecurity.conf-recommended -O modsecurity.conf && \
wget --no-check-certificate -P /etc/nginx/modsec/ https://raw.githubusercontent.com/SpiderLabs/ModSecurity/v3/master/modsecurity.conf-recommended -O /etc/nginx/modsec/modsecurity.conf && \
cd .. && \
cp -f ModSecurity/unicode.mapping /etc/nginx/modsec && \
sed -i 's/SecRuleEngine DetectionOnly/SecRuleEngine On/' /etc/nginx/modsec/modsecurity.conf && \
@ -284,16 +286,6 @@ if [[ $(vercomp "$nginx_ver" "$nginx_target_ver") == "<" ]] || [[ "$1" == '--fo
http_block_end=$((http_block_end + 1))
fi
done
if [[ "$install_modsecurity" == "1" ]]; then
echo "Please modify your nginx conf file by yourself!"
echo "
server {
# ...
modsecurity on;
modsecurity_rules_file /etc/nginx/modsec/main.conf;
}
"
fi
fi
if [[ -z "$(grep -E 'include\s+\/etc\/nginx\/modules-enabled\/\*\.conf;' /etc/nginx/nginx.conf)" ]]; then
nginx_conf_path="/etc/nginx/nginx.conf"
@ -301,5 +293,15 @@ if [[ $(vercomp "$nginx_ver" "$nginx_target_ver") == "<" ]] || [[ "$1" == '--fo
sudo bash -l -c "echo '$nginx_conf_contents' > $nginx_conf_path"
sudo service nginx restart
fi
if [[ "$install_modsecurity" == "1" ]]; then
echo "Please modify your nginx conf file by yourself!"
echo "
server {
# ...
modsecurity on;
modsecurity_rules_file /etc/nginx/modsec/main.conf;
}
"
fi
cd "$org_pwd"
fi

View File

@ -302,7 +302,7 @@ fi
if [[ "$ubuntu_version" =~ '14' ]]; then
install_mongodb "3.2"
else
if [ -z "$(lscpu |grep 'avx')" ]; then #Latest version not use avx instruction is 4.4.
if [ -z "$(lscpu |grep -w 'avx')" ]; then #Latest version not use avx instruction is 4.4.
install_mongodb "4.4"
else
install_mongodb "6.0"