天翼云linux上传工具,(一)天翼云主机安装seafile7.0.3

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

1.安装epel源和wget和上传下传插件

命令:

yum -y install epel-release wget lrzsz

902bb7aa83d7a2a628e3033bf706501a.png

3.安装python-pip

命令:

yum -y install python-pip

54aee612132245edd932a349aba2d877.png

4.更新pip setuptools工具

命令:

pip install --upgrade setuptools -i https://pypi.tuna.tsinghua.edu.cn/simple

c01474dae3ba5591d57f49d02c8ccb9f.png

5.更新pip

命令:

python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

e1d47c08b0f0294ae3b34f226c641541.png

6.安装 docker-compose

命令:

pip install docker-compose --ignore-installed requests -i https://pypi.tuna.tsinghua.edu.cn/simple

efa6cd53aa9e8205537acbb809cbb9ee.png

7.安装依赖包和nginx

命令:

yum -y install python-imaging MySQL-python python-memcached python-ldap python-urllib3 ffmpeg ffmpeg-devel nginx

cf71eb6c87318db778fca8d9a08dcc27.png

8.安装pillow moviepy

命令:pip install pillow moviepy

1b95e506cb5c7e9a686abe5c5c3d9245.png

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

097796be4505b3f8abdf71260ea8ed0b.png

10.安装mariadb数据库

命令:

yum -y install MariaDB-server MariaDB-client

16710b2ee7f76156ec648cb44e03b565.png

11.启动数据库

命令:

systemctl start mariadb

ef9268734c56f7a9d9d0c5c4bd601994.png

12.对数据库进行密码设置(数据库root用户的密码)

命令:mysql_secure_installation

09e9dfa9769e9d8431efc730e7992f9e.png

af487bde5cd31a3b1629a8af043b7cb8.png

1688abb84d3d3407999916373d06d31a.png

13.登录数据库

命令:

mysql -uroot -pa123456

52db1b54a0a08d7115f96e656f710e8d.png

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

f963da5ff721c6d1c3dc7e8c7b9c61e2.png

说明:天翼云主机给我分配的内网地址如下(故使用192.168.1.X网段,如果不是此网段请修改)

45fa66823f096914b89b517addf84b25.png

15.新建目录并把seafile安装文件上传至此目录

命令:

mkdir -pv /usr/local/seafile

cd /usr/local/seafile

7114bd75722fd2f9b9ae3915fd32b962.png

16.解压seafile安装文件并改名(改名是为了方便好记)

命令:

tar xf seafile-server_7.0.3_x86-64.tar.gz

421821b7dc0aa302ff15858221927297.png

17.安装seafile

命令:

cd /usr/local/seafile/seafile-server

./setup-seafile-mysql.sh

8c7e5d4fafbf7510936a763bf6b8cb04.png

ca1fa979f4730d9c5aed8394e008ea43.png

d983fb716c6a3fec42e0f91dca324f7a.png

1528b5789dc42494544de1ee471be30e.png

cc6016c38a5e6a56a6b243d7643161ed.png

18.启动seafile服务,如果新建并是第一次启动seahub,会让你输入用户名和密码(此用户名和密码是用于登录web的管理员)

命令:

./seafile.sh start

./seahub.sh start

91abbe83db6db08e7c5fd55bf5e3461e.png

fcd127e32678acbf81d76bd66b4dfcaa.png

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"

9b9573e1bf8315a77297b34e2570bd08.png

20.重新启动seafile.sh和seahub.sh

命令:

cd /usr/local/seafile/seafile-server

./seafile.sh restart

./seahub.sh restart

c76ed2a76deae91ae56b789149894019.png

21.在浏览器访问测试是否能正常访问和登录

8dd7106a4f6ec361a3a05e507dc28bda.png

20edf5e6bf8f4add6539603eb43cbd3c.png

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"

a83b5147cdea063d893504aeafddc952.png

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;

}

}

3930cf3b56673b5c4a69a07b221045fb.png

fedd90d4717ec1cbff0d8d8a53c1e39c.png

3a9b315cd452b59684339b1adc485e4f.png

24.在seafile的配置目录中编辑seahub_settings.py文件

命令:

vi /usr/local/seafile/conf/seahub_settings.py

在文件中添加如下一行

FILE_SERVER_ROOT = 'http://域名或IP/seafhttp'

92512f1b62ceede3b433b0c520a9bb23.png

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

e77cb504a8aa11d0ce3f52058b16f2ed.png

26.浏览器访问是否正常

1cd1dfaa1d463c81083e3a6a301a0c7c.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值