Raspberry Pi SOGo Groupware: Difference between revisions
| Line 155: | Line 155: | ||
Error: sogo.service: PID file /var/run/sogo/sogo.pid not readable (yet?) after start: No such file or directory | Error: sogo.service: PID file /var/run/sogo/sogo.pid not readable (yet?) after start: 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. | ||
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'). | |||
More info: | |||
* https://www.freedesktop.org/software/systemd/man/systemd.service.html | |||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
| Line 176: | Line 181: | ||
PermissionsStartOnly=true | PermissionsStartOnly=true | ||
# exec with prefix - to ignore errors | # exec with prefix - to ignore errors | ||
ExecStartPre=- | ExecStartPre=-/bin/mkdir /var/run/sogo | ||
ExecStartPre= | 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/sbin/sogod -WOWorkersCount ${PREFORK} -WOPidFile /var/run/sogo/sogo.pid -WOLogFile /var/log/so$ | ||
| Line 186: | Line 191: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote> | </blockquote> | ||
Restart the service: | |||
<syntaxhighlight lang=bash> | |||
sudo systemctl daemon-reload | |||
sudo systemctl restart sogo | |||
sudo systemctl status sogo | |||
</syntaxhighlight> | |||
== Logging == | == Logging == | ||
Revision as of 14:14, 30 December 2017
Start
There are no binaries available for the ARM architecture as are needed for the Raspberry Pi. The code is not maintained for this purpose but it is possible. Therefore we need to compile, build and install the application manually.
Source with some pointers:
Assumptions:
- Apache2 (2.4+) is installed
- MariaDB (MySQL) is installed
- There is no information here concerning the creation of the sogo database tables
Compile, build and install
Download source-code
Get and extract source-code of SOPE and SOGo (the version used here is 3.2.10):
cd ~ wget https://sogo.nu/files/downloads/SOGo/Sources/SOPE-3.2.10.tar.gz tar -xvzf SOPE-3.2.10.tar.gz wget https://sogo.nu/files/downloads/SOGo/Sources/SOGo-3.2.10.tar.gz tar -xvzf SOGo-3.2.10.tar.gz mv SOGo-3.2.10 SOGo
Install needed packages for SOPE
# the GNU Objective-C compiler (gcc-objc) sudo apt-get install gnustep-make #20Mb sudo apt-get install gnustep-core-devel #34Mb # the libxml2 development headers (74Mb) sudo apt-get install libxml2-dev sudo apt-get install libwbxml2-dev # the OpenLDAP development headers (2mb) sudo apt-get install libldap2-dev # the OpenSSL development headers (10Mb) sudo apt-get install libssl-dev # the PostgreSQL development headers (1Mb) sudo apt-get install libpq-dev # the MySql (MariaDB) development headers (6Mb) # sudo apt-cache search mysql | grep "dev" sudo apt-get install libmariadbclient-dev-compat
Compile and install SOPE
cd ~/SOPE ./configure --with-gnustep --enable-debug --disable-strip --prefix=/usr/System sudo make uninstall make clean make sudo make install
Install additional needed packages for SOGo
# the libmemcached development headers (2Mb) sudo apt-get install libmemcached-dev # the libcurl development headers (1Mb) sudo apt-get install libcurl4-openssl-dev
Compile and install SOGo
cd ~/SOGo ./configure --enable-debug --disable-strip --prefix=/usr/System 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 /usr/lib/GNUstep/SOGo sudo chown -R sogo:sogo /etc/sogo
Install Service
For installation of the service we use 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
Other configuration
See:
- For website configuration file: Apache2 configuration for SOGo and MediaWiki
- For database and sogo.conf settings: SOGo
And maybe also:
Start the Service
sudo service sogo restart
Trouble shooting
Missing /var/run/sogo/sogo.pid
Error: sogo.service: PID file /var/run/sogo/sogo.pid not readable (yet?) after start: 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').
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=3"
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/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
Logging
SOGo service status:
service sogo status
Apache service status:
service apache2 status
sudo ls -l /etc/sogo
SOGo log:
tail -20 /var/log/sogo/sogo.log
ls -l /var/log/apache2
sudo tail -20 /var/log/apache2/error.log | grep SOGo
sudo tail -20 /var/log/apache2/access.log | grep SOGo
sudo tail -20 /var/log/apache2/other_vhosts_access.log | grep SOGo
/etc/sogo/sogo.conf
This file need 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
Apache2
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
<blockqoute>
... LogLevel debug ...
</blockqoute>
sudo service apache2 restart
More info: