increase nginx open file limit
This commit is contained in:
parent
020a59cb97
commit
db3f0bbd4f
|
@ -31,9 +31,12 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
nginxdefaultconf='/etc/nginx/nginx.conf'
|
||||
# increase default nginx worker connections
|
||||
/bin/bash -c "sed -i 's/worker_connections.*/worker_connections ${WORKER_CONNECTIONS};/g' /etc/nginx/nginx.conf"
|
||||
/bin/bash -c "sed -i 's/worker_connections.*/worker_connections ${WORKER_CONNECTIONS};/g' $nginxdefaultconf"
|
||||
|
||||
sudo sed -i '1s/^/worker_rlimit_nofile 1000000;\
|
||||
/' $nginxdefaultconf
|
||||
|
||||
if [[ $DEV -eq 1 ]]; then
|
||||
API_NGINX="
|
||||
|
|
10
install.sh
10
install.sh
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT_VERSION="64"
|
||||
SCRIPT_VERSION="65"
|
||||
SCRIPT_URL='https://raw.githubusercontent.com/amidaware/tacticalrmm/master/install.sh'
|
||||
|
||||
sudo apt install -y curl wget dirmngr gnupg lsb-release
|
||||
|
@ -174,8 +174,12 @@ print_green 'Installing Nginx'
|
|||
|
||||
sudo apt install -y nginx
|
||||
sudo systemctl stop nginx
|
||||
sudo sed -i 's/worker_connections.*/worker_connections 2048;/g' /etc/nginx/nginx.conf
|
||||
sudo sed -i 's/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/g' /etc/nginx/nginx.conf
|
||||
nginxdefaultconf='/etc/nginx/nginx.conf'
|
||||
sudo sed -i '/worker_rlimit_nofile.*/d' $nginxdefaultconf
|
||||
sudo sed -i 's/worker_connections.*/worker_connections 2048;/g' $nginxdefaultconf
|
||||
sudo sed -i 's/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/g' $nginxdefaultconf
|
||||
sudo sed -i '1s/^/worker_rlimit_nofile 1000000;\
|
||||
/' $nginxdefaultconf
|
||||
|
||||
print_green 'Installing NodeJS'
|
||||
|
||||
|
|
12
restore.sh
12
restore.sh
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT_VERSION="38"
|
||||
SCRIPT_VERSION="39"
|
||||
SCRIPT_URL='https://raw.githubusercontent.com/amidaware/tacticalrmm/master/restore.sh'
|
||||
|
||||
sudo apt update
|
||||
|
@ -126,7 +126,15 @@ sudo systemctl stop nginx
|
|||
sudo rm -rf /etc/nginx
|
||||
sudo mkdir /etc/nginx
|
||||
sudo tar -xzf $tmp_dir/nginx/etc-nginx.tar.gz -C /etc/nginx
|
||||
sudo sed -i 's/worker_connections.*/worker_connections 2048;/g' /etc/nginx/nginx.conf
|
||||
nginxdefaultconf='/etc/nginx/nginx.conf'
|
||||
sudo sed -i 's/worker_connections.*/worker_connections 2048;/g' $nginxdefaultconf
|
||||
CHECK_NGINX_NOLIMIT=$(grep "worker_rlimit_nofile 1000000" $nginxdefaultconf)
|
||||
if ! [[ $CHECK_NGINX_NOLIMIT ]]; then
|
||||
sudo sed -i '/worker_rlimit_nofile.*/d' $nginxdefaultconf
|
||||
printf >&2 "${GREEN}Increasing nginx open file limit${NC}\n"
|
||||
sudo sed -i '1s/^/worker_rlimit_nofile 1000000;\
|
||||
/' $nginxdefaultconf
|
||||
fi
|
||||
rmmdomain=$(grep server_name /etc/nginx/sites-available/rmm.conf | grep -v 301 | head -1 | tr -d " \t" | sed 's/.*server_name//' | tr -d ';')
|
||||
frontenddomain=$(grep server_name /etc/nginx/sites-available/frontend.conf | grep -v 301 | head -1 | tr -d " \t" | sed 's/.*server_name//' | tr -d ';')
|
||||
meshdomain=$(grep server_name /etc/nginx/sites-available/meshcentral.conf | grep -v 301 | head -1 | tr -d " \t" | sed 's/.*server_name//' | tr -d ';')
|
||||
|
|
17
update.sh
17
update.sh
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT_VERSION="136"
|
||||
SCRIPT_VERSION="137"
|
||||
SCRIPT_URL='https://raw.githubusercontent.com/amidaware/tacticalrmm/master/update.sh'
|
||||
LATEST_SETTINGS_URL='https://raw.githubusercontent.com/amidaware/tacticalrmm/master/api/tacticalrmm/tacticalrmm/settings.py'
|
||||
YELLOW='\033[1;33m'
|
||||
|
@ -165,13 +165,22 @@ EOF
|
|||
)"
|
||||
echo "${uwsgini}" > /rmm/api/tacticalrmm/app.ini
|
||||
|
||||
CHECK_NGINX_WORKER_CONN=$(grep "worker_connections 2048" /etc/nginx/nginx.conf)
|
||||
nginxdefaultconf='/etc/nginx/nginx.conf'
|
||||
CHECK_NGINX_WORKER_CONN=$(grep "worker_connections 2048" $nginxdefaultconf)
|
||||
if ! [[ $CHECK_NGINX_WORKER_CONN ]]; then
|
||||
printf >&2 "${GREEN}Changing nginx worker connections to 2048${NC}\n"
|
||||
sudo sed -i 's/worker_connections.*/worker_connections 2048;/g' /etc/nginx/nginx.conf
|
||||
sudo sed -i 's/worker_connections.*/worker_connections 2048;/g' $nginxdefaultconf
|
||||
fi
|
||||
|
||||
sudo sed -i 's/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/g' /etc/nginx/nginx.conf
|
||||
CHECK_NGINX_NOLIMIT=$(grep "worker_rlimit_nofile 1000000" $nginxdefaultconf)
|
||||
if ! [[ $CHECK_NGINX_NOLIMIT ]]; then
|
||||
sudo sed -i '/worker_rlimit_nofile.*/d' $nginxdefaultconf
|
||||
printf >&2 "${GREEN}Increasing nginx open file limit${NC}\n"
|
||||
sudo sed -i '1s/^/worker_rlimit_nofile 1000000;\
|
||||
/' $nginxdefaultconf
|
||||
fi
|
||||
|
||||
sudo sed -i 's/# server_names_hash_bucket_size.*/server_names_hash_bucket_size 64;/g' $nginxdefaultconf
|
||||
|
||||
HAS_PY310=$(python3.10 --version | grep ${PYTHON_VER})
|
||||
if ! [[ $HAS_PY310 ]]; then
|
||||
|
|
Loading…
Reference in New Issue