onlyoffice可以在seafile中直接編輯word,execl,ppt,這個(gè)工具相當(dāng)好用1.安裝支持docker運(yùn)行環(huán)境命令:yum -y install wget
cd /etc/yum.repos.d/
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
刷新yum集yum repolist
2.安裝docker-ce命令:yum -y install docker-ce
3.把docker服務(wù)啟動(dòng),并運(yùn)行下載onlyoffice(如果下載慢,那自己找鏡像加速器),端口為88命令:systemctl start dockerdocker run -i -t -d --restart=always -p 88:80 onlyoffice/documentserver注釋?zhuān)?--restart=always表示每次開(kāi)機(jī),只要當(dāng)docker被設(shè)置為開(kāi)機(jī)啟動(dòng),此onlyoffice就會(huì)自動(dòng)運(yùn)行
4.查看docker鏡像是否運(yùn)行命令:docker ps
5.測(cè)試是否能訪(fǎng)問(wèn)到onlyoffice打開(kāi)瀏覽器訪(fǎng)問(wèn)http://192.168.80.120:88/welcome
6.編輯文件seahub_settings.py命令:vi /usr/local/seafile/conf/seahub_settings.py在此文件下末尾添加如下內(nèi)容:ENABLE_ONLYOFFICE = TrueVERIFY_ONLYOFFICE_CERTIFICATE = FalseONLYOFFICE_APIJS_URL = 'http://192.168.80.120:88/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')
7.重啟seafile服務(wù)命令:cd /usr/local/seafile/seafile-server./seafile.sh restart./seahub.sh restart
8.編輯nginx的配置文件seafile.conf命令:vi /etc/nginx/conf.d/seafile.conf在此文件開(kāi)頭處添加如下內(nèi)容: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;}添加的內(nèi)容如下圖所示:
在文件(/etc/nginx/conf.d/seafile.conf)中的server內(nèi)添加如下內(nèi)容location /onlyofficeds/ {proxy_pass http://192.168.80.120:88/;proxy_http_version 1.1;client_max_body_size 100M; # Limit Document size to 100MBproxy_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;}
添加的內(nèi)容如下圖所示:
9.重啟nginx服務(wù)命令:systemctl start nginx
10.打開(kāi)網(wǎng)址http://192.168.80.120,進(jìn)入系統(tǒng)設(shè)置
11.在設(shè)置處的SERVICE_URL和FILE_SERVER_ROOT修改如下,如果是域名的,請(qǐng)把IP地址換成域名地址12.
12.退出系統(tǒng)設(shè)置
13.進(jìn)入我的資料庫(kù)/私人資料庫(kù)中上傳doc或xlxs或pptx文件
14.測(cè)試打開(kāi)doc,docx,ppt,pptx,xlxs,xls打開(kāi)doc文件如下:
打開(kāi)docx文件如下:
打開(kāi)ppt文件如下:
打開(kāi)pptx文件如下:
打開(kāi)xls文件如下:
打開(kāi)xlxs文件如下:
聯(lián)系客服