阿里云服务器上搭建seafile专业版
因为官方一键安装教程在阿里云服务器上无法安装,由于水平有限,无法解决,所以选择手动安装
参考资料:
先将防火墙关闭
systemctl stop firewalld.service #停止firewall
一.部署环境
云服务器:阿里云 1vCPU 1GB ecs.xn4.small 100Mbps centos 7.4 64位
环境安装:
yum update
yum install -y tree vim
部署mysql5.7
下载mysql源安装包
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
安装mysql源
yum localinstall -y mysql57-community-release-el7-8.noarch.rpm
检查mysql源是否安装成功
yum repolist enabled | grep "mysql.*-community.*"
安装mysql
yum install -y mysql-community-server
启动mysql服务
systemctl start mysqld
设置开机启动
systemctl enable mysqld
systemctl daemon-reload
修改root本地登录密码
#查看root默认密码
grep 'temporary password' /var/log/mysqld.log
#修改root密码
mysql -uroot -p
set password for 'root'@'localhost'=password('密码');
注意:mysql5.7默认安装了密码安全检查插件(validate_password),默认密码检查策略要求密码必须包含:大小写字母、数字和特殊符号,并且长度不能少于8位。否则会提示ERROR 1819 (HY000): Your password does not satisfy the current policy requirements错误。
重新启动mysql服务使配置生效:
systemctl restart mysqld
打开远程登录和配置默认编码utf8
mysql>grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;
mysql>FLUSH PRIVILEGES;
修改/etc/my.cnf配置文件,在[mysqld]下添加编码配置,如下所示:
[mysqld]
character_set_server=utf8
init_connect='SET NAMES utf8'
3.部署nginx 1.12.2
yum install -y openssl-devel pcre-devel epel-release
yum install -y nginx
启动nginx
systemctl start nginx
4.部署python关联包
按照seafile官方手册安装如下:
1 |
# yum -y install epel-release |
5.部署jre
yum install jre
二.部署seafile
1.目录设计,将seafile专业版安装包下载到/opt目录下
1 |
mkdir -p /opt/seafile/installed |
2.部署seafile
cd seafile-pro-server-*
./setup-seafile-mysql.sh #运行安装脚本并回答预设问题
| 参数 | 作用 | 说明 |
|---|---|---|
| seafile server name | seafile 服务器的名字,目前该配置已经不再使用 | 3 ~ 15 个字符,可以用英文字母,数字,下划线 |
| seafile server ip or domain | seafile 服务器的 IP 地址或者域名 | 客户端将通过这个 IP 或者地址来访问你的 Seafile 服务 |
| seafile data dir | seafile 数据存放的目录,用上面的例子,默认将是/data/haiwen/seafile-data | seafile 数据将随着使用而逐渐增加,请把它放在一个有足够大空闲空间的分区上 |
| seafile fileserver port | seafile fileserver 使用的 TCP 端口 | 该端口用于文件同步,请使用默认的 8082,不能更改。 |
在这里, 你会被要求选择一种创建 Seafile 数据库的方式:
-------------------------------------------------------
Please choose a way to initialize seafile databases:
-------------------------------------------------------
[1] Create new ccnet/seafile/seahub databases
[2] Use existing ccnet/seafile/seahub databases
- 如果选择1, 你需要提供根密码. 脚本程序会创建数据库和用户。
- 如果选择2, ccnet/seafile/seahub 数据库应该已经被你(或者其他人)提前创建。
3.配置 Seafile和Seahub服务
Next, go to the systemd directory and create a seafile.service file with vim:
cd /etc/systemd/system/
vim seafile.service
Paste seafile service configuration below:
1 |
[Unit] |
Now create new seahub.service file.
vim seahub.service
And paste configuration below.
1 |
[Unit] |
Reload the systemd service and start seafile and seahub with systemctl.
systemctl daemon-reload
systemctl start seafile
systemctl start seahub
Make sure there is no error and check that the seafile and seahub service is running on port 8082 and 8000.
netstat -plntu
Start seafile and Seahub service
4.创建ssl证书
Create the ssl directory.
mkdir -p /etc/nginx/ssl
cd /etc/nginx/ssl
Generate self signed certificate files and a dhparam file with command below:
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
openssl req -new -x509 -sha256 -days 365 -newkey rsa:2048 -nodes -keyout server.key -out server.crt
ps:如果没有证书,可以使用上面的命令根据步骤生成一个
5.Nginx下配置Seahub
In this step, we will configure Nginx as a reverse proxy for the seafile-server on port 8000 and 8002.
Go to the nginx configuration directory and create a new virtual host file for seafile.
cd /etc/nginx/
备份原有的配置nginx.conf为nginx.conf.backup
mv nginx.conf nginx.conf.backup
vim nginx.conf
编辑nginx.conf内容
1 |
user nginx nginx; |
vim conf.d/seafile.conf
Paste virtual host configuration below:
1 |
server {
|
Save and exit.
I will use use ‘cloud.natsume.co’ as the domain name. Please replace that with your own domain name in the config above.
Now test the Nginx configuration and make sure that there are no errors.
nginx -t
Start Nginx with the systemctl command:
systemctl start nginx
Make sure port 80 and 443 are available in the list that netstat provides:
netstat -plntu
Check that Nginx is listening on the port 80
Next, we have to add the domain name to the seafile configuration. Go to the seafile directory and edit the configuration file.
cd /opt/seafile/
vim conf/ccnet.conf
Change the service URL to your domain name.
SERVICE_URL = https://fz419.cn
Save and exit.
Edit the seahub configuration file.
vim conf/seahub_settings.py
On the second line, add configuration below:
HTTP_SERVER_ROOT = 'https://fz419.cn/seafhttp'
Replace the domain name with your domain here again. Save and exit.
Restart seafile and add all services to start at boot time:
systemctl restart seafile
systemctl restart seahub
systemctl enable nginx
systemctl enable mysqld
systemctl enable seafile
systemctl enable seahub
6.配置防火墙
Start firewalld.
systemctl start firewalld
systemctl enable firewalld
Add HTTP and HTTPS port to the firewall configuration with the firewall-cmd command below:
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
Reload the firewall configuration and check the port list.
firewall-cmd --reload
firewall-cmd --list-all
打开TCP的80和443端口即可。
三.配置office在线预览功能
1.安装 Libreoffice/UNO
sudo yum install libreoffice libreoffice-headless libreoffice-pyuno poppler-utils
2.安装字体
sudo yum install wqy-microhei-fonts wqy-zenhei-fonts wqy-unibit-fonts -y
3.开启配置项
打开 conf/seafevents.conf, 添加:
[OFFICE CONVERTER]
enabled = true
保存后 seafevents.conf 重启 Seafile 服务
./seafile.sh restart
阿里云服务器上搭建seafile专业版的更多相关文章
- 在阿里云服务器上搭建xampp遇到的问题
参考文章:http://blog.csdn.net/hel12he/article/details/49781813 http://www.laozuo.org/8178.html http://bl ...
- 在阿里云服务器上搭建 Apache Tomat 应用
在阿里云上购买一台服务器,系统采用 window 2008 Server 企业版,64位 1.下载Java7 JRE,安装 http://www.java.com/zh_CN/download/man ...
- 如何在阿里云服务器上搭建wordpress个人网站
1.购买云服务器.域名.域名解析.配置linux系统上的web环境.FTP等参照下面的链接. https://www.cnblogs.com/smyhvae/p/4965163.html?tdsour ...
- 阿里云服务器上通过Docker部署redmine
背景:在日常工作的过程中会遇到各种各样的问题,每个问题来了之后需要花时间解决.这里就面临两个问题. 1:问题责任不明确,有时候会遇到数据库或者物理服务器的问题,这时候就需要把相应问题指派给相应的人,传 ...
- Linux学习2-在阿里云服务器上部署禅道环境
前言 以前出去面试总会被问到:测试环境怎么搭建?刚工作1-2年不会搭建测试环境还可以原谅自己,工作3-5年后如果还是对测试环境搭建一无所知,面试官会一脸的鄙视. 本篇以最简单的禅道环境搭建为例,学习下 ...
- 阿里云服务器上安装mysql的心路历程(博友们进来看看哦)
在阿里云花了100买了一台云服务器,配置如下: CPU: 1核 内存: 512MB 数据盘: 0G 带宽: 1Mbps 阿里云服务器安装mysql搞得我想吐血,搞了一个多星期,现在才搞好,而且,还有许 ...
- 在阿里云服务器上安装完成并启动Tomcat后,通过http不能访问--解决办法
在阿里云服务器上安装完成并启动Tomcat后,通过http不能访问的原因是阿里云平台为了安全设置了安全组策略,必须我们授权的端口,其他计算机才能通过http访问 解决办法:(这里以阿里轻量应用服务器为 ...
- jdbc连接阿里云服务器上的MySQL数据库 及 数据库IP限制
问题1:Jdbc 如何连接阿里云服务器上的MySQL数据库? 解决: 上截图: 其中IP是阿里云服务器的公网IP地址. 问题2: 刚开始接手开发的时候,使用Navicat连接阿里云服务器上的数据后 ...
- 使用Navicat连接阿里云服务器上的MySQL数据库--转
手把手教你如何正确连接阿里云服务器上的数据库: 1.首先打开Navicat,文件>新建连接>MySQL连接,其他的如一图所示. 2.因为是连接服务器上的MySQL,所以我们使用SSH连接, ...
随机推荐
- sqlserver修改某列为自增
sqlserver如果建表的时候不设自增,之后是没法直接修改的,需要先删再重设: alter table 表名 drop column ID alter table 表名 add ID int ide ...
- Random Access Iterator
Random Access Iterator 树型概率DP dp[u]代表以当前点作为根得到正确结果的概率 将深度最深的几个点dp[u]很明显是1 然后很简单的转移 有k次,但我们要先看一次的情况,然 ...
- python实现图书管理系统
# 用户注册 def logon(): print("欢迎来到图书管理系统注册页面~") username = input("请输入用户名:") if len( ...
- Faraday Future,FF2019年一季度前完成第一阶段5亿美元左右的A+轮融资,2019年年底前完成7亿美元的Pre-IPO轮融资,2020IPO
FF2019年一季度前完成第一阶段5亿美元左右的A+轮融资,2019年年底前完成7亿美元的Pre-IPO轮融资,2020IPO 区块链公司先行宣布将对FF进行投资.EVAIO(中文名:伊娃)公司 跨链 ...
- python 知识点补充
python 知识点补充 简明 python 教程 r 或 R 来指定一个 原始(Raw) 字符串 Python 是强(Strongly)面向对象的,因为所有的一切都是对象, 包括数字.字符串与 函数 ...
- 多标签图像分类任务的评价方法-mAP
http://blog.sina.com.cn/s/blog_9db078090102whzw.html 多标签图像分类(Multi-label Image Classification)任务中图片的 ...
- Codeforces Round #316 (Div. 2) D计算在一棵子树内某高度的节点
题:https://codeforces.com/contest/570/problem/D 题意:给定一个以11为根的n个节点的树,每个点上有一个字母(a~z),每个点的深度定义为该节点到11号节点 ...
- mock简单的json返回
针对非常简单的json返回串,我们也不一定非得通过freemarker模板的方式来构造返回数据,这里看实际的需求,如果返回的内容是固定的,而且json又非常简单,我们也可以直接写在程序里面,下面的接口 ...
- [GX/GZOI2019]与或和(单调栈+按位运算)
首先看到与或,很显然想到按照位拆分运算.然后就变成了0/1矩阵,要使矩阵在当前位与为1,则矩阵全为1,如果是或为1,则是矩阵不全为0,然后求全为0/1的矩阵个数即可.记录c[i][j]表示以a[i][ ...
- 在Orcl中通过SQL语句修改创建表
1.创建表时定义唯一性约束 CREATE TABLE table_name ( column1 datatype null/not null, column2 datatype null/not nu ...