{"id":199,"date":"2017-11-13T23:34:06","date_gmt":"2017-11-13T15:34:06","guid":{"rendered":"https:\/\/damogame.cn\/?p=199"},"modified":"2017-11-13T23:34:06","modified_gmt":"2017-11-13T15:34:06","slug":"seafile-server%e5%ae%89%e8%a3%85%e6%89%8b%e5%86%8c","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/199","title":{"rendered":"\u00a0Seafile server\u5b89\u88c5\u624b\u518c"},"content":{"rendered":"<div class=\"showHead\">\n<div class=\"showTitleBOx\">\n<div class=\"showTitle\"><img decoding=\"async\" src=\"http:\/\/blog.51cto.com\/image\/skin\/artType01.jpg\" \/>\u00a0Seafile server\u5b89\u88c5\u624b\u518c<\/div>\n<\/div>\n<p><span class=\"artTime\">2015-08-24 15:13:47<\/span><\/div>\n<div class=\"showTags\">\u6807\u7b7e\uff1a<a class=\"operlink\" href=\"http:\/\/blog.51cto.com\/tag-%E6%9C%8D%E5%8A%A1%E5%99%A8.html\" target=\"_blank\" rel=\"noopener\">\u670d\u52a1\u5668<\/a>\u00a0<a class=\"operlink\" href=\"http:\/\/blog.51cto.com\/tag-server.html\" target=\"_blank\" rel=\"noopener\">server<\/a>\u00a0<a class=\"operlink\" href=\"http:\/\/blog.51cto.com\/tag-%E8%AE%BE%E8%AE%A1%E5%85%AC%E5%8F%B8.html\" target=\"_blank\" rel=\"noopener\">\u8bbe\u8ba1\u516c\u53f8<\/a><\/div>\n<div class=\"CopyrightStatement lh22\">\u539f\u521b\u4f5c\u54c1\uff0c\u5141\u8bb8\u8f6c\u8f7d\uff0c\u8f6c\u8f7d\u65f6\u8bf7\u52a1\u5fc5\u4ee5\u8d85\u94fe\u63a5\u5f62\u5f0f\u6807\u660e\u6587\u7ae0\u00a0<a href=\"http:\/\/liuliheng.blog.51cto.com\/7948095\/1687660\" target=\"_blank\" rel=\"noopener\">\u539f\u59cb\u51fa\u5904<\/a>\u00a0\u3001\u4f5c\u8005\u4fe1\u606f\u548c\u672c\u58f0\u660e\u3002\u5426\u5219\u5c06\u8ffd\u7a76\u6cd5\u5f8b\u8d23\u4efb\u3002<a href=\"http:\/\/liuliheng.blog.51cto.com\/7948095\/1687660\">http:\/\/liuliheng.blog.51cto.com\/7948095\/1687660<\/a><\/div>\n<div class=\"showContent\">\n<p><a name=\"OLE_LINK2\"><\/a><a name=\"OLE_LINK1\"><\/a>Seafile server\u5b89\u88c5\u624b\u518c<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u90e8\u7f72 Seafile \u670d\u52a1\u5668\uff08\u4f7f\u7528 MySQL\uff09<\/strong><\/p>\n<p>\u5230http:\/\/www.seafile.com\/download\u4e0b\u8f7d\u6700\u65b0\u7684\u670d\u52a1\u5668\u5b89\u88c5\u5305.<\/p>\n<p><strong>\u90e8\u7f72\u548c\u76ee\u5f55\u8bbe\u8ba1<\/strong><\/p>\n<p>\u516c\u53f8\u7684\u540d\u79f0\u4e3a&#8221;kaiqigu&#8221;,\u4f60\u4e5f\u5df2\u7ecf\u4e0b\u8f7dseafile-server_1.4.0_x86-64.tar.gz \u5230\u4f60\u7684home \u76ee\u5f55\u4e0b\u3002 \u5728\u8fd9\u91cc\u5efa\u8bae\u8fd9\u6837\u7684\u76ee\u5f55\u7ed3\u6784:<\/p>\n<p>mkdir kaiqigu<\/p>\n<p>mv seafile-server_1.4.0_x86-64.tar.gz kaiqigu<\/p>\n<p>#\u5c06 seafile-server_1.4.0_x86-64.tar.gz \u79fb\u52a8\u5230 kaiqigu \u76ee\u5f55\u4e0b\u540e<\/p>\n<p>cd kaiqigu<\/p>\n<p>tar -xzf seafile-server_1.4.0_x86-64.tar.gz<\/p>\n<p>mkdir installed<\/p>\n<p>mv seafile-server_1.4.0_x86-64.tar.gz installed<\/p>\n<p>\u73b0\u5728\uff0c\u4f60\u7684\u76ee\u5f55\u770b\u8d77\u6765\u5e94\u8be5\u50cf\u8fd9\u6837\uff1a<\/p>\n<p># kaiqigu<\/p>\n<p>\u251c\u2500\u2500 installed<\/p>\n<p>\u2502\u00a0\u00a0 \u2514\u2500\u2500 seafile-server_1.4.0_x86-64.tar.gz<\/p>\n<p>\u2514\u2500\u2500 seafile-server-1.4.0<\/p>\n<p>\u251c\u2500\u2500reset-admin.sh<\/p>\n<p>\u251c\u2500\u2500 runtime<\/p>\n<p>\u251c\u2500\u2500 seafile<\/p>\n<p>\u251c\u2500\u2500 seafile.sh<\/p>\n<p>\u251c\u2500\u2500 seahub<\/p>\n<p>\u251c\u2500\u2500 seahub.sh<\/p>\n<p>\u251c\u2500\u2500setup-seafile.sh<\/p>\n<p>\u2514\u2500\u2500 upgrade<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>\u8fd9\u6837\u8bbe\u8ba1\u76ee\u5f55\u7684\u597d\u5904\u5728\u4e8e<\/strong><\/p>\n<p>1\uff1a\u548c seafile \u76f8\u5173\u7684\u914d\u7f6e\u6587\u4ef6\u90fd\u53ef\u4ee5\u653e\u5728 kaiqigu \u76ee\u5f55\u4e0b\uff0c\u4fbf\u4e8e\u96c6\u4e2d\u7ba1\u7406.<\/p>\n<p>&nbsp;<\/p>\n<p>2\uff1a\u540e\u7eed\u5347\u7ea7\u65f6,\u4f60\u53ea\u9700\u8981\u89e3\u538b\u6700\u65b0\u7684\u5b89\u88c5\u5305\u5230&#8221;kaiqigu&#8221;\u76ee\u5f55\u4e0b.<\/p>\n<p>&nbsp;<\/p>\n<p><em>\u8fd9\u6837\u4f60\u53ef\u4ee5\u91cd\u7528&#8221;kaiqigu&#8221;\u76ee\u5f55\u4e0b\u5df2\u7ecf\u5b58\u5728\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u800c\u4e0d\u7528\u91cd\u65b0\u914d\u7f6e<\/em>.<\/p>\n<p><strong>\u5b89\u88c5 Seafile \u670d\u52a1\u5668<\/strong><\/p>\n<p><strong>\u5b89\u88c5\u524d\u7684\u51c6\u5907\u5de5\u4f5c<\/strong><\/p>\n<h3>\u7cfb\u7edf\u8d26\u53f7\u8bbe\u7f6e<\/h3>\n<p>\u5b89\u88c5\u597d CentOS 6.5 \u7684\u57fa\u672c\u670d\u52a1\u5668\uff0c\u9996\u5148\u9700\u8981\u8bbe\u7f6e\u63a5\u4e0b\u6765\u4f1a\u4f7f\u7528\u5230\u7684 admin \u7cfb\u7edf\u8d26\u53f7\uff0c\u5e76\u8bbe\u7f6e\u597d ssh \u7684\u516c\u94a5\u767b\u5f55\uff0c\u65b9\u4fbf\u63a5\u4e0b\u6765\u7684\u90e8\u7f72\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u4f7f\u7528 root \u8d26\u53f7\u767b\u5f55\uff08\u6216\u8005\uff0c\u5177\u6709 root \u6743\u9650\u7684\u8d26\u53f7\uff09\u767b\u5f55\u540e\uff0c\u4e3a\u786e\u4fdd sudo \u5df2\u7ecf\u5b89\u88c5\u4e86\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u5982\u679c\u63d0\u793a\u5df2\u7ecf\u5b89\u88c5\uff0c\u5219\u65e0\u9700\u4efb\u4f55\u64cd\u4f5c\uff0c\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u5219\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p># yum install sudo<\/p>\n<p>&nbsp;<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u521b\u5efa admin \u7cfb\u7edf\u8d26\u53f7\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p># useradd admin<\/p>\n<p># mkdir \/home\/admin\/.ssh<\/p>\n<p># chown admin:admin \/home\/admin\/.ssh\/<\/p>\n<p># chmod 0700 \/home\/admin\/.ssh\/<\/p>\n<p>&nbsp;<\/p>\n<p>\u7136\u540e\uff0c\u5728 .ssh \u76ee\u5f55\u4e2d\u6784\u5efa authorized_keys \u6587\u4ef6\uff0c\u65b9\u5f0f\u4e0d\u9650\uff0c\u4f7f\u7528 vi \u6216\u8005 echo \u90fd\u884c\uff0c\u4e4b\u540e\uff0c\u518d\u8bbe\u7f6e\u597d authorized_keys \u6587\u4ef6\u7684\u6240\u6709\u8005\u548c\u5c5e\u6027\uff0c\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n<p># cd \/home\/admin\/.ssh<\/p>\n<p># echo &#8220;xxxxxxx(\u516c\u94a5\u5185\u5bb9)&#8221;&gt; authorized_keys<\/p>\n<p># chown admin:admin authorized_keys<\/p>\n<p># chmod 0600 authorized_keys<\/p>\n<p>\u4e3a\u65b9\u4fbf\u63a5\u4e0b\u6765\u7684\u64cd\u4f5c\uff0c\u8d4b\u4e88 admin \u7528\u6237 sudo \u7684\u6743\u9650\uff1a<\/p>\n<p># echo &#8220;admin ALL=(ALL) NOPASSWD:ALL&#8221;&gt;&gt; \/etc\/sudoers<\/p>\n<h3>\u66f4\u65b0\u7cfb\u7edf\u8f6f\u4ef6\u5305<\/h3>\n<p>\u7528 admin \u8d26\u53f7\u767b\u5f55\u540e\uff0c\u4f7f\u7528 yum \u673a\u5236\u5b89\u88c5\u6240\u9700\u7528\u5230\u7684\u8f6f\u4ef6\u5305\uff1a<\/p>\n<p>$ sudo su<\/p>\n<p># yum install epel-release<\/p>\n<p># yum install zlib-devel bzip2-devel ncurses-developenssl-devel<\/p>\n<p># yum install make gcc-c++ cmake bison-devel<\/p>\n<p># yum install swig patch sqlite-devel readlinereadline-devel<\/p>\n<p># yum install rsync nload<\/p>\n<h3>\u5efa\u7acb\u81ea\u7528\u76ee\u5f55<\/h3>\n<p># chown admin:admin \/data<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ee5 admin \u8d26\u6237\u767b\u5f55\uff0c\u6267\u884c<\/p>\n<p>&nbsp;<\/p>\n<p>$ cd \/data<\/p>\n<p>$ mkdir soft<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>\u5b89\u88c5Seafile \u670d\u52a1\u5668\u4e4b\u524d\uff0c\u8bf7\u786e\u8ba4\u5df2\u5b89\u88c5\u4ee5\u4e0b\u8f6f\u4ef6<\/strong><\/p>\n<p>l\u00a0\u00a0Nginx<\/p>\n<p>l\u00a0\u00a0MySQL server<\/p>\n<p>l\u00a0\u00a0Python2.7<\/p>\n<p>&nbsp;<\/p>\n<p>Web Server\u00a0\u90e8\u5206<\/p>\n<p>\u8be5\u90e8\u5206\u5185\u5bb9\uff0c\u9002\u7528\u4e8e\u9700\u8981\u5b89\u88c5 nginx \u7684 Web Server \u670d\u52a1\u5668\u4e0a\uff0c\u4e0d\u9700\u8981\u5b89\u88c5 nginx \u7684\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u5ffd\u7565\u3002<\/p>\n<p>\u5728\u6ca1\u6709\u7279\u6b8a\u9700\u6c42\u7684\u60c5\u51b5\u4e0b\uff0c\u91c7\u7528 nginx \u5b98\u65b9\u53d1\u5e03\u7684\u9884\u7f16\u8bd1\u7248\u672c\u8fdb\u884c\u5b89\u88c5\uff0c\u65b9\u4fbf\u5c06\u6765\u7684\u5347\u7ea7\u7ef4\u62a4\uff08\u9700\u8981\u8bbf\u95ee\u5916\u7f51\uff09\uff1a<\/p>\n<p>$ cd \/data\/soft<\/p>\n<p>$ wgethttp:\/\/nginx.org\/packages\/centos\/6\/noarch\/RPMS\/nginx-release-centos-6-0.el6.ngx.noarch.rpm<\/p>\n<p>$ sudo yum installnginx-release-centos-6-0.el6.ngx.noarch.rpm<\/p>\n<p>\u5b89\u88c5\u4e86 nginx \u8f6f\u4ef6\u4ed3\u5e93\u540e\uff0c\u6dfb\u52a0\u7684\u6587\u4ef6\u4e3a\uff1a<\/p>\n<p><strong>\/etc\/yum.repos.d\/nginx.repo<\/strong><\/p>\n<p><strong>\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-nginx<\/strong><\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p>\u7d27\u63a5\u7740\u5b89\u88c5 nginx:<\/p>\n<p>&nbsp;<\/p>\n<p>$ sudo yum install nginx<\/p>\n<p>&nbsp;<\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u76f8\u5173\u7684\u76ee\u5f55\u548c\u6587\u4ef6\u6709\uff1a<\/p>\n<p>\/etc\/rc.d\/init.d\/nginx#\u00a0\u81ea\u542f\u52a8\u811a\u672c<\/p>\n<p>\/usr\/sbin\/nginx<\/p>\n<p>\/etc\/nginx\/#\u00a0\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55<\/p>\n<p>\/var\/log\/nginx\/#\u00a0\u9ed8\u8ba4\u7684\u65e5\u5fd7\u76ee\u5f55<\/p>\n<p>\/var\/run\/nginx.pid<\/p>\n<p>\/var\/run\/nginx.lock<\/p>\n<p>\/var\/cache\/nginx\/#\u00a0\u76f8\u5173\u4e34\u65f6\u6587\u4ef6\u76ee\u5f55<\/p>\n<p><strong>\u7ba1\u7406 nginx \uff1a(\u542f\u52a8\u3001\u91cd\u542f\u3001\u505c\u6b62\u548c\u914d\u7f6e\u6d4b\u8bd5)<\/strong><\/p>\n<p># service nginx start<\/p>\n<p># service nginx restart<\/p>\n<p># service nginx stop<\/p>\n<p># service nginx configtest<\/p>\n<p>&nbsp;<\/p>\n<h3>DB Server\u00a0\u90e8\u5206<\/h3>\n<p>\u5982\u65e0\u7279\u6b8a\u5e94\u7528\uff0c\u4f7f\u7528 centos \u9ed8\u8ba4\u7684 mysql-server \uff08\u7248\u672c\u4e3a 5.1.73\uff09\u5b89\u88c5\u5373\u53ef\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>$ sudo su<\/p>\n<p># yum install mysql-server<\/p>\n<p>&nbsp;<\/p>\n<p>\u542f\u52a8 mysql<\/p>\n<p>&nbsp;<\/p>\n<p># service mysqld start<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539 root \u8d26\u53f7\u5bc6\u7801<\/p>\n<p>&nbsp;<\/p>\n<p># \/usr\/bin\/mysqladmin -u root password&#8217;new-password&#8217;<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539mysql\u6570\u636e\u5b58\u653e\u76ee\u5f55<\/p>\n<p>&nbsp;<\/p>\n<p># \/etc\/rc.d\/init.d\/mysqld stop<\/p>\n<p>&nbsp;<\/p>\n<p># cd \/var\/lib<\/p>\n<p>&nbsp;<\/p>\n<p># cp -a mysql\/ \/data\/<\/p>\n<p>&nbsp;<\/p>\n<p># vim \/etc\/my.cnf<\/p>\n<p>\u4fee\u6539datadir=\/var\/lib\/mysql\u4e3adatadir=\/data\/mysql<\/p>\n<p>\u6ce8\u91ca\u6389socket=\/var\/lib\/mysql\/mysql.sock\u4e00\u884c\uff0c\u6dfb\u52a0socket=\/data\/mysql\/mysql.sock<\/p>\n<p>&nbsp;<\/p>\n<p># vim \/etc\/rc.d\/init.d\/mysqld<\/p>\n<p>\u6ce8\u91ca\u6389datadir=&#8221;$result&#8221;\u6dfb\u52a0datadir=&#8221;\/data\/mysql&#8221;<\/p>\n<p>&nbsp;<\/p>\n<p># vim \/usr\/bin\/mysqld_safe<\/p>\n<p>\u4fee\u6539DATADIR=&#8221;\/var\/lib\/mysql&#8221;\u4e3aDATADIR=&#8221;\/data\/mysql&#8221;<\/p>\n<p>&nbsp;<\/p>\n<p>\u5efa\u7acb\u4e00\u4e2amysql.sock\u7684\u94fe\u63a5<\/p>\n<p>&nbsp;<\/p>\n<p># ln -s \/data\/mysql\/mysql.sock\/var\/lib\/mysql\/mysql.sock<\/p>\n<p>&nbsp;<\/p>\n<p># \/etc\/rc.d\/init.d\/mysqld start<\/p>\n<p>&nbsp;<\/p>\n<p>\u8fdb\u5165mysql\u67e5\u770b\u6570\u636e\u76ee\u5f55<\/p>\n<p>sudo mysql -uroot -p xxx<\/p>\n<p>mysql&gt;show variables like &#8216;%dir%&#8217;;<\/p>\n<p>&nbsp;<\/p>\n<p>\u67e5\u770bdatadir\u76ee\u5f55\u662f\u5426\u4e3a\/data\/mysql<\/p>\n<h3>Python Server\u00a0\u90e8\u5206<\/h3>\n<p>\u8be5\u90e8\u5206\u5185\u5bb9\uff0c\u9002\u7528\u9700\u8981\u5b89\u88c5 Python \u6765\u8dd1\u6e38\u620f\u540e\u7aef\u5e94\u7528\u7684\u670d\u52a1\u5668\uff0c\u4e0d\u9700\u8981\u5b89\u88c5 Python \u7684\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u5ffd\u7565\u3002<\/p>\n<p>CentOS6.5\u00a0\u9ed8\u8ba4\u5b89\u88c5\u7684\u662f Python 2.6.6 \uff0c\u6211\u4eec\u9700\u8981 2.7.x \u7cfb\u5217\u7684\uff0c\u5c24\u5176\u662f 2.7.8 \u4ee5\u4e0a\u7684\uff0c\u8fd0\u884c\u6240\u9700\u5185\u5b58\u964d\u4e86\u5f88\u591a\u3002\u6240\u4ee5\uff0c\u9009\u62e9\u624b\u52a8\u7f16\u8bd1\u5b89\u88c5 Python2.7.8 \u3002<\/p>\n<p>\u5728\u6709\u4e92\u8054\u7f51\u516c\u7f51\u8fde\u63a5\u7684\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528 admin \u8d26\u53f7\u6267\u884c\u5982\u4e0b\u64cd\u4f5c\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u7f16\u8bd1\u5b89\u88c5 Python:<\/p>\n<p>$ cd \/data\/soft<\/p>\n<p>$ wgethttps:\/\/www.python.org\/ftp\/python\/2.7.10\/Python-2.7.10.tgz<\/p>\n<p>$ tar xzvf Python-2.7.10.tgz<\/p>\n<p>$ cd Python-2.7.10<\/p>\n<p>$ .\/configure &#8211;prefix=\/usr\/local<\/p>\n<p>$ make<\/p>\n<p>$ sudo make install<\/p>\n<p>&nbsp;<\/p>\n<p>\u5b89\u88c5 setuptools<\/p>\n<p>$ cd \/data\/soft<\/p>\n<p>$ wgethttps:\/\/pypi.python.org\/packages\/source\/s\/setuptools\/setuptools-15.2.tar.gz<\/p>\n<p>$ tar xzvf setuptools-15.2.tar.gz<\/p>\n<p>$ cd setuptools-15.2<\/p>\n<p>$ sudo \/usr\/local\/bin\/python2.7 setup.pyinstall<\/p>\n<p>iPython<\/p>\n<p>\u5b89\u88c5 pip<\/p>\n<p>$ wgethttps:\/\/pypi.python.org\/packages\/source\/p\/pip\/pip-6.1.1.tar.gz<\/p>\n<p>$ tar xzvf pip-6.1.1.tar.gz<\/p>\n<p>$ cd pip-6.1.1<\/p>\n<p>$ sudo \/usr\/local\/bin\/python2.7 setup.pyinstall<\/p>\n<p>\u4f7f\u7528 pip \u5b89\u88c5\u5269\u4f59\u7684\u9700\u8981\u7684\u7ec4\u4ef6<\/p>\n<p>$ sudo su<\/p>\n<p># \/usr\/local\/bin\/pip2.7 install redis<\/p>\n<p># \/usr\/local\/bin\/pip2.7 install M2Crypto<\/p>\n<p># \/usr\/local\/bin\/pip2.7 installbackports.ssl_match_hostname<\/p>\n<p># \/usr\/local\/bin\/pip2.7 install greenlet<\/p>\n<p># \/usr\/local\/bin\/pip2.7 installopenpyxl==1.7.0<\/p>\n<p>&nbsp;<\/p>\n<p># \/usr\/local\/bin\/pip2.7 install pysqlite<\/p>\n<p># \/usr\/local\/bin\/pip2.7 install readline<\/p>\n<p>&nbsp;<\/p>\n<p># \/usr\/local\/bin\/pip2.7 install tornadogevent psutil supervisor<\/p>\n<p># \/usr\/local\/bin\/pip2.7 install ipython<\/p>\n<p>\u5728\u6ca1\u6709\u4e92\u8054\u7f51\u516c\u7f51\u8fde\u63a5\u7684\u60c5\u51b5\uff0c\u9700\u8981\u5148\u5728\u80fd\u8054\u7f51\u7684\u673a\u5668\u4e0a\u5728 pypi.python.org \u7f51\u7ad9\u4e0a\u5c06\u4ee5\u4e0a\u8f6f\u4ef6\u7684\u6e90\u7801\u5305\u90fd\u4e0b\u8f7d\u4e0b\u6765\uff0c\u7136\u540e\uff0c\u590d\u5236\u8fc7\u6765\uff0c\u9010\u4e2a\u89e3\u538b\uff0c\u5e76\u901a\u8fc7\u8fd0\u884c setup.py \u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<h3>\u5b89\u88c5 MySQL-python<\/h3>\n<p>Python\u8bbf\u95ee MySQL \u6570\u636e\u5e93\uff0c\u9700\u8981\u5b89\u88c5\u76f8\u5e94\u7684\u5ba2\u6237\u7aef\u8f6f\u4ef6\u5305\uff0c\u901a\u5e38\u4f1a\u4f7f\u7528MySQL-python \u8fd9\u4e2a\u8f6f\u4ef6\u5305\uff0c\u800c\u8fd9\u4e2a\u5305\uff0c\u9700\u8981 mysql \u7684\u5f00\u53d1\u6587\u4ef6\u3002<\/p>\n<p>\u53ef\u4ee5\u91c7\u7528\u5982\u4e0b\u7684\u6b65\u9aa4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<p># yum install mysql-devel<\/p>\n<p># \/usr\/local\/bin\/pip2.7 installMySQL-python<\/p>\n<h3>\u5b89\u88c5\u00a0Imaging<\/h3>\n<p># wget http:\/\/effbot.org\/downloads\/Imaging-1.1.7.tar.gz<\/p>\n<p># tar -xzvf Imaging-1.1.7.tar.gz<\/p>\n<p># cd Imaging-1.1.7<\/p>\n<p># \/usr\/local\/bin\/python2.7 setup.pyinstall<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u5b89\u88c5<\/strong><strong>seafile-server-4.1.2<\/strong><\/p>\n<p>cdseafile-server-4.1.2<\/p>\n<p>.\/setup-seafile-mysql.sh\u00a0 #\u8fd0\u884c\u5b89\u88c5\u811a\u672c\u5e76\u56de\u7b54\u9884\u8bbe\u95ee\u9898<\/p>\n<p>\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u4e2d\u6ca1\u6709\u5b89\u88c5\u4e0a\u9762\u7684\u67d0\u4e2a\u8f6f\u4ef6\uff0c\u90a3\u4e48 Seafile\u521d\u59cb\u5316\u811a\u672c\u4f1a\u63d0\u9192\u4f60\u5b89\u88c5\u76f8\u5e94\u7684\u8f6f\u4ef6\u5305.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"padding: 0px; margin: 0px; vertical-align: top; border: 1px solid #dddddd; background: url('\/e\/u261\/lang\/zh-cn\/images\/localimage.png') center center no-repeat;\" src=\"http:\/\/liuliheng.blog.51cto.com\/e\/u261\/themes\/default\/images\/spacer.gif\" alt=\"spacer.gif\" width=\"614\" height=\"612\" \/><\/p>\n<p>\u8be5\u811a\u672c\u4f1a\u4f9d\u6b21\u8be2\u95ee\u4f60\u4e00\u4e9b\u95ee\u9898\uff0c\u4ece\u800c\u4e00\u6b65\u6b65\u5f15\u5bfc\u4f60\u914d\u7f6e Seafile \u7684\u5404\u9879\u53c2\u6570<img loading=\"lazy\" decoding=\"async\" style=\"padding: 0px; margin: 0px; vertical-align: top; border: 1px solid #dddddd; background: url('\/e\/u261\/lang\/zh-cn\/images\/localimage.png') center center no-repeat;\" src=\"http:\/\/liuliheng.blog.51cto.com\/e\/u261\/themes\/default\/images\/spacer.gif\" alt=\"spacer.gif\" width=\"550\" height=\"472\" \/><\/p>\n<p>\u5728\u8fd9\u91cc, \u4f60\u4f1a\u88ab\u8981\u6c42\u9009\u62e9\u4e00\u79cd\u521b\u5efa Seafile \u6570\u636e\u5e93\u7684\u65b9\u5f0f:<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Please choose a way toinitialize seafile databases:<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>&nbsp;<\/p>\n<p>[1] Create newccnet\/seafile\/seahub databases<\/p>\n<p>[2] Use existingccnet\/seafile\/seahub databases<\/p>\n<p>\u5177\u4f53\u9009\u62e9\u54ea\u9879, \u53d6\u51b3\u4e8e\u4f60\u662f\u5426\u62e5\u6709\u6839\u5bc6\u7801.<\/p>\n<p>l\u00a0\u00a0\u5982\u679c\u9009\u62e91, \u4f60\u9700\u8981\u63d0\u4f9b\u6839\u5bc6\u7801. \u811a\u672c\u7a0b\u5e8f\u4f1a\u521b\u5efa\u6570\u636e\u5e93\u548c\u7528\u6237\u3002<\/p>\n<p>l\u00a0\u00a0\u5982\u679c\u9009\u62e92,ccnet\/seafile\/seahub \u6570\u636e\u5e93\u5e94\u8be5\u5df2\u7ecf\u88ab\u4f60\uff08\u6216\u8005\u5176\u4ed6\u4eba\uff09\u63d0\u524d\u521b\u5efa\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u5982\u679c\u9009\u62e9 [1] Create new ccnet\/seafile\/seahub databases,\u4f60\u4f1a\u88ab\u95ee\u4e09\u4e2a\u95ee\u9898:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"padding: 0px; margin: 0px; vertical-align: top; border: 1px solid #dddddd; background: url('\/e\/u261\/lang\/zh-cn\/images\/localimage.png') center center no-repeat;\" src=\"http:\/\/liuliheng.blog.51cto.com\/e\/u261\/themes\/default\/images\/spacer.gif\" alt=\"spacer.gif\" width=\"548\" height=\"555\" \/><img loading=\"lazy\" decoding=\"async\" style=\"padding: 0px; margin: 0px; vertical-align: top; border: 1px solid #dddddd; background: url('\/e\/u261\/lang\/zh-cn\/images\/localimage.png') center center no-repeat;\" src=\"http:\/\/liuliheng.blog.51cto.com\/e\/u261\/themes\/default\/images\/spacer.gif\" alt=\"spacer.gif\" width=\"553\" height=\"360\" \/><\/p>\n<p>\u5982\u679c\u4f60\u9009\u62e9[2] Use existing ccnet\/seafile\/seahub databases,<\/p>\n<p>\u4f60\u4f1a\u88ab\u95ee\u5230\u5982\u4e0b\u4e09\u4e2a\u95ee\u9898:<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"padding: 0px; margin: 0px; vertical-align: top; border: 1px solid #dddddd; background: url('\/e\/u261\/lang\/zh-cn\/images\/localimage.png') center center no-repeat;\" src=\"http:\/\/liuliheng.blog.51cto.com\/e\/u261\/themes\/default\/images\/spacer.gif\" alt=\"spacer.gif\" width=\"549\" height=\"467\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"padding: 0px; margin: 0px; vertical-align: top; border: 1px solid #dddddd; background: url('\/e\/u261\/lang\/zh-cn\/images\/localimage.png') center center no-repeat;\" src=\"http:\/\/liuliheng.blog.51cto.com\/e\/u261\/themes\/default\/images\/spacer.gif\" alt=\"spacer.gif\" width=\"555\" height=\"344\" \/>\u5982\u679c\u5b89\u88c5\u6b63\u786e\u5b8c\u6210\uff0c\u4f60\u4f1a\u770b\u5230\u4e0b\u9762\u8fd9\u6837\u7684\u8f93\u51fa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"padding: 0px; margin: 0px; vertical-align: top; border: 1px solid #dddddd; background: url('\/e\/u261\/lang\/zh-cn\/images\/localimage.png') center center no-repeat;\" src=\"http:\/\/liuliheng.blog.51cto.com\/e\/u261\/themes\/default\/images\/spacer.gif\" alt=\"spacer.gif\" width=\"512\" height=\"254\" \/><\/p>\n<p>\u73b0\u5728\u4f60\u7684\u76ee\u5f55\u7ed3\u6784\u770b\u8d77\u6765\u5e94\u8be5\u662f\u8fd9\u6837:<\/p>\n<p>#treehaiwen -L 2<\/p>\n<p>haiwen<\/p>\n<p>\u251c\u2500\u2500ccnet\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # configuration files<\/p>\n<p>\u2502\u00a0\u00a0 \u251c\u2500\u2500 ccnet.conf<\/p>\n<p>\u2502\u00a0\u00a0 \u251c\u2500\u2500 mykey.peer<\/p>\n<p>\u2502\u00a0\u00a0 \u251c\u2500\u2500 PeerMgr<\/p>\n<p>\u2502\u00a0\u00a0 \u2514\u2500\u2500 seafile.ini<\/p>\n<p>\u251c\u2500\u2500installed<\/p>\n<p>\u2502\u00a0\u00a0 \u2514\u2500\u2500seafile-server_1.8.2_x86-64.tar.gz<\/p>\n<p>\u251c\u2500\u2500seafile-data<\/p>\n<p>\u2502\u00a0\u00a0 \u2514\u2500\u2500 seafile.conf<\/p>\n<p>\u251c\u2500\u2500seafile-server-1.8.2\u00a0 # active version<\/p>\n<p>\u2502\u00a0\u00a0 \u251c\u2500\u2500 reset-admin.sh<\/p>\n<p>\u2502\u00a0\u00a0 \u251c\u2500\u2500 runtime<\/p>\n<p>\u2502\u00a0\u00a0 \u251c\u2500\u2500 seafile<\/p>\n<p>\u2502\u00a0\u00a0 \u251c\u2500\u2500 seafile.sh<\/p>\n<p>\u2502\u00a0\u00a0 \u251c\u2500\u2500 seahub<\/p>\n<p>\u2502\u00a0\u00a0 \u251c\u2500\u2500 seahub.sh<\/p>\n<p>\u2502\u00a0\u00a0 \u251c\u2500\u2500 setup-seafile.sh<\/p>\n<p>\u2502\u00a0\u00a0 \u2514\u2500\u2500 upgrade<\/p>\n<p>\u251c\u2500\u2500seafile-server-latest\u00a0 # symbolic link toseafile-server-1.8.2<\/p>\n<p>\u251c\u2500\u2500seahub-data<\/p>\n<p>\u2502\u00a0\u00a0 \u2514\u2500\u2500 avatars<\/p>\n<p>\u251c\u2500\u2500seahub_settings.py\u00a0\u00a0 # optional configfile<\/p>\n<p>\u2514\u2500\u2500seahub_settings.pyc<\/p>\n<p>seafile-server-latest\u6587\u4ef6\u5939\u4e3a\u6307\u5411\u5f53\u524dSeafile \u670d\u52a1\u5668\u6587\u4ef6\u5939\u7684\u7b26\u53f7\u94fe\u63a5. \u5c06\u6765\u4f60\u5347\u7ea7\u5230\u65b0\u7248\u672c\u540e,\u5347\u7ea7\u811a\u672c\u4f1a\u81ea\u52a8\u66f4\u65b0\u4f7f\u5176\u59cb\u7ec8\u6307\u5411\u6700\u65b0\u7684 Seafile \u670d\u52a1\u5668\u6587\u4ef6\u5939..<\/p>\n<p><strong>\u542f\u52a8 Seafile \u670d\u52a1\u5668\u548c Seahub \u7f51\u7ad9<\/strong><\/p>\n<p>\u5728 seafile-server-1.8.2 \u76ee\u5f55\u4e0b\uff0c\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4<\/p>\n<p>\u542f\u52a8 Seafile:<\/p>\n<p>.\/seafile.shstart #\u00a0\u542f\u52a8 Seafile \u670d\u52a1<\/p>\n<p>\u542f\u52a8 Seahub<\/p>\n<p>.\/seahub.shstart &lt;port&gt;\u00a0 #\u00a0\u542f\u52a8 Seahub \u7f51\u7ad9 \uff08\u9ed8\u8ba4\u8fd0\u884c\u57288000\u7aef\u53e3\u4e0a\uff09<\/p>\n<p><strong>\u5c0f\u8d34\u58eb:<\/strong>\u4f60\u7b2c\u4e00\u6b21\u542f\u52a8 seahub \u65f6\uff0cseahub.sh\u811a\u672c\u4f1a\u63d0\u793a\u4f60\u521b\u5efa\u4e00\u4e2aseafile \u7ba1\u7406\u5458\u5e10\u53f7\u3002<\/p>\n<p>\u670d\u52a1\u542f\u52a8\u540e, \u6253\u5f00\u6d4f\u89c8\u5668\u5e76\u8f93\u5165\u4ee5\u4e0b\u5730\u5740<\/p>\n<p>http:\/\/192.168.1.111:8000\/<\/p>\n<p>\u4f60\u4f1a\u88ab\u91cd\u5b9a\u5411\u5230\u767b\u9646\u9875\u9762. \u8f93\u5165\u4f60\u5728\u5b89\u88c5 Seafile \u65f6\u63d0\u4f9b\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u540e\uff0c\u4f60\u4f1a\u8fdb\u5165 Myhome \u9875\u9762\uff0c\u65b0\u5efa\u8d44\u6599\u5e93.<\/p>\n<p><strong>\u606d\u559c!<\/strong>\u73b0\u5728\u4f60\u5df2\u7ecf\u6210\u529f\u7684\u5b89\u88c5\u4e86 Seafile \u670d\u52a1\u5668.<\/p>\n<p><strong>\u5728\u53e6\u4e00\u7aef\u53e3\u4e0a\u8fd0\u884c Seahub<\/strong><\/p>\n<p>\u5982\u679c\u4f60\u4e0d\u60f3\u5728\u9ed8\u8ba4\u7684 8000 \u7aef\u53e3\u4e0a\u8fd0\u884c Seahub, \u800c\u662f\u60f3\u81ea\u5b9a\u4e49\u7aef\u53e3\uff08\u6bd4\u59828001\uff09\u4e2d\u8fd0\u884c\uff0c\u8bf7\u6309\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c:<\/p>\n<p>\u5173\u95ed Seafile \u670d\u52a1\u5668<\/p>\n<p>.\/seahub.shstop #\u00a0\u505c\u6b62 Seafile \u8fdb\u7a0b<\/p>\n<p>.\/seafile.shstop #\u00a0\u505c\u6b62 Seahub<\/p>\n<p>\u66f4\u6539haiwen\/ccnet\/ccnet.conf\u6587\u4ef6\u4e2dSERVICE_URL \u7684\u503c(\u5047\u8bbe\u4f60\u7684 ip \u6216\u8005\u57df\u540d\u65f6192.168.1.100),\u5982\u4e0b:<\/p>\n<p>SERVICE_URL = http:\/\/192.168.1.100:8001<\/p>\n<p>\u91cd\u542f Seafile \u670d\u52a1\u5668<\/p>\n<p>.\/seafile.sh start #\u00a0\u542f\u52a8 Seafile \u670d\u52a1<\/p>\n<p>.\/seahub.sh start 8001 #\u00a0\u542f\u52a8 Seahub \u7f51\u7ad9\uff08\u8fd0\u884c\u57288001\u7aef\u53e3\u4e0a\uff09<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u5173\u95ed\/\u91cd\u542f Seafile \u548c Seahub<\/strong><\/p>\n<p>\u5173\u95ed<\/p>\n<p>.\/seahub.sh stop #\u00a0\u505c\u6b62 Seahub<\/p>\n<p>.\/seafile.sh stop #\u00a0\u505c\u6b62 Seafile \u8fdb\u7a0b<\/p>\n<p>\u91cd\u542f<\/p>\n<p>.\/seafile.sh restart #\u00a0\u505c\u6b62\u5f53\u524d\u7684 Seafile \u8fdb\u7a0b\uff0c\u7136\u540e\u91cd\u542f Seafile<\/p>\n<p>.\/seahub.sh restart\u00a0#\u00a0\u505c\u6b62\u5f53\u524d\u7684 Seahub \u8fdb\u7a0b\uff0c\u5e76\u5728 8000 \u7aef\u53e3\u91cd\u65b0\u542f\u52a8 Seahub<\/p>\n<p><strong>\u5982\u679c\u505c\u6b62\/\u91cd\u542f\u7684\u811a\u672c\u8fd0\u884c\u5931\u8d25<\/strong><\/p>\n<p>\u5927\u591a\u6570\u60c5\u51b5\u4e0b seafile.sh seahub.sh \u811a\u672c\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\u3002\u5982\u679c\u9047\u5230\u95ee\u9898\uff1a<\/p>\n<p>\u4f7f\u7528pgrep\u547d\u4ee4\u68c0\u67e5 seafile\/seahub \u8fdb\u7a0b\u662f\u5426\u8fd8\u5728\u8fd0\u884c\u4e2d<\/p>\n<p>pgrep -f seafile-controller #\u00a0\u67e5\u770b Seafile \u8fdb\u7a0b<\/p>\n<p>pgrep -f &#8220;manage.py run_gunicorn&#8221; #\u00a0\u67e5\u770b Seahub \u8fdb\u7a0b<\/p>\n<p>&nbsp;<\/p>\n<p>\u4f7f\u7528pkill\u547d\u4ee4\u6740\u6389\u76f8\u5173\u8fdb\u7a0b<\/p>\n<p>pkill -f seafile-controller #\u00a0\u7ed3\u675f Seafile \u8fdb\u7a0b<\/p>\n<p>pkill -f &#8220;manage.py run_gunicorn&#8221; #\u00a0\u7ed3\u675f Seafile \u8fdb\u7a0b<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>\u5907\u4efd\u6b65\u9aa4<\/strong><\/p>\n<p>\u4f60\u6240\u6709\u7684\u8d44\u6599\u5e93\u6570\u636e\u90fd\u5b58\u50a8\u5728 kaiqigu\u76ee\u5f55\u3002<\/p>\n<p>Seafile\u00a0\u4e5f\u5728\u6570\u636e\u5e93\u4e2d\u5b58\u50a8\u4e00\u4e9b\u91cd\u8981\u7684\u5143\u6570\u636e\u3002\u6570\u636e\u5e93\u7684\u547d\u540d\u548c\u5b58\u50a8\u8def\u5f84\u53d6\u51b3\u4e8e\u4f60\u6240\u4f7f\u7528\u7684\u6570\u636e\u5e93\u3002<\/p>\n<p>\u5bf9\u4e8e MySQL, \u6570\u636e\u5e93\u7531\u7ba1\u7406\u5458\u6765\u521b\u5efa\uff0c\u6240\u4ee5\u4e0d\u540c\u7684\u4eba\u90e8\u7f72\uff0c\u53ef\u80fd\u4f1a\u6709\u4e0d\u540c\u7684\u6587\u4ef6\u540d\u3002\u5927\u4f53\u800c\u8a00\uff0c\u6709\u5982\u4e0b\u4e09\u4e2a\u6570\u636e\u5e93\u4f1a\u88ab\u521b\u5efa:<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ccnet-db:\u5305\u542b\u7528\u6237\u548c\u7fa4\u7ec4\u4fe1\u606f<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0seafile-db:\u5305\u542b\u8d44\u6599\u5e93\u5143\u6570\u636e\u4fe1\u606f<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0seahub.db:\u5305\u542b\u7f51\u7ad9\u524d\u7aef\uff08seahub\uff09\u6240\u7528\u5230\u7684\u6570\u636e\u5e93\u8868\u4fe1\u606f<\/p>\n<p>&nbsp;<\/p>\n<p>\u5907\u4efd\u9700\u8981\u5982\u4e0b\u4e09\u6b65\uff1a<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u53ef\u9009\u6b65: \u5982\u679c\u4f60\u9009\u62e9 SQLite \u4f5c\u4e3a\u6570\u636e\u5e93\uff0c\u9996\u5148\u505c\u6389 Seafile \u670d\u52a1\u5668\uff1b\u3010\u8fd9\u91cc\u4e0d\u4ecb\u7ecdSQLite\u6570\u636e\u5e93\u5907\u4efd\u3011<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5907\u4efd\u6570\u636e\u5e93\uff1b<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5907\u4efd\u5b58\u653e Seafile \u6570\u636e\u7684\u76ee\u5f55\uff1b<\/p>\n<p>\u8fd9\u91cc\u5047\u8bbe\u4f60\u7684 Seafile \u6570\u636e\u4f4d\u4e8e\u00a0\/data\/kaiqigu\u76ee\u5f55\u4e0b\uff0c\u5e76\u4e14\u4f60\u60f3\u5c06\u5176\u5907\u4efd\u5230\u00a0\/backup\u76ee\u5f55\uff08\/backup\u76ee\u5f55\u53ef\u4ee5\u662f NFS\uff08\u7f51\u7edc\u6587\u4ef6\u7cfb\u7edf\uff09\uff0c\u53ef\u4ee5\u662f\u53e6\u4e00\u53f0\u673a\u5668\u7684 Windows \u5171\u4eab\uff0c\u6216\u8005\u662f\u5916\u90e8\u78c1\u76d8\uff09\u3002\u8bf7\u5728\/backup\u76ee\u5f55\u4e0b\u521b\u5efa\u5982\u4e0b\u76ee\u5f55\u7ed3\u6784\uff1a<\/p>\n<p>\/backup<\/p>\n<p>&#8212;-databases\/\u00a0\u00a0\u5305\u542b\u6570\u636e\u5e93\u5907\u4efd<\/p>\n<p>&#8212;-data\/\u00a0\u00a0\u5305\u542b Seafile \u6570\u636e\u5907\u4efd<\/p>\n<p><strong>\u5907\u4efd\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u8fd9\u91cc\u5efa\u8bae\u4f60\u6bcf\u6b21\u5c06\u6570\u636e\u5e93\u5907\u4efd\u5230\u53e6\u4e00\u4e2a\u5355\u72ec\u6587\u4ef6\uff0c\u5e76\u4e14\u4e0d\u8981\u8986\u76d6\u6700\u8fd1\u4e00\u5468\u6765\u5907\u4efd\u8fc7\u7684\u65e7\u6570\u636e\u5e93\u6587\u4ef6\u3002<\/p>\n<p><strong>MySQL<\/strong><\/p>\n<p>\u5047\u8bbe\u4f60\u7684\u6570\u636e\u5e93\u540d\u5206\u522b\u4e3accnet-db,\u00a0seafile-db\u548c\u00a0seahub-db\u3002mysqldump\u4f1a\u81ea\u52a8\u9501\u4f4f\u8868\uff0c\u6240\u4ee5\u5728\u4f60\u5907\u4efd MySql \u6570\u636e\u5e93\u7684\u65f6\u5019\uff0c\u4e0d\u9700\u8981\u505c\u6389 Seafile \u670d\u52a1\u5668\u3002\u901a\u5e38\u56e0\u4e3a\u6570\u636e\u5e93\u8868\u975e\u5e38\u5c0f\uff0c\u6240\u4ee5\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5907\u4efd\u4e0d\u4f1a\u82b1\u592a\u957f\u65f6\u95f4\u3002<\/p>\n<p>Mysqldump-h[mysqlhost] -u[username] -p[password] &#8211;opt ccnet-db &gt;\/backup\/databases\/ccnet-db.sql.`date +&#8221;%Y-%m-%d-%H-%M-%S&#8221;`<\/p>\n<p>&nbsp;<\/p>\n<p>mysqldump-h [mysqlhost] -u[username] -p[password] &#8211;opt seafile-db &gt;\/backup\/databases\/seafile-db.sql.`date +&#8221;%Y-%m-%d-%H-%M-%S&#8221;`<\/p>\n<p>&nbsp;<\/p>\n<p>mysqldump-h [mysqlhost] -u[username] -p[password] &#8211;opt seahub-db &gt;\/backup\/databases\/seahub-db.sql.`date +&#8221;%Y-%m-%d-%H-%M-%S&#8221;`<\/p>\n<p><strong>\u5907\u4efd Seafile \u8d44\u6599\u5e93\u6570\u636e<\/strong><\/p>\n<p>\u7531\u4e8e\u6240\u6709\u7684\u6570\u636e\u6587\u4ef6\u90fd\u5b58\u50a8\u5728\u00a0\/data\/kaiqigu\u76ee\u5f55, \u5907\u4efd\u6574\u4e2a\u76ee\u5f55\u5373\u53ef\u3002\u4f60\u53ef\u4ee5\u76f4\u63a5\u62f7\u8d1d\u6574\u4e2a\u76ee\u5f55\u5230\u5907\u4efd\u76ee\u5f55\uff0c\u6216\u8005\u4f60\u4e5f\u53ef\u4ee5\u7528 rsync \u505a\u589e\u91cf\u5907\u4efd\u3002<\/p>\n<p>\u76f4\u63a5\u62f7\u8d1d\u6574\u4e2a\u6570\u636e\u76ee\u5f55\uff0c<\/p>\n<p>cp-R \/data\/kaiqigu \/backup\/data\/kaiqigu-`date +&#8221;%Y-%m-%d-%H-%M-%S&#8221;`<\/p>\n<p>\u8fd9\u6837\u6bcf\u6b21\u90fd\u4f1a\u4ea7\u751f\u4e00\u4e2a\u65b0\u7684\u5907\u4efd\u6587\u4ef6\u5939\uff0c\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5220\u6389\u65e7\u7684\u5907\u4efd\u3002\u5982\u679c\u4f60\u6709\u5f88\u591a\u6570\u636e\uff0c\u62f7\u8d1d\u6574\u4e2a\u6570\u636e\u76ee\u5f55\u4f1a\u82b1\u5f88\u591a\u65f6\u95f4\uff0c\u8fd9\u65f6\u4f60\u53ef\u4ee5\u7528rsync\u505a\u589e\u91cf\u5907\u4efd\u3002<\/p>\n<p>rsync-az \/data\/kaiqigu \/backup\/data<\/p>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u6570\u636e\u5907\u4efd\u5230\u00a0\/backup\/data\/kaiqigu\u4e0b\u3002<\/p>\n<p><strong>\u8ba9\u62f7\u8d1d\u548c rsync \u8fc7\u7a0b\u6210\u529f\u7ed3\u675f\u662f\u975e\u5e38\u91cd\u8981\u7684\uff0c\u5426\u5219\u4f60\u6700\u8fd1\u7684\u4e00\u4e9b\u6570\u636e\u5c06\u4f1a\u4e22\u5931\u3002<\/strong><\/p>\n<p>\u6ce8\u610f: \u56e0\u4e3a\u00a0ccnet\/ccnet.conf\u6587\u4ef6\u4e2d\u7684 ID \u503c\u5fc5\u987b\u548c\u00a0ccnet\/mykey.peer\u4e2d\u503c\u7684 SHA1 \u503c\u4fdd\u6301\u4e00\u81f4\u3002\u6240\u4ee5\u4e0d\u8981\u5fd8\u8bb0\u62f7\u8d1d\u00a0ccnet\/mykey.peer\u6587\u4ef6\u3002<\/p>\n<p><strong>\u6062\u590d\u5907\u4efd<\/strong><\/p>\n<p>\u5982\u679c\u4f60\u5f53\u524d\u7684 Seafile \u670d\u52a1\u5668\u5df2\u7ecf\u574f\u6389\uff0c\u5c06\u4f7f\u7528\u53e6\u4e00\u53f0\u673a\u5668\u6765\u63d0\u4f9b\u670d\u52a1\uff0c\u9700\u8981\u6062\u590d\u6570\u636e:<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5047\u8bbe\u5728\u65b0\u673a\u5668\u4e2d\uff0cSeafile \u4e5f\u88ab\u90e8\u7f72\u5728\u4e86\u00a0\/data\/kaiqigu\u76ee\u5f55\u4e2d\uff0c\u62f7\u8d1d\u00a0\/backup\/data\/kaiqigu\u5230\u65b0\u673a\u5668\u4e2d\u5373\u53ef\u3002<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6062\u590d\u6570\u636e\u5e93\u3002<\/p>\n<p><strong>\u6062\u590d\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u73b0\u5728\u4f60\u5df2\u7ecf\u62e5\u6709\u4e86\u6570\u636e\u5e93\u5907\u4efd\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u6309\u5982\u4e0b\u6b65\u9aa4\u6765\u8fdb\u884c\u6062\u590d\u3002<\/p>\n<p><strong>MySQL<\/strong><\/p>\n<p>mysql -u[username] -p[password] ccnet-db &lt;ccnet-db.sql.2013-10-19-16-00-05<\/p>\n<p>&nbsp;<\/p>\n<p>Mysql-u[username] -p[password] seafile-db &lt;seafile-db.sql.2013-10-19-16-00-20<\/p>\n<p>&nbsp;<\/p>\n<p>mysql -u[username] -p[password]seahub-db.sql.2013-10-19-16-01-05<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0Seafile server\u5b89\u88c5\u624b\u518c <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[117],"class_list":["post-199","post","type-post","status-publish","format-standard","hentry","tag-01-linux"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=199"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/199\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}