seafile和onlyoffice的https對接並在線訪問編輯

前面已經把seafile和onlyoffice的https訪問都已經配置通,現在就添加seafile對onlyoffice支持
1.編輯seafile的conf配置目錄seahub_settings.py文件,讓其對onlyoffice支持
命令:
vi /usr/local/seafile/conf/seahub_settings.py
添加如下內容:

ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = True
ONLYOFFICE_APIJS_URL = 'https://域名或IP地址:端口號/web-apps/apps/api/documents/api.js'
ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', 'fodt', 'odp', 'fodp', 'ods', 'fods')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx','doc','xls','ppt')
seafile和onlyoffice的https對接並在線訪問編輯

2.在nginx的配置文件seafile.conf添加如下內容
命令:
vi /etc/nginx/conf.d/seafile.conf
在seafile.conf配置文件的開始添加如下內容:
map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}

map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
"" $host;
}

map $http_upgrade $proxy_connection {
default upgrade;
"" close;
}
在seafile.conf配置文件中的server段內添加如下內容
location /onlyofficeds/ {
proxy_pass http://域名或IP地址:端口號/; #如果是ssl請修改爲https
proxy_http_version 1.1;
client_max_body_size 100M; # Limit Document size to 100MB
proxy_read_timeout 3600s;
proxy_connect_timeout 3600s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host/onlyofficeds;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
seafile和onlyoffice的https對接並在線訪問編輯
seafile和onlyoffice的https對接並在線訪問編輯
seafile和onlyoffice的https對接並在線訪問編輯
seafile和onlyoffice的https對接並在線訪問編輯
seafile和onlyoffice的https對接並在線訪問編輯

3.編輯seafile配置文件目錄conf中的ccnet.conf
命令
vi /usr/local/seafile/conf/ccnet.conf
修改爲:SERVICE_URL = https://域名或IP地址:444
seafile和onlyoffice的https對接並在線訪問編輯

4.重啓nginx,seafile,seahub服務
命令:
nginx -t
systemctl restart nginx
cd /usr/local/seafile/seafile-server
./seafile.sh restart
./seahub.sh restart
seafile和onlyoffice的https對接並在線訪問編輯

4.瀏覽器訪問是否正常訪問
seafile和onlyoffice的https對接並在線訪問編輯

5.在線打開doc文件,是否能正常訪問並可編輯
seafile和onlyoffice的https對接並在線訪問編輯

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章