目录
环境:CentOS 7
一、安装 mariadb (二进制版)
安装依赖
shell
yum install -y libaio-devel解压
shell
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 用户
shell
groupadd mysql && \
useradd -g mysql -M -s /sbin/nologin mysql安装初始化
shell
cd /usr/local/mysql && \
./scripts/mysql_install_db --user=mysql
chown -R root . && chown -R mysql data支持命令行运行
shell
export PATH=$PATH:/usr/local/mysql/bin/ && \
echo 'export PATH=$PATH:/usr/local/mysql/bin/' >> .bashrc开机启动
shell
cp support-files/mysql.server /etc/init.d/mysql && \
chkconfig --add mysql && \
service mysql start密码及安全设置
shell
/usr/local/mysql/bin/mysqladmin -u root password '新密码' && \
/usr/local/mysql/bin/mysql_secure_installation解决中文乱码
shell
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf && \
vim /etc/my.cnf
shell
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
...官方文档:Installing MariaDB using APT
二、安装 Seafile
2.1 安装依赖
python2.7
bash
yum -y install python-setuptools python-imaging MySQL-python python-memcached python-ldap python-urllib3安装 JRE
bash
yum -y install java-1.7.0-openjdk 安装 pdf 全文搜索依赖
bash
yum -y install poppler-utils安装 Python 库
bash
easy_install pip
pip install boto requests2.2 安装 seafile
准备 seafile
bash
mkdir -p seafile
mv seafile-pro-server_* seafile
cd seafile
tar -xzf seafile-pro-server_*
mkdir installed
mv seafile-pro-server_* installed安装 seafile
bash
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_seahub3.3 配置 seafile
bash
vim /home/seafile/conf/ccnet.conf
SERVICE_URL = https://cloud.youdomain.com
bash
vim /home/seafile/conf/seahub_settings.py
FILE_SERVER_ROOT = 'https://cloud.dmfy.gov.cn/seafhttp'
bash
vim /home/seafile/conf/seafdav.conf
[WEBDAV]
enabled = true
port = 8080
fastcgi = true
share_name = /seafdav运行
bash
cd /home/seafile/seafile-server-latest
./seafile.sh start && ./seahub.sh start-fastcgi3.4 在线预览
bash
yum -y install libreoffice libreoffice-headless libreoffice-pyuno
yum -y install poppler-utils
bash
/home/seafile/seafile-server-latest/seafile.sh restart
/home/seafile/seafile-server-latest/seahub.sh stop
/home/seafile/seafile-server-latest/seahub.sh start-fastcgi3.5 自定义CSS
bash
mkdir /opt/seafile/seahub-data/custom
ln -s /opt/seafile/seahub-data/custom /opt/seafile/seafile-server-latest/seahub/media/customSeafile 参考文档: