added options to use apache2 server shipped with SOGo

This commit is contained in:
Tophe 2021-02-27 16:53:18 +01:00
parent 68bdec479d
commit a4cdddcce1
2 changed files with 24 additions and 0 deletions

18
script/apache.sh Executable file
View file

@ -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"
}

View file

@ -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"