归档文章 (2011-2017)

date
2017/06/01
环境:CentOS 7

一、安装 mariadb (二进制版)

安装依赖
yum install -y libaio-devel
解压
cd /usr/local/ tar -zxf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz ln -s /usr/local/mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mysql cd mysql
新建 mysql 用户
groupadd mysql && \ useradd -g mysql -M -s /sbin/nologin mysql
安装初始化
cd /usr/local/mysql && \ ./scripts/mysql_install_db --user=mysql chown -R root . && chown -R mysql data
支持命令行运行
export PATH=$PATH:/usr/local/mysql/bin/ && \ echo 'export PATH=$PATH:/usr/local/mysql/bin/' >> .bashrc
开机启动
cp support-files/mysql.server /etc/init.d/mysql && \ chkconfig --add mysql && \ service mysql start
密码及安全设置
/usr/local/mysql/bin/mysqladmin -u root password '新密码' && \ /usr/local/mysql/bin/mysql_secure_installation
解决中文乱码
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf && \ vim /etc/my.cnf
vim /etc/mysql/conf.d/mariadb.cnf [client] ... default-character-set=utf8 ... [mysql] ... default-character-set=utf8 ... [mysqld] ... character-set-server = utf8 collation-server = utf8_general_ci character_set_server = utf8 collation_server = utf8_general_ci ...

二、安装 Seafile

2.1 安装依赖

python2.7
yum -y install python-setuptools python-imaging MySQL-python python-memcached python-ldap python-urllib3
安装 JRE
yum -y install java-1.7.0-openjdk
安装 pdf 全文搜索依赖
yum -y install poppler-utils
安装 Python 库
easy_install pip pip install boto requests

2.2 安装 seafile

准备 seafile
mkdir -p seafile mv seafile-pro-server_* seafile cd seafile tar -xzf seafile-pro-server_* mkdir installed mv seafile-pro-server_* installed
安装 seafile
cd seafile-pro-server-* && \ ./setup-seafile-mysql.sh Cloud cloud.youdomain.com /opt/seafile/seafile-data 8082 1 localhost 3306 seafile seafile_ccnet seafile_db seafile_seahub

3.3 配置 seafile

vim /home/seafile/conf/ccnet.conf SERVICE_URL = https://cloud.youdomain.com
vim /home/seafile/conf/seahub_settings.py FILE_SERVER_ROOT = 'https://cloud.dmfy.gov.cn/seafhttp'
vim /home/seafile/conf/seafdav.conf [WEBDAV] enabled = true port = 8080 fastcgi = true share_name = /seafdav
运行
cd /home/seafile/seafile-server-latest ./seafile.sh start && ./seahub.sh start-fastcgi

3.4 在线预览

yum -y install libreoffice libreoffice-headless libreoffice-pyuno yum -y install poppler-utils
/home/seafile/seafile-server-latest/seafile.sh restart /home/seafile/seafile-server-latest/seahub.sh stop /home/seafile/seafile-server-latest/seahub.sh start-fastcgi

3.5 自定义CSS

mkdir /opt/seafile/seahub-data/custom ln -s /opt/seafile/seahub-data/custom /opt/seafile/seafile-server-latest/seahub/media/custom
Seafile 参考文档:
对于本文内容有任何疑问, 可与我联系.