You've already forked nginx-ubuntu
comment corrections only no code changes
This commit is contained in:
13
nginxinstall
13
nginxinstall
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Author : Allan Christensen
|
||||
# First Created : 05012022 (DD-MM-YYYY)
|
||||
@@ -12,7 +11,7 @@
|
||||
if [[ $(id -u) -ne 0 ]]; then echo "" && echo "Must be root or use sudo" && echo "" ; exit 1; fi
|
||||
|
||||
#
|
||||
# Check if services are allready running
|
||||
# Check if services are already running
|
||||
#
|
||||
for svc in nginx php*-fpm; do if systemctl is-active --quiet "$svc"; then printf "\n%s is already running, cannot continue...\n\n" "${svc^}" ; exit 1 ; fi ; done
|
||||
|
||||
@@ -38,12 +37,12 @@ repo="https://git.x-files.dk/webserver/nginx-snippets.git"
|
||||
if [[ -d "$nginxsnippets/.git" ]]; then git -C "$nginxsnippets" pull --quiet; else git clone --quiet "$repo" "$nginxsnippets"; fi
|
||||
|
||||
#
|
||||
# Install Php-Fpm
|
||||
# Install PHP-FPM
|
||||
#
|
||||
apt install -y php-fpm php-curl php-dom php-gd php-imagick php-ldap php-mbstring php-mysql php-pear php-soap php-xml php-zip
|
||||
|
||||
#
|
||||
# Determine Php version
|
||||
# Determine PHP version
|
||||
#
|
||||
phpver=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')
|
||||
phpfpm="php${phpver}-fpm"
|
||||
@@ -62,7 +61,7 @@ sed -i "s/PHPVERSION/$phpfpm/" /etc/nginx/nginx.conf
|
||||
sed -i "s/PHPVERSION/$phpfpm/" /etc/nginx/nginx.conf.high.perf
|
||||
|
||||
#
|
||||
# Creating a high performance www.conf file for optional or later use
|
||||
# Create a high performance www.conf file for optional or later use
|
||||
#
|
||||
cp /etc/php/"$phpver"/fpm/pool.d/www.conf /etc/nginx/www.conf.high.perf
|
||||
sed -i "s/pm.max_children = 5/pm.max_children = 50/" /etc/nginx/www.conf.high.perf
|
||||
@@ -72,7 +71,7 @@ sed -i "s/;pm.process_idle_timeout = 10s/pm.process_idle_timeout = 10s/" /etc/ng
|
||||
sed -i "s/;pm.max_requests = 500/pm.max_requests = 500/" /etc/nginx/www.conf.high.perf
|
||||
|
||||
#
|
||||
# Adjusting php.ini with stuff I usually forget
|
||||
# Adjust PHP settings commonly needed for deployments
|
||||
#
|
||||
sed -i 's/;max_input_vars = 1000/max_input_vars = 3000/' "$phpclidir"/php.ini
|
||||
sed -i 's/;max_input_vars = 1000/max_input_vars = 3000/' "$phpfpmdir"/php.ini
|
||||
@@ -82,7 +81,7 @@ sed -i 's/;date.timezone =/date.timezone = Europe\/Copenhagen/' "$phpclidir"/php
|
||||
sed -i 's/;date.timezone =/date.timezone = Europe\/Copenhagen/' "$phpfpmdir"/php.ini
|
||||
|
||||
#
|
||||
# Restart Nginx and Php-Fpm
|
||||
# Restart Nginx and PHP-FPM
|
||||
#
|
||||
systemctl restart "$phpfpm"
|
||||
systemctl restart nginx
|
||||
|
||||
Reference in New Issue
Block a user