Seafile 7.0 搭建 + onlyoffice搭建 实现在线办公
itomcoil 2024-12-16 13:44 25 浏览
安装 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
- 安装 wget 方便下载
yum -y install wget
- 下载yum源
cd /etc/yum.repos.d/
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
- 刷新
yum repolist
- 安装docker-ce
yum -y install docker-ce
安装完成后启动 docker
systemctl start docker
systemctl enable docker
- 修改docker容器下载镜像地址提升下载速度 改为阿里云的
vi /etc/docker/daemon.json
添加
{
"registry-mirrors":["https://6w4lyiz2.mirror.aliyuncs.com"]
}
按下ESC 在输入 :wq 保存退出
- 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
- 测试安装情况
访问:打开浏览器访问http://x.x.x.x:8889/welcome x.x.x.x替换成自己的服务器IP
- 编辑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端口删除
- 重启seafile程序
/opt/seafile/seafile-server/seafile.sh restart
/opt/seafile/seafile-server/seahub.sh restart
- 检查是否成功 访问地址:服务器ip
登入账号密码
点击公共----点击添加资料库----点击新建资料库----新建一个文件夹 test
进入test,上传一个 word excel ppt pdf 检查是能够在线编辑
相关推荐
- Python Qt GUI设计:将UI文件转换Python文件三种妙招(基础篇—2)
-
在开始本文之前提醒各位朋友,Python记得安装PyQt5库文件,Python语言功能很强,但是Python自带的GUI开发库Tkinter功能很弱,难以开发出专业的GUI。好在Python语言的开放...
- Connect 2.0来了,还有Nuke和Maya新集成
-
ftrackConnect2.0现在可以下载了--重新设计的桌面应用程序,使用户能够将ftrackStudio与创意应用程序集成,发布资产等。这个新版本的发布中还有两个Nuke和Maya新集成,...
- Magicgui:不会GUI编程也能轻松构建Python GUI应用
-
什么是MagicguiMagicgui是一个Python库,它允许开发者仅凭简单的类型注解就能快速构建图形用户界面(GUI)应用程序。这个库基于Napari项目,利用了Python的强大类型系统,使得...
- Python入坑系列:桌面GUI开发之Pyside6
-
阅读本章之后,你可以掌握这些内容:Pyside6的SignalsandSlots、Envents的作用,如何使用?PySide6的Window、DialogsandAlerts、Widgets...
- Python入坑系列-一起认识Pyside6 designer可拖拽桌面GUI
-
通过本文章,你可以了解一下内容:如何安装和使用Pyside6designerdesigner有哪些的特性通过designer如何转成python代码以前以为Pyside6designer需要在下载...
- pyside2的基础界面(pyside2显示图片)
-
今天我们来学习pyside2的基础界面没有安装过pyside2的小伙伴可以看主页代码效果...
- Python GUI开发:打包PySide2应用(python 打包pyc)
-
之前的文章我们介绍了怎么使用PySide2来开发一个简单PythonGUI应用。这次我们来将上次完成的代码打包。我们使用pyinstaller。注意,pyinstaller默认会将所有安装的pack...
- 使用PySide2做窗体,到底是怎么个事?看这个能不能搞懂
-
PySide2是Qt框架的Python绑定,允许你使用Python创建功能强大的跨平台GUI应用程序。PySide2的基本使用方法:安装PySide2pipinstallPy...
- pycharm中conda解释器无法配置(pycharm安装的解释器不能用)
-
之前用的好好的pycharm正常配置解释器突然不能用了?可以显示有这个环境然后确认后可以conda正在配置解释器,但是进度条结束后还是不成功!!试过了pycharm重启,pycharm重装,anaco...
- Conda使用指南:从基础操作到Llama-Factory大模型微调环境搭建
-
Conda虚拟环境在Linux下的全面使用指南:从基础操作到Llama-Factory大模型微调环境搭建在当今的AI开发与数据分析领域,conda虚拟环境已成为Linux系统下管理项目依赖的标配工具。...
- Python操作系统资源管理与监控(python调用资源管理器)
-
在现代计算环境中,对操作系统资源的有效管理和监控是确保应用程序性能和系统稳定性的关键。Python凭借其丰富的标准库和第三方扩展,提供了强大的工具来实现这一目标。本文将探讨Python在操作系统资源管...
- 本地部署开源版Manus+DeepSeek创建自己的AI智能体
-
1、下载安装Anaconda,设置conda环境变量,并使用conda创建python3.12虚拟环境。2、从OpenManus仓库下载代码,并安装需要的依赖。3、使用Ollama加载本地DeepSe...
- 一文教会你,搭建AI模型训练与微调环境,包学会的!
-
一、硬件要求显卡配置:需要Nvidia显卡,至少配备8G显存,且专用显存与共享显存之和需大于20G。二、环境搭建步骤1.设置文件存储路径非系统盘存储:建议将非安装版的环境文件均存放在非系统盘(如E盘...
- 使用scikit-learn为PyTorch 模型进行超参数网格搜索
-
scikit-learn是Python中最好的机器学习库,而PyTorch又为我们构建模型提供了方便的操作,能否将它们的优点整合起来呢?在本文中,我们将介绍如何使用scikit-learn中的网格搜...
- 如何Keras自动编码器给极端罕见事件分类
-
全文共7940字,预计学习时长30分钟或更长本文将以一家造纸厂的生产为例,介绍如何使用自动编码器构建罕见事件分类器。现实生活中罕见事件的数据集:背景1.什么是极端罕见事件?在罕见事件问题中,数据集是...
- 一周热门
- 最近发表
-
- Python Qt GUI设计:将UI文件转换Python文件三种妙招(基础篇—2)
- Connect 2.0来了,还有Nuke和Maya新集成
- Magicgui:不会GUI编程也能轻松构建Python GUI应用
- Python入坑系列:桌面GUI开发之Pyside6
- Python入坑系列-一起认识Pyside6 designer可拖拽桌面GUI
- pyside2的基础界面(pyside2显示图片)
- Python GUI开发:打包PySide2应用(python 打包pyc)
- 使用PySide2做窗体,到底是怎么个事?看这个能不能搞懂
- pycharm中conda解释器无法配置(pycharm安装的解释器不能用)
- Conda使用指南:从基础操作到Llama-Factory大模型微调环境搭建
- 标签列表
-
- ps图案在哪里 (33)
- super().__init__ (33)
- python 获取日期 (34)
- 0xa (36)
- super().__init__()详解 (33)
- python安装包在哪里找 (33)
- linux查看python版本信息 (35)
- python怎么改成中文 (35)
- php文件怎么在浏览器运行 (33)
- eval在python中的意思 (33)
- python安装opencv库 (35)
- python div (34)
- sticky css (33)
- python中random.randint()函数 (34)
- python去掉字符串中的指定字符 (33)
- python入门经典100题 (34)
- anaconda安装路径 (34)
- yield和return的区别 (33)
- 1到10的阶乘之和是多少 (35)
- python安装sklearn库 (33)
- dom和bom区别 (33)
- js 替换指定位置的字符 (33)
- python判断元素是否存在 (33)
- sorted key (33)
- shutil.copy() (33)