From eb0d4646d818fe12032379aae2fcd8b5bdb6467e Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 6 Apr 2020 17:59:06 +0200 Subject: docs: rework of chapter "Install with apache" BTW: normalize installation-nginx.rst --- utils/lib.sh | 12 +++++++++--- utils/searx.sh | 5 +++++ utils/templates/etc/apache2/sites-available/morty.conf | 4 ++-- .../templates/etc/apache2/sites-available/searx.conf:filtron | 4 ++-- 4 files changed, 18 insertions(+), 7 deletions(-) (limited to 'utils') diff --git a/utils/lib.sh b/utils/lib.sh index 9d5068646..aaeb5093b 100755 --- a/utils/lib.sh +++ b/utils/lib.sh @@ -634,9 +634,15 @@ if [[ -z "${APACHE_SITES_AVAILABE}" ]]; then fi apache_is_installed() { - (command -v apachectl \ - && command -v a2ensite \ - && command -v a2dissite ) &>/dev/null + case $DIST_ID-$DIST_VERS in + ubuntu-*|debian-*) + (command -v apachectl \ + && command -v a2ensite \ + && command -v a2dissite ) &>/dev/null + ;; + arch) (command -v httpd) ;; + fedora) (command -v httpd) ;; + esac } apache_reload() { diff --git a/utils/searx.sh b/utils/searx.sh index a74aec393..86b651696 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -735,6 +735,11 @@ This installs the searx uwsgi app as apache site. If your server is public to the internet, you should instead use a reverse proxy (filtron) to block excessively bot queries." + case $DIST_ID-$DIST_VERS in + ubuntu-*|debian-*) : ;; + *) err_msg "sorry distro $DIST_ID $DIST_VERS not yet supported"; exit 42 ;; + esac + ! apache_is_installed && err_msg "Apache is not installed." if ! ask_yn "Do you really want to install apache site for searx-uwsgi?"; then diff --git a/utils/templates/etc/apache2/sites-available/morty.conf b/utils/templates/etc/apache2/sites-available/morty.conf index 48b4dd766..4421cdd51 100644 --- a/utils/templates/etc/apache2/sites-available/morty.conf +++ b/utils/templates/etc/apache2/sites-available/morty.conf @@ -18,8 +18,8 @@ ProxyPreserveHost On ProxyPass http://${MORTY_LISTEN} RequestHeader set X-Script-Name ${PUBLIC_URL_PATH_MORTY} - # In Apache it seems, that setting HTTP_HOST header direct here does have no - # effect. I needed to set 'ProxyPreserveHost On' (see above). + # In Apache it seems, that setting HTTP_HOST header directive here does have + # no effect. I needed to set 'ProxyPreserveHost On' (see above). # RequestHeader set Host ${PUBLIC_HOST} diff --git a/utils/templates/etc/apache2/sites-available/searx.conf:filtron b/utils/templates/etc/apache2/sites-available/searx.conf:filtron index e34049063..2d6af7889 100644 --- a/utils/templates/etc/apache2/sites-available/searx.conf:filtron +++ b/utils/templates/etc/apache2/sites-available/searx.conf:filtron @@ -23,8 +23,8 @@ ProxyPreserveHost On ProxyPass http://${FILTRON_LISTEN} RequestHeader set X-Script-Name ${FILTRON_URL_PATH} - # In Apache it seems, that setting HTTP_HOST header direct here does have no - # effect. I needed to set 'ProxyPreserveHost On' (see above). HTTP_HOST + # In Apache it seems, that setting HTTP_HOST header directive here does have + # no effect. I needed to set 'ProxyPreserveHost On' (see above). HTTP_HOST # (ProxyPreserveHost On) is needed by searx to render correct *Search URL* # in the *Link* box and *saved preference*. -- cgit v1.2.3