update upstream template
* cleanup stack.py * replace nginx-ee by nginx-wo in install script
This commit is contained in:
22
install
22
install
@@ -415,21 +415,21 @@ wo_update_latest()
|
|||||||
wo_lib_echo "Updating Nginx configuration, please wait..."
|
wo_lib_echo "Updating Nginx configuration, please wait..."
|
||||||
|
|
||||||
elif [ "$wo_distro_version" == "trusty" ]; then
|
elif [ "$wo_distro_version" == "trusty" ]; then
|
||||||
grep -Hr 'http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_14.04/ /' /etc/apt/sources.list.d/ &>> /dev/null
|
grep -Hr 'http://download.opensuse.org/repositories/home:/virtubox:/WordOps/xUbuntu_14.04/ /' /etc/apt/sources.list.d/ &>> /dev/null
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
if [ -f /etc/apt/sources.list.d/rtcamp-nginx-trusty.list ]; then
|
if [ -f /etc/apt/sources.list.d/rtcamp-nginx-trusty.list ]; then
|
||||||
rm -rf /etc/apt/sources.list.d/rtcamp-nginx-trusty.list
|
rm -rf /etc/apt/sources.list.d/rtcamp-nginx-trusty.list
|
||||||
fi
|
fi
|
||||||
echo -e "\ndeb http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_14.04/ /" >> /etc/apt/sources.list.d/wo-repo.list
|
echo -e "\ndeb http://download.opensuse.org/repositories/home:/virtubox:/WordOps/xUbuntu_14.04/ /" >> /etc/apt/sources.list.d/wo-repo.list
|
||||||
gpg --keyserver "hkp://pgp.mit.edu" --recv-keys '3050AC3CD2AE6F03'
|
gpg --keyserver "hkp://pgp.mit.edu" --recv-keys '188C9FB063F0247A'
|
||||||
gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add -
|
gpg -a --export --armor '188C9FB063F0247A' | apt-key add -
|
||||||
if [ -f /etc/nginx/conf.d/ee-nginx.conf ]; then
|
if [ -f /etc/nginx/conf.d/ee-nginx.conf ]; then
|
||||||
mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/wo-nginx.conf.old &>> /dev/null
|
mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/wo-nginx.conf.old &>> /dev/null
|
||||||
fi
|
fi
|
||||||
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old &>> /dev/null
|
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old &>> /dev/null
|
||||||
apt-get update
|
apt-get update
|
||||||
service nginx stop &>> /dev/null
|
service nginx stop &>> /dev/null
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom nginx-ee
|
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom nginx-wo
|
||||||
service nginx restart &>> /dev/null
|
service nginx restart &>> /dev/null
|
||||||
fi
|
fi
|
||||||
CHECK_NGINX_COMMON=$(dpkg --get-selections | grep -v deinstall | grep nginx-common)
|
CHECK_NGINX_COMMON=$(dpkg --get-selections | grep -v deinstall | grep nginx-common)
|
||||||
@@ -440,16 +440,16 @@ wo_update_latest()
|
|||||||
apt-get remove -y nginx-mainline
|
apt-get remove -y nginx-mainline
|
||||||
fi
|
fi
|
||||||
service nginx stop &>> /dev/null
|
service nginx stop &>> /dev/null
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y --allow-unauthenticated install nginx-ee nginx-custom
|
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y --allow-unauthenticated install nginx-wo nginx-custom
|
||||||
service nginx restart &>> /dev/null
|
service nginx restart &>> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ "$wo_linux_distro" == "Debian" ]; then
|
elif [ "$wo_linux_distro" == "Debian" ]; then
|
||||||
grep -Hr 'http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/Debian_8.0/ /' /etc/apt/sources.list.d/ &>> /dev/null
|
grep -Hr 'http://download.opensuse.org/repositories/home:/virtubox:/WordOps/Debian_8.0/ /' /etc/apt/sources.list.d/ &>> /dev/null
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo -e "deb http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/Debian_8.0/ /" >> /etc/apt/sources.list.d/wo-repo.list
|
echo -e "deb http://download.opensuse.org/repositories/home:/virtubox:/WordOps/Debian_8.0/ /" >> /etc/apt/sources.list.d/wo-repo.list
|
||||||
gpg --keyserver "hkp://pgp.mit.edu" --recv-keys '3050AC3CD2AE6F03'
|
gpg --keyserver "hkp://pgp.mit.edu" --recv-keys '188C9FB063F0247A'
|
||||||
gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add -
|
gpg -a --export --armor '188C9FB063F0247A' | apt-key add -
|
||||||
if [ -f /etc/nginx/conf.d/ee-nginx.conf ]; then
|
if [ -f /etc/nginx/conf.d/ee-nginx.conf ]; then
|
||||||
mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old &>> /dev/null
|
mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old &>> /dev/null
|
||||||
fi
|
fi
|
||||||
@@ -468,7 +468,7 @@ wo_update_latest()
|
|||||||
apt-get remove -y nginx-mainline
|
apt-get remove -y nginx-mainline
|
||||||
fi
|
fi
|
||||||
systemctl stop nginx &>> /dev/null
|
systemctl stop nginx &>> /dev/null
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y --allow-unauthenticated install nginx-ee nginx-custom
|
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y --allow-unauthenticated install nginx-wo nginx-custom
|
||||||
systemctl restart nginx &>> /dev/null
|
systemctl restart nginx &>> /dev/null
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -53,8 +53,6 @@ class WOStackController(CementBaseController):
|
|||||||
dict(help='Install admin tools stack', action='store_true')),
|
dict(help='Install admin tools stack', action='store_true')),
|
||||||
(['--nginx'],
|
(['--nginx'],
|
||||||
dict(help='Install Nginx stack', action='store_true')),
|
dict(help='Install Nginx stack', action='store_true')),
|
||||||
# (['--nginxmainline'],
|
|
||||||
# dict(help='Install Nginx mainline stack', action='store_true')),
|
|
||||||
(['--php'],
|
(['--php'],
|
||||||
dict(help='Install PHP 7.2 stack', action='store_true')),
|
dict(help='Install PHP 7.2 stack', action='store_true')),
|
||||||
(['--php73'],
|
(['--php73'],
|
||||||
@@ -181,11 +179,9 @@ class WOStackController(CementBaseController):
|
|||||||
WORepo.add_key(self, '89DF5277')
|
WORepo.add_key(self, '89DF5277')
|
||||||
|
|
||||||
if set(WOVariables.wo_hhvm).issubset(set(apt_packages)):
|
if set(WOVariables.wo_hhvm).issubset(set(apt_packages)):
|
||||||
if (WOVariables.wo_platform_codename != 'xenial' or WOVariables.wo_platform_codename != 'bionic'):
|
if (WOVariables.wo_platform_codename != 'xenial' or
|
||||||
|
WOVariables.wo_platform_codename != 'bionic'):
|
||||||
Log.info(self, "Adding repository for HHVM, please wait...")
|
Log.info(self, "Adding repository for HHVM, please wait...")
|
||||||
if WOVariables.wo_platform_codename == 'precise':
|
|
||||||
Log.debug(self, 'Adding PPA for Boost')
|
|
||||||
WORepo.add(self, ppa=WOVariables.wo_boost_repo)
|
|
||||||
Log.debug(self, 'Adding ppa repo for HHVM')
|
Log.debug(self, 'Adding ppa repo for HHVM')
|
||||||
WORepo.add(self, repo_url=WOVariables.wo_hhvm_repo)
|
WORepo.add(self, repo_url=WOVariables.wo_hhvm_repo)
|
||||||
Log.debug(self, 'Adding HHVM GPG Key')
|
Log.debug(self, 'Adding HHVM GPG Key')
|
||||||
@@ -282,8 +278,11 @@ class WOStackController(CementBaseController):
|
|||||||
self.app.render((data), 'fastcgi.mustache', out=wo_nginx)
|
self.app.render((data), 'fastcgi.mustache', out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
data = dict(php="9000", debug="9001", hhvm="8000", php73="9072", debug7="9172",
|
data = dict(php="9000", debug="9001", hhvm="8000",
|
||||||
hhvmconf=False, php7conf=True if WOAptGet.is_installed(self, 'php7.3-fpm') else False)
|
php7="9070", debug7="9170",
|
||||||
|
hhvmconf=False, php7conf=True if
|
||||||
|
WOAptGet.is_installed(self, 'php7.0-fpm')
|
||||||
|
else False)
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
'file /etc/nginx/conf.d/upstream.conf')
|
'file /etc/nginx/conf.d/upstream.conf')
|
||||||
wo_nginx = open('/etc/nginx/conf.d/upstream.conf',
|
wo_nginx = open('/etc/nginx/conf.d/upstream.conf',
|
||||||
@@ -793,9 +792,15 @@ class WOStackController(CementBaseController):
|
|||||||
if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/conf.d/redis.conf")):
|
if os.path.isfile("/etc/nginx/nginx.conf") and (not os.path.isfile("/etc/nginx/conf.d/redis.conf")):
|
||||||
with open("/etc/nginx/conf.d/redis.conf", "a") as redis_file:
|
with open("/etc/nginx/conf.d/redis.conf", "a") as redis_file:
|
||||||
redis_file.write("# Log format Settings\n"
|
redis_file.write("# Log format Settings\n"
|
||||||
"log_format rt_cache_redis '$remote_addr $upstream_response_time $srcache_fetch_status [$time_local] '\n"
|
"log_format rt_cache_redis "
|
||||||
"'$http_host \"$request\" $status $body_bytes_sent '\n"
|
""'$remote_addr "
|
||||||
"'\"$http_referer\" \"$http_user_agent\"';\n")
|
"$upstream_response_time "
|
||||||
|
"$srcache_fetch_status [$time_local]"
|
||||||
|
" '\n" '$http_host"
|
||||||
|
" \"$request\" "
|
||||||
|
"$status $body_bytes_sent '\n"
|
||||||
|
"'\"$http_referer\" "
|
||||||
|
"\"$http_user_agent\"';\n")
|
||||||
|
|
||||||
if (WOVariables.wo_platform_distro == 'ubuntu'):
|
if (WOVariables.wo_platform_distro == 'ubuntu'):
|
||||||
# Create log directories
|
# Create log directories
|
||||||
@@ -819,7 +824,8 @@ class WOStackController(CementBaseController):
|
|||||||
config.write(configfile)
|
config.write(configfile)
|
||||||
|
|
||||||
# Parse /etc/php/7.2/fpm/php-fpm.conf
|
# Parse /etc/php/7.2/fpm/php-fpm.conf
|
||||||
data = dict(pid="/run/php/php7.2-fpm.pid", error_log="/var/log/php/7.2/fpm.log",
|
data = dict(pid="/run/php/php7.2-fpm.pid",
|
||||||
|
error_log="/var/log/php/7.2/fpm.log",
|
||||||
include="/etc/php/7.2/fpm/pool.d/*.conf")
|
include="/etc/php/7.2/fpm/pool.d/*.conf")
|
||||||
Log.debug(self, "writting php7.2 configuration into "
|
Log.debug(self, "writting php7.2 configuration into "
|
||||||
"/etc/php/7.2/fpm/php-fpm.conf")
|
"/etc/php/7.2/fpm/php-fpm.conf")
|
||||||
|
|||||||
@@ -1,50 +1,29 @@
|
|||||||
# Common upstream settings
|
# Common upstream settings
|
||||||
|
#-------------------------------
|
||||||
# PHP 5.6 upstream
|
# PHP 5.6
|
||||||
|
#-------------------------------
|
||||||
upstream php {
|
upstream php {
|
||||||
server 127.0.0.1:9000;
|
server 127.0.0.1:{{php}};
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream debug {
|
upstream debug {
|
||||||
# Debug Pool
|
server 127.0.0.1:{{debug}};
|
||||||
server 127.0.0.1:9001;
|
|
||||||
}
|
|
||||||
|
|
||||||
# PHP 7.0 upstream
|
|
||||||
upstream php7 {
|
|
||||||
server 127.0.0.1:9070;
|
|
||||||
}
|
|
||||||
|
|
||||||
# PHP 7.2 upstream with load-balancing on two unix sockets
|
|
||||||
upstream php72 {
|
|
||||||
server unix:/var/run/php/php72-fpm.sock;
|
|
||||||
}
|
|
||||||
|
|
||||||
# PHP 7.2 debug
|
|
||||||
upstream debug72 {
|
|
||||||
# Debug Pool
|
|
||||||
server 127.0.0.1:9172;
|
|
||||||
}
|
|
||||||
|
|
||||||
# PHP 7.3 upstream with load-balancing on two unix sockets
|
|
||||||
upstream php73 {
|
|
||||||
server unix:/var/run/php/php73-fpm.sock;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{{#php7conf}}
|
{{#php7conf}}
|
||||||
# PHP 7.3 debug
|
#-------------------------------
|
||||||
upstream debug73 {
|
# PHP 7.0
|
||||||
|
#-------------------------------
|
||||||
|
|
||||||
|
upstream php7 {
|
||||||
|
server 127.0.0.1:{{php7}};
|
||||||
|
}
|
||||||
|
upstream debug7 {
|
||||||
# Debug Pool
|
# Debug Pool
|
||||||
server 127.0.0.1:9173;
|
server 127.0.0.1:{{debug7}};
|
||||||
}
|
}
|
||||||
{{/php7conf}}
|
{{/php7conf}}
|
||||||
|
|
||||||
# Netdata Monitoring Upstream
|
|
||||||
upstream netdata {
|
|
||||||
server 127.0.0.1:19999;
|
|
||||||
keepalive 64;
|
|
||||||
}
|
|
||||||
|
|
||||||
{{#hhvmconf}}
|
{{#hhvmconf}}
|
||||||
upstream hhvm {
|
upstream hhvm {
|
||||||
# HHVM Pool
|
# HHVM Pool
|
||||||
@@ -52,3 +31,45 @@ server 127.0.0.1:{{hhvm}};
|
|||||||
server 127.0.0.1:{{php}} backup;
|
server 127.0.0.1:{{php}} backup;
|
||||||
}
|
}
|
||||||
{{/hhvmconf}}
|
{{/hhvmconf}}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------
|
||||||
|
# PHP 7.2
|
||||||
|
#-------------------------------
|
||||||
|
|
||||||
|
# PHP 7.2 upstream with load-balancing on two unix sockets
|
||||||
|
upstream php72 {
|
||||||
|
server unix:/var/run/php/php72-fpm.sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
# PHP 7.2 debug
|
||||||
|
upstream debug72 {
|
||||||
|
# Debug Pool
|
||||||
|
server 127.0.0.1:9172;
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------
|
||||||
|
# PHP 7.3
|
||||||
|
#-------------------------------
|
||||||
|
|
||||||
|
# PHP 7.3 upstream with load-balancing on two unix sockets
|
||||||
|
upstream php73 {
|
||||||
|
server unix:/var/run/php/php73-fpm.sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
# PHP 7.3 debug
|
||||||
|
upstream debug73 {
|
||||||
|
# Debug Pool
|
||||||
|
server 127.0.0.1:9173;
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------
|
||||||
|
# Netdata
|
||||||
|
#-------------------------------
|
||||||
|
|
||||||
|
# Netdata Monitoring Upstream
|
||||||
|
upstream netdata {
|
||||||
|
server 127.0.0.1:19999;
|
||||||
|
keepalive 64;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user