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

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

nanshan 2024-12-04 14:20 65 浏览 0 评论

安装 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 检查是能够在线编辑

相关推荐

Let’s Encrypt免费搭建HTTPS网站

HTTPS(全称:HyperTextTransferProtocoloverSecureSocketLayer),是以安全为目标的HTTP通道,简单讲是HTTP的安全版。即HTTP下加入...

使用Nginx配置TCP负载均衡(nginx tcp负载)

假设Kubernetes集群已经配置好,我们将基于CentOS为Nginx创建一个虚拟机。以下是实验种设置的详细信息:Nginx(CenOS8Minimal)-192.168.1.50Kube...

Nginx负载均衡及支持HTTPS与申请免费SSL证书

背景有两台minio文件服务器已做好集群配置,一台是192.168.56.41:9000;另一台是192.168.56.42:9000。应用程序通过Nginx负载均衡调用这两台minio服务,减轻单点...

HTTPS配置实战(https配置文件)

原因现在网站使用HTTPS是规范操作之一,前些日子买了腾讯云服务,同时申请了域名http://www.asap2me.top/,目前该域名只支持HTTP,想升级为HTTPS。关于HTTPS的链接过程大...

只有IP地址没有域名实现HTTPS访问方法

一般来说,要实现HTTPS,得有个注册好的域名才行。但有时候呢,咱只有服务器的IP地址,没注册域名,这种特殊情况下,也能照样实现HTTPS安全访问,按下面这些步骤来就行:第一步,先确认公网...

超详解:HTTPS及配置Django+HTTPS开发环境

众所周知HTTP协议是以TCP协议为基石诞生的一个用于传输Web内容的一个网络协议,在“网络分层模型”中属于“应用层协议”的一种。在这里我们并不研究该协议标准本身,而是从安全角度去探究使用该协议传输数...

Godaddy购买SSL之后Nginx配置流程以及各种错误的解决

完整流程:参考地址:https://sg.godaddy.com/zh/help/nginx-generate-csrs-certificate-signing-requests-3601生成NGI...

Nginx从安装到高可用,一篇搞定(nginx安装与配置详解)

一、Nginx安装1、去官网http://nginx.org/下载对应的nginx包,推荐使用稳定版本2、上传nginx到linux系统3、安装依赖环境(1)安装gcc环境yuminstallgc...

阿里云免费证书申请,配置安装,使用tomcat,支持http/https访问

参数说明商品类型默认已选择云盾证书服务(无需修改)。云盾证书服务类型SSL证书服务的类型。默认已选择云盾SSL证书(无需修改),表示付费版SSL证书。如果您需要免费领取或付费扩容DV单域名证书【免费试...

你试过两步实现Nginx的规范配置吗?极速生成Nginx配置小工具

NGINX是一款轻量级的Web服务器,最强大的功能之一是能够有效地提供HTML和媒体文件等静态内容。NGINX使用异步事件驱动模型,在负载下提供可预测的性能。是当下最受欢迎的高性能的Web...

从零开始搭建HTTPS服务(搭建https网站)

搭建HTTPS服务的最初目的是为了开发微信小程序,因为wx.request只允许发起HTTPS请求,并且还必须和指定的域名进行网络通信。要从零开始搭建一个HTTPS的服务需要下面4...

群晖NAS使用官网域名和自己的域名配置SSL实现HTTPS访问

安全第一步,群晖NAS使用官网域名和自己的域名配置SSL实现HTTPS访问【新手导向】NAS本质还是一个可以随时随地访问的个人数据存储中心,我们在外网访问的时候,特别是在公网IP下,其实会面临着很多安...

让网站快速升级HTTPS协议提高安全性

为什么用HTTPS网络安全越来越受到重视,很多互联网服务网站,都已经升级改造为https协议。https协议下数据包是ssl/tcl加密的,而http包是明文传输。如果请求一旦被拦截,数据就会泄露产生...

用Https方式访问Harbor-1.9版本(https访问流程)

我上周在头条号写过一篇原创文章《Docker-Harbor&Docker-kitematic史上最详细双系统配置手册》,这篇算是它的姊妹篇吧。这篇文章也将用到我在头条写的另一篇原创文章的...

如何启用 HTTPS 并配置免费的 SSL 证书

在Linux服务器上启用HTTPS并配置免费的SSL证书(以Let'sEncrypt为例)可以通过以下步骤完成:---###**一、准备工作**1.**确保域名已解析**...

取消回复欢迎 发表评论: