From a4cdddcce17e4fd689a06aac6b09ba83cb78ee61 Mon Sep 17 00:00:00 2001 From: Tophe Date: Sat, 27 Feb 2021 16:53:18 +0100 Subject: [PATCH] added options to use apache2 server shipped with SOGo --- script/apache.sh | 18 ++++++++++++++++++ script/start.sh | 6 ++++++ 2 files changed, 24 insertions(+) create mode 100755 script/apache.sh diff --git a/script/apache.sh b/script/apache.sh new file mode 100755 index 0000000..86ccfce --- /dev/null +++ b/script/apache.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +source /usr/local/bin/common.sh + +SERVER_NAME=${APACHE_SERVER_NAME:-localhost} + +configure_apache() { + log_info "Enabling Apache Server .." + + mkdir /var/log/apache2/ + echo "ServerName ${SERVER_NAME}" + echo "ServerName ${SERVER_NAME}" > /etc/apache2/conf-available/servername.conf + a2enmod proxy_http + a2enconf servername + service apache2 restart + + log_info "... done" +} diff --git a/script/start.sh b/script/start.sh index e8b279e..4e9b837 100755 --- a/script/start.sh +++ b/script/start.sh @@ -17,5 +17,11 @@ if [[ -n ${MYSQL_SERVER//[[:blank:]]/} ]]; then init_db fi +if [[ ${APACHE_ENABLED,,} = true ]]; then + source /usr/local/bin/apache.sh + configure_apache +fi + log_info "Launching SOGo" su -l sogo -s /bin/bash -c "/usr/sbin/sogod -WOWorkersCount ${WORKERS_COUNT} -WONoDetach YES -WOPort 20000 -WOLogFile - -WOPidFile /tmp/sogo.pid" +