Benutzer für “loolwsd”:
useradd -U -M -d /dev/null -s /bin/false lool
Abhängigkeiten:
pacman -S --needed \
apr boost cairo ccache clucene cups curl expat gdb glew gperf graphite \
gtk3 harfbuzz hyphen icu lcms2 libabw libatomic_ops libcap libcap-ng \
libcdr libcmis libe-book libetonyek libexttextcat libixion libjpeg \
liblangtag libldap libmspub libmwaw libodfgen liborcus libpagemaker \
libpng librevenge libvisio libwpd libwpg libwps libxml2 lpsolve neon nss \
openssl poppler python redland serf unixodbc zlib translate-toolkit \
python-polib python2-polib
pacaur -S --needed poco
LibreOffice bauen und Vorbereitungen für loolwsd:
cd /opt; \
git clone -b "distro/collabora/cp-5.1" "https://github.com/LibreOffice/core.git" "LibreOfficeCore_co_git"; \
cd /opt/LibreOfficeCore_co_git; \
cat configure.ac | grep -E "AC_INIT\(\["
export LOIPATH="CollaboraOffice_5.1.10.10"; \
export LOOLDIR="lool_co"; \
export LOOLGITDIR="lool_co_git"; \
export LOBINDIR="collaboraoffice"; \
export LOOLUSER="lool"; \
mkdir /opt/${LOIPATH}
chown -R http:http /opt/LibreOfficeCore_co_git; \
rm -rf `echo ~http/.ccache`; \
mkdir `echo ~http/.ccache`; \
chown -R http:http `echo ~http/.ccache`; \
sudo -u http ccache --max-size 32G
sudo -u http ./autogen.sh --prefix=/opt/$LOIPATH \
--with-lang='de' \
--with-parallelism \
--with-help \
--with-myspell-dicts \
--with-alloc=system \
--without-java \
--without-system-dicts \
--disable-dconf \
--disable-odk \
--disable-firebird-sdbc \
--disable-postgresql-sdbc \
--enable-release-build=yes \
--enable-python=system \
--enable-hardlink-deliver \
--with-system-apr \
--with-system-boost=yes \
--with-system-cairo \
--with-system-clucene \
--with-system-curl \
--with-system-expat \
--with-system-graphite \
--with-system-harfbuzz \
--with-system-icu \
--with-system-jpeg \
--with-system-libabw \
--with-system-libcdr \
--with-system-libebook \
--with-system-libetonyek \
--with-system-liblangtag \
--with-system-libmspub \
--with-system-libmwaw \
--with-system-libodfgen \
--with-system-libpagemaker \
--with-system-librevenge \
--with-system-libvisio \
--with-system-libwpd \
--with-system-libwpg \
--with-system-libwps \
--with-system-lpsolve \
--with-system-libcmis \
--with-system-libexttextcat \
--with-system-lcms2 \
--with-system-libatomic_ops \
--with-system-libpng \
--with-system-libxml \
--with-system-neon \
--with-system-odbc \
--with-system-openldap \
--with-system-openssl \
--with-system-poppler \
--with-system-redland \
--with-system-serf \
--with-system-zlib
echo Start: `date` > time.txt; \
sudo -u http make; \
echo " Ende:" `date` >> time.txt; \
echo;echo; \
cat time.txt; \
echo; \
du -hs /opt/LibreOfficeCore_co_git; \
du -hs `echo ~http/.ccache`; \
echo; \
sudo -u http ccache -s; \
echo
Zeit für make + Download beim ersten Durchlauf von make:
(stark abhängig von der Maschine und der Internetanbindung)
Start: Mi 19. Okt 08:50:07 CEST 2016
Ende: Mi 19. Okt 10:13:54 CEST 2016
9,0G /opt/LibreOfficeCore_co_git
1,8G /srv/http/.ccache
cache directory /srv/http/.ccache
primary config /srv/http/.ccache/ccache.conf
secondary config (readonly) /etc/ccache.conf
cache hit (direct) 31
cache hit (preprocessed) 52
cache miss 10693
cache hit rate 0.77 %
called for link 626
called for preprocessing 259
compile failed 28
preprocessor error 58
bad compiler arguments 53
autoconf compile/link 535
unsupported compiler option 361
no input file 155
cleanups performed 0
files in cache 31153
cache size 1.8 GB
max cache size 32.0 GB
make install
LibreOffice On-Line WebSocket server
cd /opt; \
git clone "https://github.com/LibreOffice/online.git" ${LOOLGITDIR}; \
cd /opt/${LOOLGITDIR}/loolwsd; \
libtoolize; \
aclocal; \
automake --add-missing; \
autoreconf; \
autoheader
./configure \
--prefix=/opt/${LOOLDIR}/loolwsd \
--bindir=/opt/${LOOLDIR}/loolwsd \
--sysconfdir=/opt/${LOOLDIR}/loolwsd/etc \
--enable-silent-rules \
--with-lokit-path=/opt/${LOOLGITDIR}/loolwsd/bundled/include \
--with-lo-path=/opt/${LOIPATH}/lib/${LOBINDIR}
make;make install
Let’sEnCrypt einbinden:
rm -rf /etc/loolwsd; \
mkdir /etc/loolwsd; \
cp -L /etc/letsencrypt/live/DOMAIN/cert.pem /etc/loolwsd/cert.pem; \
cp -L /etc/letsencrypt/live/DOMAIN/chain.pem /etc/loolwsd/ca-chain.cert.pem; \
cp -L /etc/letsencrypt/live/DOMAIN/privkey.pem /etc/loolwsd/key.pem; \
rm -f /opt/${LOOLDIR}/loolwsd/etc/loolwsd/cert.pem; \
rm -f /opt/${LOOLDIR}/loolwsd/etc/loolwsd/ca-chain.cert.pem; \
rm -f /opt/${LOOLDIR}/loolwsd/etc/loolwsd/key.pem; \
cp -L /etc/letsencrypt/live/DOMAIN/cert.pem /opt/${LOOLDIR}/loolwsd/etc/loolwsd/cert.pem; \
cp -L /etc/letsencrypt/live/DOMAIN/chain.pem /opt/${LOOLDIR}/loolwsd/etc/loolwsd/ca-chain.cert.pem; \
cp -L /etc/letsencrypt/live/DOMAIN/privkey.pem /opt/${LOOLDIR}/loolwsd/etc/loolwsd/key.pem; \
chmod 644 /opt/${LOOLDIR}/loolwsd/etc/loolwsd/cert.pem; \
chmod 644 /opt/${LOOLDIR}/loolwsd/etc/loolwsd/ca-chain.cert.pem; \
chmod 644 /opt/${LOOLDIR}/loolwsd/etc/loolwsd/key.pem
Client-Teil (loleaflet):
cd /opt/${LOOLGITDIR}/loleaflet; \
export LOLCLIENT="loleaflet-"`grep "^VERSION=" Makefile | sed 's/VERSION=//'`; \
make dist; \
tar -xzf ${LOLCLIENT}.tar.gz -C /opt/${LOOLDIR}/; \
mv /opt/${LOOLDIR}/${LOLCLIENT} /opt/${LOOLDIR}/loleaflet; \
unset LOLCLIENT; \
ls -ahl /opt/${LOOLDIR}/loleaflet
Systemtemplate für jails erzeugen:
setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /opt/${LOOLDIR}/loolwsd/loolforkit; \
setcap cap_sys_admin=ep /opt/${LOOLDIR}/loolwsd/loolmount; \
mkdir -p /opt/${LOOLDIR}/loolwsd/var/cache/loolwsd/; \
mkdir -p /opt/${LOOLDIR}/jails/; \
chown -R ${LOOLUSER}:${LOOLUSER} /opt/${LOOLDIR}/loolwsd/var/cache/loolwsd/; \
chown -R ${LOOLUSER}:${LOOLUSER} /opt/${LOOLDIR}/jails/; \
rm -rf /opt/${LOOLDIR}/loolwsd/systemplate; \
/opt/${LOOLDIR}/loolwsd/loolwsd-systemplate-setup "/opt/${LOOLDIR}/loolwsd/systemplate" "/opt/${LOIPATH}/lib/${LOBINDIR}/" && \
touch /opt/${LOOLDIR}/loolwsd/systemplate/system_stamp; \
chown -R ${LOOLUSER}:${LOOLUSER} /opt/${LOOLDIR}/loolwsd/systemplate
Start manuell (Test):
sudo -u lool /opt/${LOOLDIR}/loolwsd/loolwsd \
--o:lo_template_path=/opt/${LOIPATH}/lib/${LOBINDIR} \
--o:sys_template_path=/opt/${LOOLDIR}/loolwsd/systemplate \
--o:child_root_path=/opt/${LOOLDIR}/jails \
--o:file_server_root_path=/opt/${LOOLDIR}
/etc/systemd/system/loolwsd.service:
[Unit]
Description=LibreOffice On-Line WebSocket Daemon
After=network.target
[Service]
ExecStart=/opt/lool_co/loolwsd/loolwsd --version --o:sys_template_path=/opt/lool_co/loolwsd/systemplate --o:lo_template_path=/opt/CollaboraOffice_5.1.10.10/lib/collaboraoffice --o:child_root_path=/opt/lool_co/jails --o:file_server_root_path=/opt/lool_co
User=lool
KillMode=control-group
Restart=always
[Install]
WantedBy=multi-user.target
Aufräumen (wenn alles funktioniert und die Quellen nicht mehr benötigt werden):
rm -rf /opt/LibreOfficeCore_co_git; \
rm -rf `echo ~http/.ccache`; \
rm -f /opt/${LOOLDIR}.tar; \
rm -rf /opt/${LOOLGITDIR}; \
unset LOIPATH; \
unset LOOLDIR; \
unset LOOLGITDIR; \
unset LOOLUSER; \
unset LOBINDIR; \
cd /opt; \
ls -ahl
Proxy-Einstellungen der Apache-Konfig. des Nextcloud-Hosts:
####### PROXY GLOBALS ###################################################################
SSLProxyEngine On
ProxyVia On
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto 'https' env=HTTPS
AllowEncodedSlashes On
SSLProxyVerify None
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerName Off
####### LOOLWSD #########################################################################
# static html, js, images, etc. served from loolwsd
# loleaflet is the client part of LibreOffice Online
ProxyPass /loleaflet https://127.0.0.1:9980/loleaflet retry=0
ProxyPassReverse /loleaflet https://127.0.0.1:9980/loleaflet
# WOPI discovery URL
ProxyPass /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0
ProxyPassReverse /hosting/discovery https://127.0.0.1:9980/hosting/discovery
# Main websocket
# NEU
ProxyPassMatch "/lool/(.*)/ws$" wss://127.0.0.1:9980/lool/$1/ws
# ALT
#ProxyPass /lool/ws wss://127.0.0.1:9980/lool/ws
# Admin Console websocket
ProxyPass /lool/adminws wss://127.0.0.1:9980/lool/adminws
# Download as, Fullscreen presentation and Image upload operations
ProxyPass /lool https://127.0.0.1:9980/lool
ProxyPassReverse /lool https://127.0.0.1:9980/lool
####### WEBRTC ##########################################################################
<Location /webrtc>
ProxyPass https://127.0.0.1:8443/webrtc
ProxyPassReverse /
</Location>
<Location /webrtc/ws>
ProxyPass wss://127.0.0.1:8443/webrtc/ws
</Location>
#########################################################################################