update newsite
This commit is contained in:
@@ -279,11 +279,12 @@ STATUS(){
|
|||||||
if [ "${STATUS_CHECK_EMAIL}" != "" ]; then echo "${NM_NODETYPES[$NTYPE]}-Node${nid} is back UP!" | mail -s "${NM_NODETYPES[$NTYPE]}-Node${nid}-${nip}-UP" ${STATUS_CHECK_EMAIL}; fi
|
if [ "${STATUS_CHECK_EMAIL}" != "" ]; then echo "${NM_NODETYPES[$NTYPE]}-Node${nid} is back UP!" | mail -s "${NM_NODETYPES[$NTYPE]}-Node${nid}-${nip}-UP" ${STATUS_CHECK_EMAIL}; fi
|
||||||
fi
|
fi
|
||||||
var2=${NTYPE}_REPL_CHECK[@]
|
var2=${NTYPE}_REPL_CHECK[@]
|
||||||
|
timeout=`date --date='20 seconds' +%s`
|
||||||
for rcheck in "${!var2}"; do
|
for rcheck in "${!var2}"; do
|
||||||
if [ "${ST_ACTION}" != "check" ]; then
|
if [ "${ST_ACTION}" != "check" ]; then
|
||||||
c=0; cw=22; spc=''
|
c=0; cw=22; spc=''
|
||||||
spc1=${cw}-${#REPL_DESC[${rcheck}]}
|
spc1=${cw}-${#REPL_DESC[${rcheck}]}
|
||||||
timeout=`date --date='20 seconds' +%s`
|
|
||||||
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||||
echo -en " ${REPL_DESC[${rcheck}]}${spc}: "
|
echo -en " ${REPL_DESC[${rcheck}]}${spc}: "
|
||||||
fi
|
fi
|
||||||
@@ -917,9 +918,9 @@ NEWSITE(){
|
|||||||
echo ""
|
echo ""
|
||||||
if [ "${SITE_TYPE}" = "local" ]; then
|
if [ "${SITE_TYPE}" = "local" ]; then
|
||||||
echo -e "server {
|
echo -e "server {
|
||||||
listen 8080;" > /etc/nginx/sites-available/${MAIN_SITE}
|
listen 80;" > /etc/nginx/sites-available/${MAIN_SITE}
|
||||||
if [ "${CREATE_SSL}" = "yes" ]; then
|
if [ "${CREATE_SSL}" = "yes" ]; then
|
||||||
echo -e " listen 8443 ssl http2;" >> /etc/nginx/sites-available/${MAIN_SITE}
|
echo -e " listen 443 ssl http2;" >> /etc/nginx/sites-available/${MAIN_SITE}
|
||||||
fi
|
fi
|
||||||
echo -e "
|
echo -e "
|
||||||
server_name ${NGINX_SERVERNAME};
|
server_name ${NGINX_SERVERNAME};
|
||||||
@@ -957,13 +958,22 @@ NEWSITE(){
|
|||||||
fi
|
fi
|
||||||
echo -e "}" >> /etc/nginx/sites-available/${MAIN_SITE}
|
echo -e "}" >> /etc/nginx/sites-available/${MAIN_SITE}
|
||||||
|
|
||||||
for nip in "${MYSQL_HOSTS[@]}"; do
|
|
||||||
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD=''
|
mkdir -p /var/www/${MAIN_SITE}/{public_html,nginx_logs}
|
||||||
else NCMD="ssh root@${nip}"
|
echo -en "${idsCL[LightYellow]}Waiting for folder replication across the webserver nodes... ${idsCL[Default]}"
|
||||||
|
for nip in "${WEB_HOSTS[@]}"; do
|
||||||
|
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then
|
||||||
|
checked=false
|
||||||
|
until [ "${checked}" = "" ]; do
|
||||||
|
checked=`ssh root@${nip} "[ ! -d /var/www/test ] && echo does not exist"`
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
${NCMD} mkdir -p /var/www/${MAIN_SITE}/{public_html,nginx_logs}
|
|
||||||
done
|
done
|
||||||
|
echo -e "${idsCL[Green]}Completed${idsCL[Default]}"
|
||||||
|
|
||||||
|
echo -en "${idsCL[LightYellow]}Setting folder permissions... ${idsCL[Default]}"
|
||||||
SET-PERMISSIONS ${MAIN_SITE}
|
SET-PERMISSIONS ${MAIN_SITE}
|
||||||
|
echo -e "${idsCL[Green]}Completed${idsCL[Default]}"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
@@ -972,9 +982,9 @@ NEWSITE(){
|
|||||||
set \$server \"${PROXYHOST}\";
|
set \$server \"${PROXYHOST}\";
|
||||||
set \$port ${PROXYPORT};
|
set \$port ${PROXYPORT};
|
||||||
|
|
||||||
listen 8080;" > /etc/nginx/sites-available/${MAIN_SITE}
|
listen 80;" > /etc/nginx/sites-available/${MAIN_SITE}
|
||||||
if [ "${CREATE_SSL}" = "yes" ]; then
|
if [ "${CREATE_SSL}" = "yes" ]; then
|
||||||
echo -e " listen 8443 ssl http2;" >> /etc/nginx/sites-available/${MAIN_SITE}
|
echo -e " listen 443 ssl http2;" >> /etc/nginx/sites-available/${MAIN_SITE}
|
||||||
fi
|
fi
|
||||||
echo -e "
|
echo -e "
|
||||||
server_name ${NGINX_SERVERNAME};" >> /etc/nginx/sites-available/${MAIN_SITE}
|
server_name ${NGINX_SERVERNAME};" >> /etc/nginx/sites-available/${MAIN_SITE}
|
||||||
|
|||||||
23
templates/nginx.site
Executable file
23
templates/nginx.site
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
server {
|
||||||
|
listen 80 proxy_protocol;
|
||||||
|
|
||||||
|
server_name www.schroedercity.com;
|
||||||
|
set $base /var/www/SchroederCity;
|
||||||
|
root $base/public_html;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/www.schroedercity.com-access.log;
|
||||||
|
error_log /var/log/nginx/www.schroedercity.com-error.log warn;
|
||||||
|
|
||||||
|
index index.php;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
|
||||||
|
include conf.d/include/php_fastcgi.conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
include conf.d/include/general.conf;
|
||||||
|
}
|
||||||
30
templates/nginx.ssl.site
Executable file
30
templates/nginx.ssl.site
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
server {
|
||||||
|
listen 80 proxy_protocol;
|
||||||
|
listen 443 ssl http2 proxy_protocol;
|
||||||
|
|
||||||
|
server_name www.schroedercity.com;
|
||||||
|
set $base /var/www/SchroederCity;
|
||||||
|
root $base/public_html;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/www.schroedercity.com-access.log;
|
||||||
|
error_log /var/log/nginx/www.schroedercity.com-error.log warn;
|
||||||
|
|
||||||
|
ssl_certificate /etc/letsencrypt/live/www.schroedercity.com/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/www.schroedercity.com/privkey.pem;
|
||||||
|
include conf.d/include/ssl-ciphers.conf;
|
||||||
|
|
||||||
|
index index.php;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
include conf.d/include/force-ssl.conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
|
||||||
|
include conf.d/include/php_fastcgi.conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
include conf.d/include/general.conf;
|
||||||
|
include conf.d/include/letsencrypt-acme-challenge.conf;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user