百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 技术文章 > 正文

Seafile 7.0 搭建 + onlyoffice搭建 实现在线办公

itomcoil 2024-12-16 13:44 32 浏览

安装 wget

yum install wget -y

创建lnmp文件 用于安装lnmp

mkdir /lnmp

cd /lnmp

安装lnmp

wget http://soft.vpser.net/lnmp/lnmp1.7.tar.gz -cO lnmp1.7.tar.gz && tar zxf lnmp1.7.tar.gz && cd lnmp1.7 && ./install.sh lnmp

选择安装mysql 5.6

输入数据库密码

开启indb 一定要开启 否则无法运行seafile

安装php 7.0

默认就行

安装完成

创建 seaflie文件夹

mkdir /opt/seafile/

cd /opt/seafile/

下载seafile安装包

wget http://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_7.0.5_x86-64.tar.gz

解压seafile安装包

tar -zxvf seafile-server_7.0.5_x86-64.tar.gz

mv seafile-server-7.0.5 seafile-server 改个名字

cd seafile-server 进入安装包文件夹

安装必要依赖

yum install python python-setuptools MySQL-python python-urllib3 python-ldap -y

安装seafle程序

./setup-seafile-mysql.sh

按下回车 提示输入 名称 随便输入

输入服务器IP地址

输入 刚刚创建的数据库密码 这里不会显示 输入完直接回车

等待安装完成

安装完成

开启相关端口

开启防火墙

systemctl start firewalld

开启防火墙开机自启

systemctl enable firewalld

开放端口

firewall-cmd --zone=public --add-port=8000/tcp --permanent

firewall-cmd --zone=public --add-port=8080/tcp --permanent

firewall-cmd --zone=public --add-port=8081/tcp --permanent

firewall-cmd --zone=public --add-port=8082/tcp --permanent

firewall-cmd --zone=public --add-port=80/tcp --permanent

firewall-cmd --zone=public --add-port=8889/tcp --permanent

firewall-cmd --zone=public --add-port=10001/tcp --permanent

firewall-cmd --zone=public --add-port=12001/tcp --permanent

让端口生效

firewall-cmd --reload

启动seafile

./seafile.sh start

./seahub.sh start

创建管理员邮箱和密码

设置开机自启seafile

新建seafile.service文件


vi /etc/systemd/system/seafile.service


输入以下内容(注意修改${seafile_dir}为你的seafile目录)


[Unit]

Description=Seafile

# add mysql.service or postgresql.service depending on your database to the line below

# 如果没有使用memcached则去掉memcached.service

After=network.target mariadb.service memcached.service


[Service]

Type=oneshot

ExecStart=/opt/seafile/seafile-server-latest/seafile.sh start

# 如果seahub使用了nginx反代,请修改为 ExecStart=/opt/seafile/seafile-server-latest/seahub.sh start-fastcgi

ExecStart=/opt/seafile/seafile-server-latest/seahub.sh start

ExecStop=/opt/seafile/seafile-server-latest/seafile.sh restart

ExecStop=/opt/seafile/seafile-server-latest/seahub.sh restart

ExecStop=/opt/seafile/seafile-server-latest/seafile.sh stop

ExecStop=/opt/seafile/seafile-server-latest/seahub.sh stop

RemainAfterExit=yes

# User 和 Group 如果未建立seafile用户和用户组,则修改为root,否则无法启动.

User=root

Group=root

[Install]

WantedBy=multi-user.target

运行systemctl daemon-reload使配置生效

systemctl daemon-reload

命令

systemctl start seafile #启动seafile

systemctl stop seafile #停止seafile

systemctl enable seafile #设置seafile随系统启动

systemctl is-enabled seafile #检查seafile是否已经设置为自启动

systemctl disable seafile #关闭seafile随系统启动



设置上传下载限制

vi /opt/seafile/conf/seafile.conf

# 上传文件最大为20000M.

max_upload_size=20000

# 最大下载目录限制为20000M.

max_download_dir_size=20000


添加一个端口网站 具体如下

lnmp vhost add

创建日志文件存放

