Added nginx without PHP-FPM
This commit is contained in:
25
CMS/none/Nginx-nonphp-unconfigured
Normal file
25
CMS/none/Nginx-nonphp-unconfigured
Normal file
@@ -0,0 +1,25 @@
|
||||
#beginConf
|
||||
|
||||
#access_log /var/log/nginx/SITEname-access.log;
|
||||
error_log /var/log/nginx/SITEname-error.log;
|
||||
|
||||
index index.php index.html index.htm index.nginx-debian.html;
|
||||
root /var/www/DOMAINname/html;
|
||||
gzip on;
|
||||
gzip_proxied any;
|
||||
gzip_types text/plain text/css text/xml text/javascript application/javascript application/x-javascript image/svg image/svg+xml application/xml image/x-icon;
|
||||
gzip_comp_level 2;
|
||||
gzip_disable "msie6";
|
||||
gzip_buffers 16 8k;
|
||||
|
||||
location / {
|
||||
#try_files $uri $uri/ =404;
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
#try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
#endConf
|
||||
@@ -1,7 +1,12 @@
|
||||
#Backend PHP Pool
|
||||
#Do not generate php pool when php is not installed
|
||||
if [ $webserv != nginx-nonphp ]; then
|
||||
|
||||
#Setup PHP Pool
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/none/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf
|
||||
sed -i -e 's/PHPver/'$phpver'/' -e 's/SITEname/'$sitename'/' -e 's/DOMAINname/'$domain'/' /etc/php/"$phpver"/fpm/pool.d/$sitename.conf
|
||||
groupadd "$sitename"
|
||||
useradd -g "$sitename" "$sitename"
|
||||
|
||||
systemctl reload php"$phpver"-fpm
|
||||
systemctl reload php"$phpver"-fpm
|
||||
|
||||
fi
|
||||
9
CMS/none/nginx-nonphp-conf.sh
Normal file
9
CMS/none/nginx-nonphp-conf.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/none/Nginx-unconfigured -O /tmp/nginx-siteconf
|
||||
sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/nginx-siteconf
|
||||
sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/"$sitename"_"$site_ext"
|
||||
mkdir -p /var/www/"$domain"/html
|
||||
|
||||
echo "<html><head></head><body>$webserv has been succsefully installed by the Wizard</body></html>" > /var/www/$domain/html/index.html
|
||||
|
||||
chown "$sitename":"$sitename" -R /var/www/"$domain"/html
|
||||
systemctl reload nginx
|
||||
22
CoreModules/nginx-nonphp/appendCMS-conf.sh
Normal file
22
CoreModules/nginx-nonphp/appendCMS-conf.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#############
|
||||
# Nginx #
|
||||
#############
|
||||
|
||||
if [ $domainwww = 1 ]; then
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
fi
|
||||
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_nossl
|
||||
ln -s /etc/nginx/sites-available/"$sitename"_nossl /etc/nginx/sites-enabled/"$sitename"
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_ssl
|
||||
|
||||
systemctl reload nginx
|
||||
1
CoreModules/nginx-nonphp/apt.list
Normal file
1
CoreModules/nginx-nonphp/apt.list
Normal file
@@ -0,0 +1 @@
|
||||
nginx apache2-utils python-certbot-nginx
|
||||
31
CoreModules/nginx-nonphp/conf.sh
Normal file
31
CoreModules/nginx-nonphp/conf.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
systemctl stop nginx
|
||||
|
||||
#############
|
||||
# Nginx #
|
||||
#############
|
||||
|
||||
mkdir -p /var/www/html /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/snippets /etc/nginx/modules-available /etc/nginx/modules-enabled /etc/nginx/snippets/
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/fastcgi.conf -O /etc/nginx/fastcgi.conf
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/snippets-ssl.conf -O /etc/nginx/snippets/ngx-ssl.conf
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/nginx-default.conf -O /etc/nginx/nginx.conf
|
||||
|
||||
if [ $domainwww = 1 ]; then
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
echo "" >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
fi
|
||||
#non-ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_nossl
|
||||
ln -s /etc/nginx/sites-available/"$sitename"_nossl /etc/nginx/sites-enabled/"$sitename"
|
||||
#ssl
|
||||
wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl
|
||||
sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_ssl
|
||||
|
||||
# custom Welcome page
|
||||
echo "<html><head></head><body>$webserv is functioning normally</body></html>" > /usr/share/nginx/html/index.html
|
||||
|
||||
systemctl start nginx
|
||||
2
CoreModules/nginx-nonphp/preconf.sh
Normal file
2
CoreModules/nginx-nonphp/preconf.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list
|
||||
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
|
||||
9
CoreModules/nginx-nonphp/ssl-handler.sh
Normal file
9
CoreModules/nginx-nonphp/ssl-handler.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
rm /etc/nginx/sites-enabled/"$sitename"
|
||||
ln -s /etc/nginx/sites-available/"$sitename"_ssl /etc/nginx/sites-enabled/"$sitename"
|
||||
|
||||
if [ -n "$sslfr" ]; then
|
||||
rm /etc/nginx/sites-enabled/Backend
|
||||
ln -s /etc/nginx/sites-available/Backend_ssl /etc/nginx/sites-enabled/Backend
|
||||
fi
|
||||
|
||||
systemctl reload nginx
|
||||
@@ -5,6 +5,7 @@
|
||||
if [ $IMODE = n ]; then
|
||||
#WebServers
|
||||
webservers=("Nginx:" "Will install NGINX Webserver." ON)
|
||||
webservers+=("Nginx-nonphp:" "Will install NGINX Webserver without php-fpm." ON)
|
||||
webservers+=("Apache:" "Will install Apache Webserver." OFF)
|
||||
|
||||
##Nginx
|
||||
@@ -15,6 +16,12 @@ nginxCMSL+=("Nextcloud:" "Nextcloud is a suite of client-server software for cre
|
||||
#Options
|
||||
nginxOptions=("Redis:" "Redis caching" OFF)
|
||||
|
||||
##Nginx
|
||||
#CMSList
|
||||
nginx-nonphpCMSL=("None:" "A plain webserver will be setup." OFF)
|
||||
#Options
|
||||
nginx-nonphpOptions=("Redis:" "Redis caching" OFF)
|
||||
|
||||
##Apache
|
||||
#CMSList
|
||||
apacheCMSL=("None:" "A plain webserver will be setup." OFF)
|
||||
@@ -22,20 +29,28 @@ apacheCMSL+=("Wordpress:" "WordPress is a content management system based on PHP
|
||||
apacheCMSL+=("Nextcloud:" "Nextcloud is a suite of client-server software for creating and using file hosting services." OFF)
|
||||
#Options
|
||||
apacheOptions=("Redis:" "Redis caching" OFF)
|
||||
|
||||
fi
|
||||
if [ $IMODE = l ]; then
|
||||
#WebServers
|
||||
webservers=("Nginx" "Apache" "Quit")
|
||||
webservers=("Nginx" "Nginx-nonphp" "Apache" "Quit")
|
||||
|
||||
##Nginx
|
||||
#CMSList
|
||||
nginxCMSL=("None" "Wordpress" "Nextcloud")
|
||||
#Options
|
||||
nginxOptions=("Redis:")
|
||||
|
||||
##Nginx-nonphp
|
||||
#CMSList
|
||||
nginx-nonphpCMSL=("None")
|
||||
#Options
|
||||
nginx-nonphpOptions=("Redis:")
|
||||
|
||||
##Apache
|
||||
#CMSList
|
||||
apacheCMSL=("None" "Wordpress" "Nextcloud")
|
||||
#Options
|
||||
apacheOptions=("Redis:")
|
||||
|
||||
fi
|
||||
Reference in New Issue
Block a user