有问题,有官网测试过的Linux平台:https://www.seafile.com/download/
一、安装python2.7.14
1、安装依赖包
[[email protected] ~]# yum -y install zlib zlib-devel openssl openssl-devel
2、为了防止出现 import zlib找不到的情况,复制文件:
[[email protected] ~]# mkdir -p /usr/local/lib/python2.7/lib-dynload
[[email protected] ~]# cp /usr/lib64/python2.6/lib-dynload/zlibmodule.so /usr/local/lib/python2.7/lib-dynload
3、下载python2.7.14,可直接到python官网下载,并选择相应版本;解压后文件夹改名为python
[[email protected] ~]# wget --no-check-certificate https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz
4、进入python,编译安装:
[[email protected] Python-2.7.14]# ./configure
[[email protected] Python-2.7.14]# make && make intall
5,把系统自带的2.6移除(依然会保留2.6版本:/usr/bin/python2.6)
[[email protected] ~]# rm -f /usr/bin/python
6,把python执行软连接连接到2.7
[[email protected] ~]# ln -s /usr/local/bin/python2.7 /usr/bin/python
7,编辑yum命令,把路径指明为2.6,因为yum必须基于2.6版本
[[email protected] ~]# vi /usr/bin/yum
把文件头部的#!/usr/bin/python改成#!/usr/bin/python2.6
保存退出,yum即可正常使用。如若有其他命令、软件不能正常使用,仿照yum配置文件的修改方法,修改其配置文件即可。
8、安装setuptools
[[email protected] ~]# wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-18.0.1.tar.gz
[[email protected] ~]# tar xf setuptools-18.0.1.tar.gz
[[email protected] ~]# cd setuptools-18.0.1
[[email protected] setuptools-18.0.1]# python setup.py install
9、安装pip
[[email protected] ~]# wget --no-check-certificate https://pypi.python.org/packages/7e/71/3c6ece07a9a885650aa6607b0ebfdf6fc9a3ef8691c44b5e724e4eee7bf2/pip-7.1.0.tar.gz
[[email protected] ~]# tar xf pip-7.1.0.tar.gz
[[email protected] ~]# cd pip-7.1.0
[[email protected] pip-7.1.0]# python setup.py install
[[email protected] pip-7.1.0]# pip install --upgrade pip #升级pip
[[email protected] pip-7.1.0]# pip install pillow
10,测试pip,如果报错“pkg_resources.DistributionNotFound: The ‘pip==7.1.2‘ distribution was not found and is required by the application”,此时需要修改pip可执行程序:
[[email protected] ~]# mv /usr/bin/pip /usr/bin/pip0
[[email protected] ~]# cp /usr/bin/pip2.7 /usr/bin/pip
二、安装seafile
1、安装seafile依赖包
[[email protected] ~]# yum -y install python-imaging mysql mysql-server mysql-devel libjpeg-turbo-devel python-devel
[[email protected] ~]# pip install MySQL-python
3、启动MySQL,设置MySQL root账户的密码为root,并创建seafile数据库和seafile用户
[[email protected] ~]# /etc/init.d/mysqld start
[[email protected] ~]# mysqladmin -u root password "root"
[[email protected] ~]# mysql -uroot -proot
create database seafile;
create database ccnet;
create database seahub;
grant all on seafile.* to ‘seafile‘@‘localhost‘ identified by ‘seafile‘;
grant all on ccnet.* TO ‘seafile‘@‘localhost‘;
grant all on seahub.* TO ‘seafile‘@‘localhost‘;
flush privileges;
2、下载安装seafile
[[email protected] ~]# wget --no-check-certificate http://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_6.2.4_x86-64.tar.gz
[[email protected] ~]# tar xf seafile-server_6.2.4_x86-64.tar.gz
[[email protected] ~]# cd seafile-server-6.2.4/
[[email protected] seafile-server-6.2.4]# ./setup-seafile-mysql.sh
3、安装时提示"libc.so.6: version `GLIBC_2.14‘ not found",原因是系统的glibc版本太低,软件编译时使用了较高版本的glibc引起的
[[email protected] ~]# strings /lib64/libc.so.6 | grep GLIBC_ #查看系统glibc支持的版本
[[email protected] ~]# rpm -qa | grep glibc #查看安装的glibc包的版本
[[email protected] ~]# wget http://mirrors.ustc.edu.cn/gnu/libc/glibc-2.14.tar.gz
[[email protected] ~]# tar xf glibc-2.14.tar.gz
[[email protected] glibc-2.14]# mkdir build
[[email protected] glibc-2.14]# cd build/
[[email protected] glibc-2.14]# ../configure --disable-sanity-checks
[[email protected] glibc-2.14]# make -j4 #-j4提高make时的速度(建议不加-j参数)
[[email protected] glibc-2.14]# make install