touch /opt/seafile/logs/seahub.access.log

touch /opt/seafile/logs/seahub.error.log

定位到nginx下的配置文件

cd /usr/local/nginx/conf/vhost/

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;

}

server

{

listen 80;

server_name 10.25.2.220;

index index.html index.htm index.php default.html default.htm default.php;

server_name seafile.example.com;

proxy_set_header X-Forwarded-For $remote_addr;

location / {

proxy_pass http://127.0.0.1:8000;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Host $server_name;

proxy_read_timeout 1200s;

client_max_body_size 0;

access_log /opt/seafile/logs/seahub.access.log;

error_log /opt/seafile/logs/seahub.error.log;

}

location /seafhttp {

rewrite ^/seafhttp(.*)$ $1 break;

proxy_pass http://127.0.0.1:8082;

client_max_body_size 0;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_connect_timeout 36000s;

proxy_read_timeout 36000s;

proxy_send_timeout 36000s;

send_timeout 36000s;

}

location /onlyofficeds/ {

proxy_pass http://10.10.1.23:8889/;

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;

}

}


设置默认的 端口80

cd /usr/local/nginx/conf

vi nginx.conf

重启nginx

service nginx restart

  1. 安装 wget 方便下载

yum -y install wget

  1. 下载yum源

cd /etc/yum.repos.d/

wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

  1. 刷新

yum repolist

  1. 安装docker-ce

yum -y install docker-ce

安装完成后启动 docker

systemctl start docker

systemctl enable docker

  1. 修改docker容器下载镜像地址提升下载速度 改为阿里云的

vi /etc/docker/daemon.json


添加

{

"registry-mirrors":["https://6w4lyiz2.mirror.aliyuncs.com"]

}

按下ESC 在输入 :wq 保存退出

  1. docker运行下载onlyoffice,此处设置onlyoffice监听端口为8889

docker run -i -t -d --restart=always -p 8889:80 onlyoffice/documentserver

#--restart=always表示每次开机,只要当docker被设置为开机启动,此onlyoffice就会自动运行 等待会有点久,如果等待6分钟-10分钟还没下载完成就 ctrl+c结束 重新运行

安装完成

查看docker镜像

docker ps

  1. 测试安装情况

访问:打开浏览器访问http://x.x.x.x:8889/welcome x.x.x.x替换成自己的服务器IP

  1. 编辑seahub_settings.py 程序

vi /opt/seafile/conf/seahub_settings.py

在此文件下末尾添加如下内容(把10.25.7.251改为自己服务器ip地址):

# Enable Only Office

ENABLE_ONLYOFFICE = True

VERIFY_ONLYOFFICE_CERTIFICATE = False

ONLYOFFICE_APIJS_URL = 'http://10.25.2.220:8889/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','ppt','xls','doc')


设置邮箱系统 修改对于的邮件和密码

vi /opt//opt/seafile/conf/seahub_settings.py

EMAIL_USE_SSL = True

EMAIL_HOST = 'smtp.exmail.qq.com'

EMAIL_HOST_USER = 'centosm@qq.com邮箱'

EMAIL_HOST_PASSWORD = 'hQsyPfCWVYi密码'

EMAIL_PORT = '465'

DEFAULT_FROM_EMAIL = EMAIL_HOST_USER

SERVER_EMAIL = EMAIL_HOST_USER

修改端口设置(不修改的话无法在线编辑)把这里的8000端口删除

  1. 重启seafile程序

/opt/seafile/seafile-server/seafile.sh restart

/opt/seafile/seafile-server/seahub.sh restart

  1. 检查是否成功 访问地址:服务器ip

登入账号密码

点击公共----点击添加资料库----点击新建资料库----新建一个文件夹 test


进入test,上传一个 word excel ppt pdf 检查是能够在线编辑

相关推荐

selenium(WEB自动化工具)

定义解释Selenium是一个用于Web应用程序测试的工具。Selenium测试直接运行在浏览器中,就像真正的用户在操作一样。支持的浏览器包括IE(7,8,9,10,11),MozillaF...

