一、PostgreSQL
1、安裝PostgreSQL
2、運行配置PostgreSQL
(1)、運行開始菜單中的pgAdmin4,打開pgAdmin4管理工具
(2)、輸入密碼登錄到pgAdmin4
(3)、右鍵Login/Group Roles
(4)、新增only office的角色 用戶名和密碼()都爲onlyoffice、設置該角色的Privileges(權限) Can Login爲true
(5)、點擊保存按鈕
3、創建PgSql 關於onlyoffice
的數據庫
右鍵Database,創建名爲onlyoffice的所有者爲onlyoffice(2中創建的用戶)的數據庫
點擊保存按鈕
4、cmd 配置pgsql
cd "%ProgramFiles%\PostgreSQL\12\bin" psql -U postgres -c "CREATE DATABASE onlyoffice;" psql -U postgres -c "CREATE USER onlyoffice WITH password 'onlyoffice';" psql -U postgres -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
如果是一路next安裝,pgsql的運行時默認在c盤,這裏第二、三行官方文檔給重複了,因爲在3中執行了.所以這裏就執行最後一行授權的腳本.
二、RabbitMq安裝
參考https://www.cnblogs.com/GreenLeaves/p/16877978.html 完成Erlang和RabbitMq的安裝
三、Redis安裝
一路next
四、OnlyOffice
1、下載服務端
地址:https://www.onlyoffice.com/download-docs.aspx?from=helpcenter#docs-community
這裏我下載的是社區版
2、安裝
定位到server.exe目錄,默認安裝監聽的是80端口,如果要改端口,則需要定位到exe目錄執行以下代碼
onlyoffice-documentserver.exe /DS_PORT=19668
這樣監聽端口就變成了19668.一路next到
這裏勾掉Certbot,應爲在外網.提前下載好Visual C++ 2013 Update 5 Redistributable (x64)具體版本安裝界面中會有提示.
接着檢查RabbitMQ、Redis、PqSql是否安裝正確,在安裝界面中填對相關信息.一路next即可.
3、相關配置
安裝完畢之後,注意以下配置文件C:\Program Files\ONLYOFFICE\DocumentServer\config\local.json
{ "services": { "CoAuthoring": { "sql": { "dbHost": "localhost", "dbUser": "onlyoffice", "dbPass": "onlyoffice", "dbName": "onlyoffice" }, "redis": {}, "server": { "port": "8000" }, "utils": { "utils_common_fontdir": "C:/Windows/Fonts" }, "token": { "enable": { "request": { "inbox": true, "outbox": true }, "browser": true }, "inbox": { "header": "Authorization" }, "outbox": { "header": "Authorization" } }, "secret": { "inbox": { "string": "NAhO3UBGUa8ovaH4tpRXhY740NqugQ" }, "outbox": { "string": "NAhO3UBGUa8ovaH4tpRXhY740NqugQ" }, "session": { "string": "NAhO3UBGUa8ovaH4tpRXhY740NqugQ" } } } }, "rabbitmq": { "url": "amqp://guest:guest@localhost" }, "license": { "license_file": "C:/ProgramData/ONLYOFFICE/Data/license.lic" }, "storage": { "fs": { "secretString": "MwmKBDV8y48my65SoOCS" } } }
services.CoAuthoring.secret.inbox爲jwt
接着執行以下命令啓動測試服務
net start DsExampleSvc
DsExampleSvc服務是安裝完畢之後自動生成的.請觀察頁面.