Use packaged uwsgi on Fedora and Ubuntu
Building uwsgi from source was a workaround that was introduced a long time ago, it doesn't seem like it is needed anymore and will actually fail for Ubuntu 20.04. Also it doesn't match what will happen for most real-world installations, so let's try to get back to using distro packages. We'll still use the source install for RHEL/Centos, it remains to be tested whether we can get back to using distro versions there, too. Change-Id: I82f539bfa533349293dd5a8ce309c9cc0ffb0393
This commit is contained in:
parent
84737ebd96
commit
2d903568ed
40
lib/apache
40
lib/apache
@ -82,13 +82,37 @@ function install_apache_uwsgi {
|
|||||||
apxs="apxs"
|
apxs="apxs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ubuntu xenial is back level on uwsgi so the proxy doesn't
|
# This varies based on packaged/installed. If we've
|
||||||
# actually work. Hence we have to build from source for now.
|
# pip_installed, then the pip setup will only build a "python"
|
||||||
|
# module that will be either python2 or python3 depending on what
|
||||||
|
# it was built with.
|
||||||
#
|
#
|
||||||
# Centos 7 actually has the module in epel, but there was a big
|
# For package installs, the distro ships both plugins and you need
|
||||||
# push to disable epel by default. As such, compile from source
|
# to select the right one ... it will not be autodetected.
|
||||||
# there as well.
|
if python3_enabled; then
|
||||||
|
UWSGI_PYTHON_PLUGIN=python3
|
||||||
|
else
|
||||||
|
UWSGI_PYTHON_PLUGIN=python
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_ubuntu; then
|
||||||
|
install_package uwsgi \
|
||||||
|
uwsgi-plugin-python \
|
||||||
|
uwsgi-plugin-python3 \
|
||||||
|
libapache2-mod-proxy-uwsgi
|
||||||
|
elif [[ $os_VENDOR == "Fedora" ]]; then
|
||||||
|
# Note httpd comes with mod_proxy_uwsgi and it is loaded by
|
||||||
|
# default; the mod_proxy_uwsgi package actually conflicts now.
|
||||||
|
# See:
|
||||||
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1574335
|
||||||
|
#
|
||||||
|
# Thus there is nothing else to do after this install
|
||||||
|
install_package uwsgi \
|
||||||
|
uwsgi-plugin-python3
|
||||||
|
else
|
||||||
|
# Centos actually has the module in epel, but there was a big
|
||||||
|
# push to disable epel by default. As such, compile from source
|
||||||
|
# there.
|
||||||
local dir
|
local dir
|
||||||
dir=$(mktemp -d)
|
dir=$(mktemp -d)
|
||||||
pushd $dir
|
pushd $dir
|
||||||
@ -102,6 +126,8 @@ function install_apache_uwsgi {
|
|||||||
popd
|
popd
|
||||||
# delete the temp directory
|
# delete the temp directory
|
||||||
sudo rm -rf $dir
|
sudo rm -rf $dir
|
||||||
|
UWSGI_PYTHON_PLUGIN=python
|
||||||
|
fi
|
||||||
|
|
||||||
if is_ubuntu || is_suse ; then
|
if is_ubuntu || is_suse ; then
|
||||||
# we've got to enable proxy and proxy_uwsgi for this to work
|
# we've got to enable proxy and proxy_uwsgi for this to work
|
||||||
@ -265,7 +291,7 @@ function write_uwsgi_config {
|
|||||||
# configured after graceful shutdown
|
# configured after graceful shutdown
|
||||||
iniset "$file" uwsgi worker-reload-mercy $WORKER_TIMEOUT
|
iniset "$file" uwsgi worker-reload-mercy $WORKER_TIMEOUT
|
||||||
iniset "$file" uwsgi enable-threads true
|
iniset "$file" uwsgi enable-threads true
|
||||||
iniset "$file" uwsgi plugins python
|
iniset "$file" uwsgi plugins http,${UWSGI_PYTHON_PLUGIN}
|
||||||
# uwsgi recommends this to prevent thundering herd on accept.
|
# uwsgi recommends this to prevent thundering herd on accept.
|
||||||
iniset "$file" uwsgi thunder-lock true
|
iniset "$file" uwsgi thunder-lock true
|
||||||
# Set hook to trigger graceful shutdown on SIGTERM
|
# Set hook to trigger graceful shutdown on SIGTERM
|
||||||
@ -318,7 +344,7 @@ function write_local_uwsgi_http_config {
|
|||||||
iniset "$file" uwsgi die-on-term true
|
iniset "$file" uwsgi die-on-term true
|
||||||
iniset "$file" uwsgi exit-on-reload false
|
iniset "$file" uwsgi exit-on-reload false
|
||||||
iniset "$file" uwsgi enable-threads true
|
iniset "$file" uwsgi enable-threads true
|
||||||
iniset "$file" uwsgi plugins python
|
iniset "$file" uwsgi plugins http,${UWSGI_PYTHON_PLUGIN}
|
||||||
# uwsgi recommends this to prevent thundering herd on accept.
|
# uwsgi recommends this to prevent thundering herd on accept.
|
||||||
iniset "$file" uwsgi thunder-lock true
|
iniset "$file" uwsgi thunder-lock true
|
||||||
# Set hook to trigger graceful shutdown on SIGTERM
|
# Set hook to trigger graceful shutdown on SIGTERM
|
||||||
|
Loading…
x
Reference in New Issue
Block a user