大佬教程收集整理的这篇文章主要介绍了天翼云主机安装seafile7.0.3,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
1.安装epel源和wget和上传下传插件
命令:
yum -y install epel-release wget lrzsz
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
3.安装python-pip
命令:
yum -y install python-pip
4.更新pip setuptools工具
命令:
pip install --upgrade setuptools -i https://pypi.tuna.tsinghua.edu.cn/simple
5.更新pip
命令:
python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
6.安装 docker-compose
命令:
pip install docker-compose --ignore-installed requests -i https://pypi.tuna.tsinghua.edu.cn/simple
7.安装依赖包和Nginx
命令:
yum -y install python-imaging MysqL-python python-memcached python-ldap python-urllib3 ffmpeg ffmpeg-devel Nginx
8.安装pillow moviepy
命令:pip install pillow moviepy
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
10.安装mariadb数据库
命令:
yum -y install MariaDB-server MariaDB-client
11.启动数据库
命令:
systemctl start mariadb
12.对数据库进行密码设置(数据库root用户的密码)
命令:MysqL_secure_installation
13.登录数据库
命令:
MysqL -uroot -pa123456
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 [email protected]‘192.168.80.%‘ identified by ‘b123456‘;
grant all privileges on ccnet_db. to [email protected]‘192.168.80.%‘ identified by ‘b123456‘;
grant all privileges on seafile_db. to [email protected]‘192.168.80.%‘ identified by ‘b123456‘;
grant all privileges on seahub_db.* to [email protected]‘192.168.80.%‘ identified by ‘b123456‘;
flush privileges;
exit
15.新建目录并把seafile安装文件上传至此目录
命令:@H_421_20@mkdir -pv /usr/local/seafile
cd /usr/local/seafile
16.解压seafile安装文件并改名(改名是为了方便好记)
命令:
tar xf seafile-server_7.0.3_x86-64.tar.gz
17.安装seafile
命令:
cd /usr/local/seafile/seafile-server
./setup-seafile-MysqL.sh
@H_607_244@
18.启动seafile服务,如果新建并是第一次启动seahub,会让你输入用户名和密码(此用户名和密码是用于登录web的管理员)
命令:
./seafile.sh start
./seahub.sh start
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"
20.重新启动seafile.sh和seahub.sh
命令:
cd /usr/local/seafile/seafile-server
./seafile.sh restart
./seahub.sh restart
21.在浏览器访问测试是否能正常访问和登录
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"
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; }@H_262_325@}
24.在seafile的配置目录中编辑seahub_setTings.py文件
命令:
vi /usr/local/seafile/conf/seahub_setTings.py
在文件中添加如下一行
FILE_SERVER_ROOT = ‘http://域名或IP/seafhttp‘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 restart26.浏览器访问是否正常
以上是大佬教程为你收集整理的天翼云主机安装seafile7.0.3全部内容,希望文章能够帮你解决天翼云主机安装seafile7.0.3所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。