安装unbuntu22.04
https://blog.csdn.net/qq_36437991/article/details/135915360
安装onlyoffice
sudo apt-get update
sudo apt-get upgrade
postgresql
sudo apt-get install postgresql
创建用户和数据库
sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH PASSWORD 'onlyoffice';"
sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice OWNER onlyoffice;"
安装rabbit-mq
sudo apt-get install rabbitmq-server
安装nginx-extras
sudo apt-get install nginx-extras
安装ttf-mscorefonts-installer
sudo apt-get install ttf-mscorefonts-installer
# 如果上面的安装失败请使用下面的命令
sudo apt-get install cabextract
sudo apt-get install xfonts-utils
sudo apt-get install fonts-liberation
# wget http://httpredir.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.8_all.deb
# sudo apt --fix-broken install ./ttf-mscorefonts-installer_3.8_all.deb
# sudo apt-get install ubuntu-restricted-extras
# 查看版本
dpkg -l | grep ttf-mscorefonts-installer
将https://sourceforge.net/projects/corefonts/files/the%20fonts/final/
下面的文件下载,然后保存到tmp中,安装ttf-mscorefonts-installer
,别同意协议就行
# 执行下面命令,选择路径即可
sudo dpkg-reconfigure ttf-mscorefonts-installer
安装onlyoffice server
下载unlimited-onlyoffice-package-builder,上传到服务器上
sudo apt-get install /home/wjl/onlyoffice-documentserver_8.0.1-31-btactic_amd64.deb
如果不带路径会从其他源中查找导致报错
依赖包会自动安装,等待安装完成
访问http://ip:80即可,出现如下界面说明安装成功
如果安装正版需要执行如下操作
mkdir -p -m 700 ~/.gnupg
curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | gpg --no-default-keyring --keyring gnupg-ring:/tmp/onlyoffice.gpg --import
chmod 644 /tmp/onlyoffice.gpg
sudo chown root:root /tmp/onlyoffice.gpg
sudo mv /tmp/onlyoffice.gpg /usr/share/keyrings/onlyoffice.gpg
echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list
sudo apt-get update
sudo apt-get install ttf-mscorefonts-installer
sudo apt-get install onlyoffice-documentserver
后续操作一样,存储key的位置/etc/onlyoffice/documentserver/local.json
api访问出现502
systemctl status ds-*
systemctl status ds-docservice
sudo systemctl start ds-docservice
/bin/sh -c exec /var/www/onlyoffice/documentserver/server/DocService/docservice 2>&1 | tee -a /var/log/onlyoffice/documentserver/docservice/out.log
# 查看日志分析原因
vim /var/log/onlyoffice/documentserver/docservice/out.log
groups ds
sudo chown ds:ds /etc/onlyoffice/documentserver/default.json
sudo chmod 666 /etc/onlyoffice/documentserver/default.json
sudo chown ds:ds /etc/onlyoffice/documentserver/production-linux.json
sudo chown 666 /etc/onlyoffice/documentserver/production-linux.json
设置好权限之后重启一下其他的服务也就都可以了
几个位置需要记录一下
/var/www/onlyoffice
/etc/onlyoffice
/var/log/onlyoffice
/var/lib/onlyoffice
缓存文件地址/var/lib/onlyoffice/documentserver/App_Data/cache/files/data
问题
部分服务器安装特别慢耐心等待即可,安装完成后可能访问80端口不是onlyoffice
# 查看程序的端口占用
sudo ss -tulnp
参考
https://www.onlyoffice.com/download-docs.aspx#docs-community
https://www.cnblogs.com/zhenfei/p/6186671.html