Raspberry Pi SOGo Groupware: Difference between revisions
m SOGo 5.1 |
|||
| Line 5: | Line 5: | ||
= Start = | = Start = | ||
SOGo is a groupware server that allows you to share agenda and contacts with others within your own private network. There | SOGo is a groupware server that allows you to share agenda and contacts with others within your own private network. There are good alternatives, however, SOGo proved to be relatively easy to setup, I like it and am using it for some time now. | ||
SOGo nightly builds are freely available for the public but there are no binaries or configurations available for the ARM architecture as are needed for the Raspberry Pi. Therefore we need to compile, build and install the application manually and then solve some problems. | SOGo nightly builds are freely available for the public but there are no binaries or configurations available for the ARM architecture as are needed for the Raspberry Pi. Therefore we need to compile, build and install the application manually and then solve some problems. | ||
= Changes SOGo 3.x, 4.x -> 5.x = | |||
Changes have been incoorperated in the instruction and are not explicitly included here. | |||
= | * We can no longer use '--prefix=/usr/System' as in: | ||
./configure --with-gnustep --enable-debug --disable-strip --prefix=/usr/System | |||
As a result many directory locations will have changed. For example the location of the service will be: | |||
/usr/local/sbin/sogod | |||
In stead of: | |||
/usr/sbin/sogod | |||
Libraries will be in: | |||
/usr/local/lib/sogo/* | |||
In stead of: | |||
/usr/lib/sogo/* | |||
* The database from version 3.x to 4.x has some changes. See troubleshooting. | |||
= Preperation = | |||
== Install MariaDB database == | |||
<source lang=bash> | |||
sudo apt install mariadb-server -y | |||
sudo systemctl start mariadb | |||
sudo systemctl enable mariadb | |||
systemctl status mariadb | |||
</source> | |||
<source lang=bash> | |||
sudo mysql_secure_installation | |||
</source> | |||
You already have a root password set, so you can safely answer 'n'. | |||
Change the root password? [Y/n] n | |||
Remove anonymous users? [Y/n] Y | |||
Disallow root login remotely? [Y/n] Y | |||
Remove test database and access to it? [Y/n] Y | |||
Reload privilege tables now? [Y/n] Y | |||
== Install Nginx webserver == | |||
sudo apt install nginx -y | |||
sudo systemctl start nginx | |||
sudo systemctl enable nginx | |||
systemctl status nginx | |||
= SOGo download, compile, build and install = | |||
== Download source-code == | == Download source-code == | ||
Get and extract source-code of SOPE and SOGo (the version used here is | Get and extract source-code of SOPE and SOGo (the version used here is 5.1.0): | ||
< | <source lang=bash> | ||
cd ~ | cd ~ | ||
wget https://sogo.nu/files/downloads/SOGo/Sources/SOPE- | wget https://sogo.nu/files/downloads/SOGo/Sources/SOPE-5.1.0.tar.gz | ||
tar -xvzf SOPE- | tar -xvzf SOPE-*.tar.gz | ||
wget https://sogo.nu/files/downloads/SOGo/Sources/SOGo- | wget https://sogo.nu/files/downloads/SOGo/Sources/SOGo-5.1.0.tar.gz | ||
tar -xvzf SOGo- | tar -xvzf SOGo-*.tar.gz | ||
mv SOGo- | mv SOGo-* SOGo | ||
</ | </source> | ||
== Install needed packages | == SOPE: Install needed packages == | ||
< | <source lang=bash> | ||
# the GNU Objective-C compiler (gcc-objc) | # the GNU Objective-C compiler (gcc-objc) | ||
sudo apt-get install gnustep-make | sudo apt-get install gnustep-make | ||
sudo apt-get install gnustep-core-devel | sudo apt-get install gnustep-core-devel | ||
# the libxml2 development headers | # the libxml2 development headers | ||
sudo apt-get install libxml2-dev | sudo apt-get install libxml2-dev | ||
sudo apt-get install libwbxml2-dev | sudo apt-get install libwbxml2-dev | ||
# the OpenLDAP development headers | # the OpenLDAP development headers | ||
sudo apt-get install libldap2-dev | sudo apt-get install libldap2-dev | ||
# the OpenSSL development headers | # the OpenSSL development headers | ||
sudo apt-get install libssl-dev | sudo apt-get install libssl-dev | ||
# the PostgreSQL development headers | # the PostgreSQL development headers | ||
sudo apt-get install libpq-dev | sudo apt-get install libpq-dev | ||
# the MySql (MariaDB) development headers | # the MySql (MariaDB) development headers | ||
# sudo apt-cache search mysql | grep "dev" | # sudo apt-cache search mysql | grep "dev" | ||
sudo apt-get install libmariadbclient-dev-compat | sudo apt-get install libmariadbclient-dev-compat | ||
</ | </source> | ||
== Compile and install | == SOPE: Compile and install == | ||
Compiling (make) will take | Compiling (make) will take up to an hour, depending on the hardware and will show some warnings which we can hopefully ignore. | ||
< | <source lang=bash> | ||
cd ~/SOPE | cd ~/SOPE | ||
./configure --with-gnustep --enable-debug --disable-strip | ./configure --with-gnustep --enable-debug --disable-strip | ||
sudo make uninstall | sudo make uninstall | ||
| Line 64: | Line 106: | ||
make | make | ||
sudo make install | sudo make install | ||
</ | </source> | ||
== Install additional needed packages | == SOGo: Install additional needed packages == | ||
< | <source lang=bash> | ||
# the libmemcached development headers | # the libmemcached development headers | ||
sudo apt-get install libmemcached-dev | sudo apt-get install libmemcached-dev | ||
# the libcurl development headers | # the libcurl development headers | ||
sudo apt-get install libcurl4-openssl-dev | sudo apt-get install libcurl4-openssl-dev | ||
# libsodium (encryption) development headers | # libsodium (encryption) development headers (added for SOGo 5.1) | ||
sudo apt-get install libsodium-dev | sudo apt-get install libsodium-dev | ||
# libzip development headers | # libzip development headers (added for SOGo 5.1) | ||
sudo apt-get install libzip-dev | sudo apt-get install libzip-dev | ||
</ | </source> | ||
== Compile and install | == SOGo: Compile and install == | ||
< | Compiling (make) will take up to 30 minutes, depending on the hardware and will show quite some warnings which we can hopefully ignore. | ||
<source lang=bash> | |||
cd ~/SOGo | cd ~/SOGo | ||
./configure --enable-debug --disable-strip | ./configure --enable-debug --disable-strip | ||
| Line 89: | Line 133: | ||
make | make | ||
sudo make install | sudo make install | ||
</ | </source> | ||
= Post installation = | = Post installation = | ||
| Line 97: | Line 141: | ||
== Create user and group 'sogo' == | == Create user and group 'sogo' == | ||
< | <source lang=bash> | ||
#Create group | #Create group | ||
sudo addgroup sogo | sudo addgroup sogo | ||
| Line 104: | Line 148: | ||
#Add existing user 'sogo' to group 'sogo' | #Add existing user 'sogo' to group 'sogo' | ||
sudo adduser sogo sogo | sudo adduser sogo sogo | ||
</ | </source> | ||
== Copy some files to the right places == | == Copy some files to the right places == | ||
< | <source lang=bash> | ||
cd ~/SOGo | cd ~/SOGo | ||
sudo install -D -m 644 Scripts/sogo-default /etc/default/sogo | sudo install -D -m 644 Scripts/sogo-default /etc/default/sogo | ||
| Line 117: | Line 161: | ||
sudo install -d -m 750 /etc/sogo/ | sudo install -d -m 750 /etc/sogo/ | ||
sudo install -D -m 640 Scripts/sogo.conf /etc/sogo/sogo.conf | sudo install -D -m 640 Scripts/sogo.conf /etc/sogo/sogo.conf | ||
</ | </source> | ||
== Apply owner and group information == | == Apply owner and group information == | ||
< | <source lang=bash> | ||
sudo mkdir /var/log/sogo | sudo mkdir /var/log/sogo | ||
sudo mkdir /var/run/sogo | sudo mkdir /var/run/sogo | ||
sudo chown -R sogo:sogo /var/run/sogo | sudo chown -R sogo:sogo /var/run/sogo | ||
sudo chown -R sogo:sogo /var/log/sogo | sudo chown -R sogo:sogo /var/log/sogo | ||
sudo chown -R sogo:sogo /etc/sogo | sudo chown -R sogo:sogo /etc/sogo | ||
</ | sudo chown -R sogo:sogo /usr/local/lib/GNUstep/SOGo | ||
</source> | |||
== | == Provide the new location of the shared libraries == | ||
Create this file with one line of text: | |||
< | <source lang=bash> | ||
sudo nano /etc/ld.so.conf.d/sogo.conf | |||
<source> | |||
/usr/local/lib/sogo | |||
Reload the configuration: | |||
<source lang=bash> | |||
sudo ldconfig | |||
</source> | |||
== SOGo database and sogo.conf settings == | |||
Go here: [[SOGo]] | |||
== Import sogo mariaDb database== | |||
<source lang=bash> | |||
sudo mysql -u root -p | |||
sql> source /home/pi/sogo.sql | |||
</source> | |||
See: https://wjv.duckdns.org/mediawiki/index.php/MySQL#Restore_one_database | |||
== Install and start the service == | |||
For installation of the service we use and modify the file './SOGo/Scripts/sogo-systemd-redhat': | |||
<source lang=bash> | |||
cd ~/SOGo | cd ~/SOGo | ||
sudo install -D -m 644 Scripts/sogo-systemd-redhat /lib/systemd/system/sogo.service | sudo install -D -m 644 Scripts/sogo-systemd-redhat /lib/systemd/system/sogo.service | ||
sudo systemctl daemon-reload | sudo systemctl daemon-reload | ||
sudo systemctl enable sogo | sudo systemctl enable sogo | ||
</ | </source> | ||
<source lang=bash> | |||
sudo service sogo restart | |||
</source> | |||
= Configure Nginx webserver = | |||
See: http://wiki.sogo.nu/nginxSettings | |||
<source lang=bash> | |||
cd /etc/nginx/sites-available/ | |||
sudo nano sogo | |||
</source> | |||
<source lang=nginx> | |||
server | |||
{ | |||
listen 80 default; | |||
server_name 192.168.1.14; | |||
# redirect http to https | |||
rewrite ^ https://$server_name$request_uri? permanent; | |||
} | |||
server | |||
{ | |||
listen 443; | |||
server_name 192.168.1.14; | |||
root /usr/local/lib/GNUstep/SOGo/WebServerResources/; | |||
ssl on; | |||
ssl_certificate /etc/nginx/ssl/server.cer; | |||
ssl_certificate_key /etc/nginx/ssl/server.key; | |||
# requirement to create new calendars in Thunderbird | |||
proxy_http_version 1.1; | |||
# Message size limit | |||
client_max_body_size 50m; | |||
client_body_buffer_size 128k; | |||
location = / | |||
{ | |||
rewrite ^ https://$server_name/SOGo; | |||
allow all; | |||
} | |||
# For iOS 7 | |||
location = /principals/ | |||
{ | |||
rewrite ^ https://$server_name/SOGo/dav; | |||
allow all; | |||
} | |||
location ^~/SOGo | |||
{ | |||
proxy_pass http://127.0.0.1:20000; | |||
proxy_redirect http://127.0.0.1:20000 default; | |||
# forward user's IP address | |||
proxy_set_header X-Real-IP $remote_addr; | |||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |||
proxy_set_header Host $host; | |||
proxy_set_header x-webobjects-server-protocol HTTP/1.0; | |||
proxy_set_header x-webobjects-remote-host 127.0.0.1; | |||
proxy_set_header x-webobjects-server-name $server_name; | |||
proxy_set_header x-webobjects-server-url $scheme://$host; | |||
proxy_set_header x-webobjects-server-port $server_port; | |||
proxy_connect_timeout 90; | |||
proxy_send_timeout 90; | |||
proxy_read_timeout 90; | |||
proxy_buffer_size 4k; | |||
proxy_buffers 4 32k; | |||
proxy_busy_buffers_size 64k; | |||
proxy_temp_file_write_size 64k; | |||
break; | |||
} | |||
location /SOGo.woa/WebServerResources/ | |||
{ | |||
alias /usr/local/lib/GNUstep/SOGo/WebServerResources/; | |||
allow all; | |||
expires max; | |||
} | |||
location /SOGo/WebServerResources/ | |||
{ | |||
alias /usr/local/lib/GNUstep/SOGo/WebServerResources/; | |||
allow all; | |||
expires max; | |||
} | |||
location (^/SOGo/so/ControlPanel/Products/([^/]*)/Resources/(.*)$) | |||
{ | |||
alias /usr/local/lib/GNUstep/SOGo/$1.SOGo/Resources/$2; | |||
expires max; | |||
} | |||
location (^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$) | |||
{ | |||
alias /usr/local/lib/GNUstep/SOGo/$1.SOGo/Resources/$2; | |||
expires max; | |||
} | |||
} | |||
</source> | |||
Enable site: | |||
<source lang=bash> | |||
sudo ln -s /etc/nginx/sites-available/sogo /etc/nginx/sites-enabled/ | |||
</source> | |||
Test and start: | |||
< | <source lang=bash> | ||
sudo | sudo nginx -t | ||
</ | sudo systemctl restart nginx | ||
</source> | |||
= Troubleshooting = | = Troubleshooting = | ||
== | == Failed to acquire channel for URL: mysql://sogo == | ||
You need a sogo database and a sogo database user. | |||
== ExecutionFailed REASON:Unknown column c_hascertificate == | |||
You need to upgrade the database frm 3.x to 4.x. | |||
<source lang=bash> | |||
sudo /home/pi/SOGo/Scripts/sql-update-3.2.10_to_4.0.0-mysql.sh | |||
</source> | |||
Provide the sogo database user and password. | |||
== /var/run/sogo/sogo.pid No such file or directory == | |||
In my case the directory /var/run/sogo is an in-memory folder (tmpfs), it is gone after reboot resulting in the above error. This might be fixed in later editions, for now we will edit systemd sogo.service file to create the directory at startup of the sogo service. | In my case the directory /var/run/sogo is an in-memory folder (tmpfs), it is gone after reboot resulting in the above error. This might be fixed in later editions, for now we will edit systemd sogo.service file to create the directory at startup of the sogo service. | ||
| Line 172: | Line 352: | ||
* https://www.freedesktop.org/software/systemd/man/systemd.service.html | * https://www.freedesktop.org/software/systemd/man/systemd.service.html | ||
< | <source lang=bash> | ||
sudo nano /lib/systemd/system/sogo.service | sudo nano /lib/systemd/system/sogo.service | ||
</ | </source> | ||
<blockquote> | <blockquote> | ||
< | <source lang=bash highlight="9,11-15"> | ||
[Unit] | [Unit] | ||
Description=SOGo groupware server | Description=SOGo groupware server | ||
| Line 188: | Line 368: | ||
Environment="PREFORK=2" | Environment="PREFORK=2" | ||
EnvironmentFile=-/etc/sysconfig/sogo | EnvironmentFile=-/etc/sysconfig/sogo | ||
#Create /var/run/sogo, as root and ignore mkdir error | # Create /var/run/sogo, as root and ignore mkdir error | ||
PermissionsStartOnly=true | PermissionsStartOnly=true | ||
# exec with prefix - to ignore errors | # exec with prefix - to ignore errors | ||
| Line 194: | Line 374: | ||
ExecStartPre=/bin/chown -R sogo:sogo /var/run/sogo | ExecStartPre=/bin/chown -R sogo:sogo /var/run/sogo | ||
# Start sogo | # Start sogo | ||
ExecStart=/usr/sbin/sogod -WOWorkersCount ${PREFORK} -WOPidFile /var/run/sogo/sogo.pid -WOLogFile /var/log/so$ | ExecStart=/usr/local/sbin/sogod -WOWorkersCount ${PREFORK} -WOPidFile /var/run/sogo/sogo.pid -WOLogFile /var/log/so$ | ||
PIDFile=/var/run/sogo/sogo.pid | PIDFile=/var/run/sogo/sogo.pid | ||
[Install] | [Install] | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
</ | </source> | ||
</blockquote> | </blockquote> | ||
Restart the service: | Restart the service: | ||
< | <source lang=bash> | ||
sudo systemctl daemon-reload | sudo systemctl daemon-reload | ||
sudo systemctl restart sogo | sudo systemctl restart sogo | ||
sudo systemctl status sogo | sudo systemctl status sogo | ||
</ | </source> | ||
== /etc/sogo/sogo.conf == | |||
This file needs to be readable by user 'sogo', but not by others. If you edit this file as root you need to reapply owner and group: | |||
<source lang=bash> | |||
sudo chown -R sogo:sogo /etc/sogo | |||
</source> | |||
== Logging == | == Logging == | ||
| Line 214: | Line 402: | ||
SOGo service status: | SOGo service status: | ||
< | <source lang=bash> | ||
service sogo status | service sogo status | ||
</ | </source> | ||
Config files: | Config files: | ||
< | <source lang=bash> | ||
sudo ls -l /etc/sogo | sudo ls -l /etc/sogo | ||
</ | </source> | ||
SOGo log: | SOGo log: | ||
< | <source lang=bash> | ||
sudo tail -20 /var/log/sogo/sogo.log | sudo tail -20 /var/log/sogo/sogo.log | ||
</ | </source> | ||
= | = Apache2 modules (not updated) = | ||
Make sure you have enabled all necessary modules. | Make sure you have enabled all necessary modules. | ||
< | <source lang=bash> | ||
sudo a2enmod headers | sudo a2enmod headers | ||
sudo a2enmod proxy | sudo a2enmod proxy | ||
| Line 271: | Line 430: | ||
sudo a2enmod rewrite | sudo a2enmod rewrite | ||
sudo a2enmod ssl | sudo a2enmod ssl | ||
</ | </source> | ||
If there is some sort of problem with the web service it could pay off to temporary increase the log level. For example, with the Apache configuration file 'raspberrypi.conf': | If there is some sort of problem with the web service it could pay off to temporary increase the log level. For example, with the Apache configuration file 'raspberrypi.conf': | ||
< | <source lang=bash> | ||
sudo nano /etc/apache2/sites-available/raspberrypi.conf | sudo nano /etc/apache2/sites-available/raspberrypi.conf | ||
</ | </source> | ||
<blockquote> | <blockquote> | ||
< | <source lang=bash> | ||
... | ... | ||
LogLevel debug | LogLevel debug | ||
... | ... | ||
</ | </source> | ||
</blockquote> | </blockquote> | ||
< | <source lang=bash> | ||
sudo service apache2 restart | sudo service apache2 restart | ||
</ | </source> | ||
More info: | More info: | ||
* http://httpd.apache.org/docs/2.4/mod/core.html#loglevel | * http://httpd.apache.org/docs/2.4/mod/core.html#loglevel | ||
* [[Create_certificates_for_Apache2]] | |||
* [[Apache2 webserver]] | |||
* [[Apache2 configuration for SOGo and MediaWiki#Configuration_.28Raspberry_Pi.29|Apache2 configuration for SOGo and MediaWiki]] | |||
Note that locations have changed from /usr/ to usr/local/ | |||
Revision as of 16:55, 6 April 2021
Start
SOGo is a groupware server that allows you to share agenda and contacts with others within your own private network. There are good alternatives, however, SOGo proved to be relatively easy to setup, I like it and am using it for some time now.
SOGo nightly builds are freely available for the public but there are no binaries or configurations available for the ARM architecture as are needed for the Raspberry Pi. Therefore we need to compile, build and install the application manually and then solve some problems.
Changes SOGo 3.x, 4.x -> 5.x
Changes have been incoorperated in the instruction and are not explicitly included here.
- We can no longer use '--prefix=/usr/System' as in:
./configure --with-gnustep --enable-debug --disable-strip --prefix=/usr/System
As a result many directory locations will have changed. For example the location of the service will be: /usr/local/sbin/sogod
In stead of: /usr/sbin/sogod
Libraries will be in: /usr/local/lib/sogo/*
In stead of: /usr/lib/sogo/*
- The database from version 3.x to 4.x has some changes. See troubleshooting.
Preperation
Install MariaDB database
sudo apt install mariadb-server -y sudo systemctl start mariadb sudo systemctl enable mariadb systemctl status mariadb
sudo mysql_secure_installation
You already have a root password set, so you can safely answer 'n'. Change the root password? [Y/n] n Remove anonymous users? [Y/n] Y Disallow root login remotely? [Y/n] Y Remove test database and access to it? [Y/n] Y Reload privilege tables now? [Y/n] Y
Install Nginx webserver
sudo apt install nginx -y sudo systemctl start nginx sudo systemctl enable nginx systemctl status nginx
SOGo download, compile, build and install
Download source-code
Get and extract source-code of SOPE and SOGo (the version used here is 5.1.0):
cd ~ wget https://sogo.nu/files/downloads/SOGo/Sources/SOPE-5.1.0.tar.gz tar -xvzf SOPE-*.tar.gz wget https://sogo.nu/files/downloads/SOGo/Sources/SOGo-5.1.0.tar.gz tar -xvzf SOGo-*.tar.gz mv SOGo-* SOGo
SOPE: Install needed packages
# the GNU Objective-C compiler (gcc-objc) sudo apt-get install gnustep-make sudo apt-get install gnustep-core-devel # the libxml2 development headers sudo apt-get install libxml2-dev sudo apt-get install libwbxml2-dev # the OpenLDAP development headers sudo apt-get install libldap2-dev # the OpenSSL development headers sudo apt-get install libssl-dev # the PostgreSQL development headers sudo apt-get install libpq-dev # the MySql (MariaDB) development headers # sudo apt-cache search mysql | grep "dev" sudo apt-get install libmariadbclient-dev-compat
SOPE: Compile and install
Compiling (make) will take up to an hour, depending on the hardware and will show some warnings which we can hopefully ignore.
cd ~/SOPE ./configure --with-gnustep --enable-debug --disable-strip sudo make uninstall make clean make sudo make install
SOGo: Install additional needed packages
# the libmemcached development headers sudo apt-get install libmemcached-dev # the libcurl development headers sudo apt-get install libcurl4-openssl-dev # libsodium (encryption) development headers (added for SOGo 5.1) sudo apt-get install libsodium-dev # libzip development headers (added for SOGo 5.1) sudo apt-get install libzip-dev
SOGo: Compile and install
Compiling (make) will take up to 30 minutes, depending on the hardware and will show quite some warnings which we can hopefully ignore.
cd ~/SOGo ./configure --enable-debug --disable-strip sudo make uninstall make clean make sudo make install
Post installation
The install script silently fails to execute some tasks, probably because there are no specific instructions for the Raspbian OS and ARM architecture. The following statements are based on the install scripts and documentation:
Create user and group 'sogo'
#Create group sudo addgroup sogo #Add new user 'sogo' to group 'sogo' (error if user sogo exists) sudo useradd -g sogo sogo #Add existing user 'sogo' to group 'sogo' sudo adduser sogo sogo
Copy some files to the right places
cd ~/SOGo sudo install -D -m 644 Scripts/sogo-default /etc/default/sogo sudo install -D -m 644 packaging/debian/sogo.overrides /usr/share/lintian/overrides/sogo sudo install -D -m 644 Apache/SOGo.conf /etc/apache2/conf-available/SOGo.conf sudo install -D -m 644 Scripts/sogo.cron /etc/cron.d/sogo sudo install -D -m 644 Scripts/logrotate /etc/logrotate.d/sogo sudo install -d -m 750 /etc/sogo/ sudo install -D -m 640 Scripts/sogo.conf /etc/sogo/sogo.conf
Apply owner and group information
sudo mkdir /var/log/sogo sudo mkdir /var/run/sogo sudo chown -R sogo:sogo /var/run/sogo sudo chown -R sogo:sogo /var/log/sogo sudo chown -R sogo:sogo /etc/sogo sudo chown -R sogo:sogo /usr/local/lib/GNUstep/SOGo
Create this file with one line of text:
sudo nano /etc/ld.so.conf.d/sogo.conf <source> /usr/local/lib/sogo Reload the configuration: <source lang=bash> sudo ldconfig
SOGo database and sogo.conf settings
Go here: SOGo
Import sogo mariaDb database
sudo mysql -u root -p sql> source /home/pi/sogo.sql
See: https://wjv.duckdns.org/mediawiki/index.php/MySQL#Restore_one_database
Install and start the service
For installation of the service we use and modify the file './SOGo/Scripts/sogo-systemd-redhat':
cd ~/SOGo sudo install -D -m 644 Scripts/sogo-systemd-redhat /lib/systemd/system/sogo.service sudo systemctl daemon-reload sudo systemctl enable sogo
sudo service sogo restart
Configure Nginx webserver
See: http://wiki.sogo.nu/nginxSettings
cd /etc/nginx/sites-available/ sudo nano sogo
server
{
listen 80 default;
server_name 192.168.1.14;
# redirect http to https
rewrite ^ https://$server_name$request_uri? permanent;
}
server
{
listen 443;
server_name 192.168.1.14;
root /usr/local/lib/GNUstep/SOGo/WebServerResources/;
ssl on;
ssl_certificate /etc/nginx/ssl/server.cer;
ssl_certificate_key /etc/nginx/ssl/server.key;
# requirement to create new calendars in Thunderbird
proxy_http_version 1.1;
# Message size limit
client_max_body_size 50m;
client_body_buffer_size 128k;
location = /
{
rewrite ^ https://$server_name/SOGo;
allow all;
}
# For iOS 7
location = /principals/
{
rewrite ^ https://$server_name/SOGo/dav;
allow all;
}
location ^~/SOGo
{
proxy_pass http://127.0.0.1:20000;
proxy_redirect http://127.0.0.1:20000 default;
# forward user's IP address
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header x-webobjects-server-protocol HTTP/1.0;
proxy_set_header x-webobjects-remote-host 127.0.0.1;
proxy_set_header x-webobjects-server-name $server_name;
proxy_set_header x-webobjects-server-url $scheme://$host;
proxy_set_header x-webobjects-server-port $server_port;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
break;
}
location /SOGo.woa/WebServerResources/
{
alias /usr/local/lib/GNUstep/SOGo/WebServerResources/;
allow all;
expires max;
}
location /SOGo/WebServerResources/
{
alias /usr/local/lib/GNUstep/SOGo/WebServerResources/;
allow all;
expires max;
}
location (^/SOGo/so/ControlPanel/Products/([^/]*)/Resources/(.*)$)
{
alias /usr/local/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
expires max;
}
location (^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$)
{
alias /usr/local/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
expires max;
}
}
Enable site:
sudo ln -s /etc/nginx/sites-available/sogo /etc/nginx/sites-enabled/
Test and start:
sudo nginx -t sudo systemctl restart nginx
Troubleshooting
Failed to acquire channel for URL: mysql://sogo
You need a sogo database and a sogo database user.
ExecutionFailed REASON:Unknown column c_hascertificate
You need to upgrade the database frm 3.x to 4.x.
sudo /home/pi/SOGo/Scripts/sql-update-3.2.10_to_4.0.0-mysql.sh
Provide the sogo database user and password.
/var/run/sogo/sogo.pid No such file or directory
In my case the directory /var/run/sogo is an in-memory folder (tmpfs), it is gone after reboot resulting in the above error. This might be fixed in later editions, for now we will edit systemd sogo.service file to create the directory at startup of the sogo service.
In this script 'mkdir' is allowed to fail (directory exists), by prefixing it with '-'. The option 'PermissionsStartOnly=true' is added to execute the 'ExecStartPre' commands as root. The 'ExecStart' command will still be executed as the configured user ('sogo').
Note: we also lowered PREFORK from 3 to 2 here.
More info:
sudo nano /lib/systemd/system/sogo.service
[Unit]
Description=SOGo groupware server
After=network.target
After=mariadb.service
[Service]
Type=forking
User=sogo
Environment="PREFORK=2"
EnvironmentFile=-/etc/sysconfig/sogo
# Create /var/run/sogo, as root and ignore mkdir error
PermissionsStartOnly=true
# exec with prefix - to ignore errors
ExecStartPre=-/bin/mkdir /var/run/sogo
ExecStartPre=/bin/chown -R sogo:sogo /var/run/sogo
# Start sogo
ExecStart=/usr/local/sbin/sogod -WOWorkersCount ${PREFORK} -WOPidFile /var/run/sogo/sogo.pid -WOLogFile /var/log/so$
PIDFile=/var/run/sogo/sogo.pid
[Install]
WantedBy=multi-user.target
Restart the service:
sudo systemctl daemon-reload sudo systemctl restart sogo sudo systemctl status sogo
/etc/sogo/sogo.conf
This file needs to be readable by user 'sogo', but not by others. If you edit this file as root you need to reapply owner and group:
sudo chown -R sogo:sogo /etc/sogo
Logging
SOGo service status:
service sogo status
Config files:
sudo ls -l /etc/sogo
SOGo log:
sudo tail -20 /var/log/sogo/sogo.log
Apache2 modules (not updated)
Make sure you have enabled all necessary modules.
sudo a2enmod headers sudo a2enmod proxy sudo a2enmod proxy_http sudo a2enmod headers sudo a2enmod rewrite sudo a2enmod ssl
If there is some sort of problem with the web service it could pay off to temporary increase the log level. For example, with the Apache configuration file 'raspberrypi.conf':
sudo nano /etc/apache2/sites-available/raspberrypi.conf
... LogLevel debug ...
sudo service apache2 restart
More info:
- http://httpd.apache.org/docs/2.4/mod/core.html#loglevel
- Create_certificates_for_Apache2
- Apache2 webserver
- Apache2 configuration for SOGo and MediaWiki
Note that locations have changed from /usr/ to usr/local/