开发利器丨如何使用ELK设计微服务中的日志收集方案?

【摘要】微服务各个组件的相关实践会涉及到工具,本文将会介绍微服务日常开发的一些利器,这些工具帮助我们构建更加健壮的微服务系统,并帮助排查解决微服务系统中的问题与性能瓶颈等。我们将重点介绍微服务架构中...

高并发系统设计:应对每秒数万QPS的架构策略

当面试官问及"如何应对每秒几万QPS(QueriesPerSecond)"时,大概率是想知道你对高并发系统设计的理解有多少。本文将深入探讨从基础设施到应用层面的解决方案。01、理解...

2025 年每个 JavaScript 开发者都应该了解的功能

大家好,很高兴又见面了,我是"高级前端进阶",由我带着大家一起关注前端前沿、深入前端底层技术,大家一起进步,也欢迎大家关注、点赞、收藏、转发。1.Iteratorhelpers开发者...

JavaScript Array 对象

Array对象Array对象用于在变量中存储多个值:varcars=["Saab","Volvo","BMW"];第一个数组元素的索引值为0,第二个索引值为1,以此类推。更多有...

Gemini 2.5编程全球霸榜,谷歌重回AI王座,神秘模型曝光,奥特曼迎战

刚刚,Gemini2.5Pro编程登顶,6美元性价比碾压Claude3.7Sonnet。不仅如此,谷歌还暗藏着更强的编程模型Dragontail,这次是要彻底翻盘了。谷歌,彻底打了一场漂亮的翻...

动力节点最新JavaScript教程(高级篇),深入学习JavaScript

JavaScript是一种运行在浏览器中的解释型编程语言,它的解释器被称为JavaScript引擎,是浏览器的一部分,JavaScript广泛用于浏览器客户端编程,通常JavaScript脚本是通过嵌...

一文看懂Kiro,其 Spec工作流秒杀Cursor,可移植至Claude Code

当Cursor的“即兴编程”开始拖累项目质量,AWS新晋IDEKiro以Spec工作流打出“先规范后编码”的系统工程思维:需求-设计-任务三件套一次生成,文档与代码同步落地,复杂项目不...

「晚安·好梦」努力只能及格,拼命才能优秀

欢迎光临,浏览之前点击上面的音乐放松一下心情吧!喜欢的话给小编一个关注呀!Effortscanonlypass,anddesperatelycanbeexcellent.努力只能及格...

JavaScript 中 some 与 every 方法的区别是什么?

大家好,很高兴又见面了,我是姜茶的编程笔记,我们一起学习前端相关领域技术,共同进步,也欢迎大家关注、点赞、收藏、转发,您的支持是我不断创作的动力在JavaScript中,Array.protot...

10个高效的Python爬虫框架,你用过几个?

小型爬虫需求,requests库+bs4库就能解决;大型爬虫数据,尤其涉及异步抓取、内容管理及后续扩展等功能时,就需要用到爬虫框架了。下面介绍了10个爬虫框架,大家可以学习使用!1.Scrapysc...

12个高效的Python爬虫框架,你用过几个?

实现爬虫技术的编程环境有很多种,Java、Python、C++等都可以用来爬虫。但很多人选择Python来写爬虫,为什么呢?因为Python确实很适合做爬虫,丰富的第三方库十分强大,简单几行代码便可实...

pip3 install pyspider报错问题解决

运行如下命令报错:>>>pip3installpyspider观察上面的报错问题,需要安装pycurl。是到这个网址:http://www.lfd.uci.edu/~gohlke...

PySpider框架的使用

PysiderPysider是一个国人用Python编写的、带有强大的WebUI的网络爬虫系统,它支持多种数据库、任务监控、项目管理、结果查看、URL去重等强大的功能。安装pip3inst...

「机器学习」神经网络的激活函数、并通过python实现激活函数

神经网络的激活函数、并通过python实现whatis激活函数感知机的网络结构如下:左图中,偏置b没有被画出来,如果要表示出b,可以像右图那样做。用数学式来表示感知机:上面这个数学式子可以被改写:...