CentOS7架设Seafile6.3.14
Posted 林哥随记
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7架设Seafile6.3.14相关的知识,希望对你有一定的参考价值。
一、必备
seafile-pro-server_6.3.14_x86-64_201326593.tar.gz
nginx-1.16.1.tar.gz
ServConf.tar.gz
xshell
xftp
CentOS-7-x86_64-Everything-1810.iso(能连接互联网的无需这文件)
二、加载本地源(能连接互联网的无需这文件)
(一)用xftp将CentOS-7-x86_64-Everything-1810.iso丢到root目录。
(二)修改使用本地源
mkdir /cdrom
chmod 755 /cdrom
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak #禁用默认源
cp /etc/yum.repos.d/CentOS-Media.repo /etc/yum.repos.d/CentOS-Media.repo.bak #备份多媒体源
vi /etc/yum.repos.d/CentOS-Media.repo
按i
baseurl=file:///media/CentOS/ 修改为 baseurl=file:///cdrom
file:///media/cdrom/修改为#file:///media/cdrom/
file:///media/cdrecorder/修改为#file:///media/cdrecorder/
enabled=0修改为enabled=1
ESC
:wq
(三)挂载本地源
mount -o loop -t iso9660 /root/ CentOS-7-x86_64-Everything-1810.iso /cdrom
yum clean all
yum list
vi /etc/rc.d/rc.local
按i
mount -o loop -t iso9660 /root/ CentOS-7-x86_64-Everything-1810.iso /cdrom #添加后开机自动加载本地源
ESC
:wq
三、关闭selinux
vi /etc/sysconfig/selinux
SELINUX=enforcing修改为SELINUX=disabled
四、安装Seafile
(一)安装搭建seafile的环境
yum -y install mariadb mariadb-server mysql-python jre python python-setuptools python-imaging python-ldap python-memcached python-urllib3
(二)设置mariadb(mysql)密码为123456
systemctl start mariadb
systemctl enable mariadb
mysql -u'root' -p
#默认密码为空敲入回车
use mysql
update user set password=password("123456") where user="root";
grant all privileges on *.* to root@'%' identified by '123456';
flush privileges;
exit
(三)安装seafile
用xftp将seafile-pro-server_6.3.14_x86-64_201326593.tar.gz、
ServConf.tar.gz、nginx-1.16.1.tar.gz 上传至root
mkdir /opt/seafile
cd /root
tar xvfz seafile-pro-server_6.3.14_x86-64_201326593.tar.gz -C /opt/seafile
chmod -R 755 /opt/seafile
cd /opt/seafile/seafile-pro-server-6.3.14
./setup-seafile-mysql.sh
#按照提示输入安装即可,名字,IP,数据库密码,seafile数据库密码,新建
五、安装nginx
(一)安装opensll及需要编译nginx的环境
yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
(二)安装nginx
cd /root
tar xvfz nginx-1.16.1.tar.gz
cd /root/nginx-1.16.1
./configure
make
make install
六、通过 OpenSSL 生成 SSL 数字认证
cd /etc/pki/CA/private/
openssl genrsa -out seafile.privkey.pem 2048
openssl req -new -x509 -key seafile.privkey.pem -out seafile.cacert.pem -days 1095
七、替换配置项
cd /root
tar xvfz ServConf.tar.gz
mv -f /root/ServConf/nginx.service /etc/systemd/system/
mv -f /root/ServConf/seafile6.service /etc/systemd/system/seafile.service
mv -f /root/ServConf/seahub6.service /etc/systemd/system/seahub.service
mv -f /root/ServConf/gunicorn.conf /opt/seafile/conf/
mv -f /root/ServConf/nginx.conf /usr/local/nginx/conf/
八、修改配置项
vi /usr/local/nginx/conf/nginx.conf
#200.200.200.200 替换为 自己的域名
九、修复ssl(不出错无需使用)
cd /root/nginx-1.16.1
./configure --with-http_ssl_module
make
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
cp /root/nginx-1.16.1/objs/nginx /root/nginx-1.16.1/objs/nginx.bak
mv -f /root/nginx-1.16.1/objs/nginx /usr/local/nginx/sbin/nginx
mv /root/nginx-1.16.1/objs/nginx.bak /root/nginx-1.16.1/objs/nginx
十、开启防火墙端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --zone=public --add-port=8000/tcp --permanent
firewall-cmd --zone=public --add-port=8082/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
十一、安装在线浏览office插件
yum install -y libreoffice libreoffice-headless libreoffice-pyuno poppler-utils wqy-microhei-fonts wqy-zenhei-fonts wqy-unibit-fonts
#若是安装无效则往下修改
cd /seafile/conf
vi seafevents.conf
[OFFICE CONVERTER]修改enabled = true
十二、若为7.0以上的seafile,跳转九十九
十三、设置开机启动
systemctl enable nginx
systemctl enable seafile
systemctl enable seahub
十四、启动服务
systemctl start nginx
systemctl start seafile
cd /opt/seafile/seafile-server-latest
./seahub.sh start 8082
#设置管理员账号密码
十五、修改Seafile的网址,进入后台与第八的域名对应。
SERVICE_URL: https://200.200.200.200
FILE_SERVER_ROOT:https://200.200.200.200/seafhttp
十六、访问
http://200.200.200.200 or https://200.200.200.200
十七、确定成功后的收尾工作
cd /root
rm -rf ServConf.tar.gz
rm -rf seafile-pro-server_6.3.14_x86-64_201326593.tar.gz
rm -rf nginx-1.16.1.tar.gz
rm -rf ServConf
rm -rf nginx-1.16.1
十八、都懂
链接:https://pan.baidu.com/s/1updQxAbxWI6XGjeFVkslow
提取码:20mj
=============================================
九十九、Seafile7.0以上版本需要创建另外root用户才可以使用搜索,及替换启动项即可。
useradd --system --comment "seafile" seafile --create-home --home-dir /home/seafile
chown -R seafile.seafile /opt/seafile
chown -R seafile.seafile /tmp/seafile-office-output
cd /root
mv -f /root/ServConf/seafile7.service /etc/systemd/system/seafile.service
mv -f /root/ServConf/seahub7.service /etc/systemd/system/seahub.service
systemctl daemon-reload
跳转十三
自用导航:www.mysoft.work
以上是关于CentOS7架设Seafile6.3.14的主要内容,如果未能解决你的问题,请参考以下文章