onlyoffice教程0x01-安裝

wls1036發表於2021-12-07

說明

onlyoffice有三個版本

  • 社群版(基於AGPL v.3協議)
  • 企業版
  • 開發版

    其中企業版和開發版都需要購買商業授權,本次以安裝社群版為例

安裝

onlyoffice支援docker安裝和主機安裝,docker安裝比較簡單,參考官方文件即可,這裡就不再介紹,本次介紹的是在主機上安裝onlyoffice

安裝環境

  • OS:CentOS 7.8
  • CPU: 2核
  • 記憶體: 8G

安裝nginx

建立檔案/etc/yum.repos.d/nginx.repo

# cat <<EOF > /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
EOF

使用yum安裝nginx

yum install nginx

安裝EPEL倉庫

yum install epel-release

安裝PostgreSQL

yum install postgresql postgresql-server
service postgresql initdb 
chkconfig postgresql on
  • 修改配置檔案/var/lib/pgsql/data/pg_hba.conf,將all all 127.0.0.1/32 ident修改為
host    all             all             127.0.0.1/32            trust
  • host all all ::1/128 ident修改為
host    all             all             ::1/128                 trust
  • 重啟PostgreSQL
service postgresql restart
  • 建立onlyoffice資料庫
sudo -u postgres psql -c "CREATE DATABASE onlyoffice;"
sudo -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
sudo -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
必須用sudo -u postgres建立,pg不允許root使用者進行建立

安裝RabbitMQ

yum install rabbitmq-server
service rabbitmq-server start
systemctl enable rabbitmq-server

安裝mscorefonts

yum install cabextract xorg-x11-font-utils
yum install fontconfig
rpm -i https://deac-ams.dl.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
如果rpm包下載不下來,可以先下載到本地,然後用rpm -i msttcore-fonts-installer-2.6-1.noarch.rpm進行安裝

安裝document server

  • 安裝
yum install https://download.onlyoffice.com/repo/centos/main/noarch/onlyoffice-repo.noarch.rpm
yum install onlyoffice-documentserver
  • 啟動
service supervisord start
systemctl enable supervisord
service nginx start
systemctl enable nginx
  • 關閉
service supervisord stop
service nginx stop
  • 配置

直接執行命令documentserver-configure.sh,會提示輸入PG資訊和MQ資訊

對於PG資料庫

Host: localhost
Database: onlyoffice
User: onlyoffice
Password: onlyoffice

對於RabbitMQ

Host: localhost
User: guest
Password: guest

相關文章