(一)天翼云主机安装seafile7.0.3

关闭天翼云主机的防火墙和selinux,操作系统是centos 7.6 ,天翼云主机默认不开放80,443端口,需要开放必须去做备案,故下面教程使用其它的端口,如开放了80,443的,请修改配置文件的对应端口即可

1.安装epel源和wget和上传下传插件
命令:
yum -y install epel-release wget lrzsz
(一)天翼云主机安装seafile7.0.3

2.安装nux
命令:
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
(一)天翼云主机安装seafile7.0.3

3.安装python-pip
命令:
yum -y install python-pip
(一)天翼云主机安装seafile7.0.3

4.更新pip setuptools工具
命令:
pip install --upgrade setuptools -i https://pypi.tuna.tsinghua.edu.cn/simple
(一)天翼云主机安装seafile7.0.3

5.更新pip
命令:
python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
(一)天翼云主机安装seafile7.0.3

6.安装 docker-compose
命令:
pip install docker-compose --ignore-installed requests -i https://pypi.tuna.tsinghua.edu.cn/simple
(一)天翼云主机安装seafile7.0.3

7.安装依赖包和nginx
命令:
yum -y install python-imaging MySQL-python python-memcached python-ldap python-urllib3 ffmpeg ffmpeg-devel nginx
(一)天翼云主机安装seafile7.0.3

8.安装pillow moviepy
命令:pip install pillow moviepy
(一)天翼云主机安装seafile7.0.3

9.编辑Mariadb数据库yum源
命令:
vi /etc/yum.repos.d/mariadb.repo 并输入如下内容
[mariadb]
name = MariaDB
baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.4/centos7-amd64
gpgkey = https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
(一)天翼云主机安装seafile7.0.3

10.安装mariadb数据库
命令:
yum -y install MariaDB-server MariaDB-client
(一)天翼云主机安装seafile7.0.3

11.启动数据库
命令:
systemctl start mariadb
(一)天翼云主机安装seafile7.0.3

12.对数据库进行密码设置(数据库root用户的密码)
命令:mysql_secure_installation
(一)天翼云主机安装seafile7.0.3
(一)天翼云主机安装seafile7.0.3
(一)天翼云主机安装seafile7.0.3

13.登录数据库
命令:
mysql -uroot -pa123456
(一)天翼云主机安装seafile7.0.3

14.创建seafile需要的数据库及用户,并对此些数据库进行授权
命令:
create database ccnet_db character set = 'utf8';
create database seafile_db character set = 'utf8';
create database seahub_db character set = 'utf8';
create user seafile@'192.168.80.%' identified by 'b123456';
grant all privileges on ccnet_db. to seafile@'192.168.80.%' identified by 'b123456';
grant all privileges on seafile_db.
to seafile@'192.168.80.%' identified by 'b123456';
grant all privileges on seahub_db.* to seafile@'192.168.80.%' identified by 'b123456';
flush privileges;
exit
(一)天翼云主机安装seafile7.0.3
说明:天翼云主机给我分配的内网地址如下(故使用192.168.1.X网段,如果不是此网段请修改)
(一)天翼云主机安装seafile7.0.3

15.新建目录并把seafile安装文件上传至此目录
命令:
mkdir -pv /usr/local/seafile
cd /usr/local/seafile
(一)天翼云主机安装seafile7.0.3

16.解压seafile安装文件并改名(改名是为了方便好记)
命令:
tar xf seafile-server_7.0.3_x86-64.tar.gz
(一)天翼云主机安装seafile7.0.3

17.安装seafile
命令:
cd /usr/local/seafile/seafile-server
./setup-seafile-mysql.sh
(一)天翼云主机安装seafile7.0.3
(一)天翼云主机安装seafile7.0.3
(一)天翼云主机安装seafile7.0.3
(一)天翼云主机安装seafile7.0.3
(一)天翼云主机安装seafile7.0.3

18.启动seafile服务,如果新建并是第一次启动seahub,会让你输入用户名和密码(此用户名和密码是用于登录web的管理员)
命令:
./seafile.sh start
./seahub.sh start
(一)天翼云主机安装seafile7.0.3
(一)天翼云主机安装seafile7.0.3

19.修改seafile的conf目录中的gunicorn.conf配置文件(seafile从6.3版本开始,默认不允许直接使用IP:8001访问)
命令:
vi /usr/local/seafile/conf/gunicorn.conf
修改里面的内容,
把bind = "127.0.0.1:8000"修改为bind = "0.0.0.0:8001"
(一)天翼云主机安装seafile7.0.3

20.重新启动seafile.sh和seahub.sh
命令:
cd /usr/local/seafile/seafile-server
./seafile.sh restart
./seahub.sh restart
(一)天翼云主机安装seafile7.0.3

21.在浏览器访问测试是否能正常访问和登录
(一)天翼云主机安装seafile7.0.3
(一)天翼云主机安装seafile7.0.3

22.如果需要使用80端口直接访问,需要把配置文件gunicorn.con修改回来,并安装nginx和启用编辑nginx
命令:
vi /usr/local/seafile/conf/gunicorn.conf
修改里面的内容,
把bind = "0.0.0.0:8001"修改为bind = "127.0.0.1:8000"
(一)天翼云主机安装seafile7.0.3

23.前面已经安装了nginx,现修改nginx编辑文件(为了默认的配置文件上修改,故可以在默认配置文件上的包含的conf路径下创建一个seafile.conf文件,以方便管理
命令:
vi /etc/nginx/conf.d/seafile.com
添加如下内容:图片的截图是包含有fastcgi的,在此#被加粗了,故删除,如需要,可以参考官网
server {
listen 888;
server_name cloud.jvtc.com.cn;
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      /var/log/nginx/seahub.access.log;
     error_log       /var/log/nginx/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 /media {
    root /usr/local/seafile/seafile-server-latest/seahub;   
}

}
(一)天翼云主机安装seafile7.0.3
(一)天翼云主机安装seafile7.0.3
(一)天翼云主机安装seafile7.0.3

24.在seafile的配置目录中编辑seahub_settings.py文件
命令:
vi /usr/local/seafile/conf/seahub_settings.py
在文件中添加如下一行
FILE_SERVER_ROOT = 'http://域名或IP/seafhttp'
(一)天翼云主机安装seafile7.0.3

25.重启启动nginx,seafile和seahub
命令:
nginx -t 检查nginx配置文件有没有语法错误,如没有,执行systemctl restart nginx重启nginx
systemctl restart nginx
cd /usr/loca/seafile/seafile-server
./seafile.sh restart
./seahub.sh restart
(一)天翼云主机安装seafile7.0.3

26.浏览器访问是否正常
(一)天翼云主机安装seafile7.0.3

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值