onlyoffice可以在seafile中直接编辑word,execl,ppt,这个工具相当好用
1.安装支持docker运行环境
命令:
yum -y install wget
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
2.安装docker-ce
命令:
yum -y install docker-ce
3.把docker服务启动,并运行下载onlyoffice(如果下载慢,那自己找镜像加速器),端口为88
命令:
systemctl start docker
docker run -i -t -d --restart=always -p 88:80 onlyoffice/documentserver
注释: --restart=always表示每次开机,只要当docker被设置为开机启动,此onlyoffice就会自动运行
5.测试是否能访问到onlyoffice
打开浏览器访问http://192.168.80.120:88/welcome
6.编辑文件seahub_settings.py
命令:
vi /usr/local/seafile/conf/seahub_settings.py
在此文件下末尾添加如下内容:
ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = False
ONLYOFFICE_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服务
命令:
cd /usr/local/seafile/seafile-server
./seafile.sh restart
./seahub.sh restart
8.编辑nginx的配置文件seafile.conf
命令:
vi /etc/nginx/conf.d/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;
}
添加的内容如下图所示:
在文件(/etc/nginx/conf.d/seafile.conf)中的server内添加如下内容
location /onlyofficeds/ {
proxy_pass http://192.168.80.120:88/;
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;
}
9.重启nginx服务
命令:
systemctl start nginx
10.打开网址http://192.168.80.120,进入系统设置
11.在设置处的SERVICE_URL和FILE_SERVER_ROOT修改如下,如果是域名的,请把IP地址换成域名地址
12.
13.进入我的资料库/私人资料库中上传doc或xlxs或pptx文件