{"id":162,"date":"2020-12-10T23:17:37","date_gmt":"2020-12-10T15:17:37","guid":{"rendered":"http:\/\/blog.goodshub.com.cn\/?p=162"},"modified":"2022-04-12T17:26:13","modified_gmt":"2022-04-12T09:26:13","slug":"linux-%e4%b8%8b%e9%83%a8%e7%bd%b2-seafile-%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/blog.qutongbuluo.cn\/index.php\/2020\/12\/10\/linux-%e4%b8%8b%e9%83%a8%e7%bd%b2-seafile-%e6%9c%8d%e5%8a%a1%e5%99%a8\/","title":{"rendered":"Linux \u4e0b\u90e8\u7f72 Seafile \u670d\u52a1\u5668"},"content":{"rendered":"\n<p>\u4f7f\u7528\u5b89\u88c5\u811a\u672c\u5728CentOS 7 \u4e0a\u5feb\u901f\u5b89\u88c5<\/p>\n\n\n\n<p> 1\u3001\u5b89\u88c5\u4f9d\u8d56 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install python3 python3-setuptools python3-pip -y\n\nyum -y install epel-release\nrpm --import http:\/\/li.nux.ro\/download\/nux\/RPM-GPG-KEY-nux.ro\n\nyum -y install python-imaging MySQL-python python-memcached python-ldap python-urllib3 ffmpeg ffmpeg-devel\n\npip3 install pillow moviepy\npip3 install mysqlclient\n\n\n\u5b89\u88c5jdk1.8\n\n\u547d\u4ee4\uff1ayum install -y java-1.8.0-openjdk.x86_64\n\n\u5b89\u88c5seahub\u4f9d\u8d56\nyum install python python-setuptools MySQL-python python-urllib3 python-ldap -y\n\npip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy psd-tools django-pylibmc django-simple-captcha\n\n#\u5b89\u88c5office\u9884\u89c8\u63d2\u4ef6\nsudo yum install libreoffice libreoffice-headless libreoffice-pyuno poppler-utils\n\n#\u5b89\u88c5\u5b57\u4f53\u6587\u4ef6\nsudo yum install wqy-microhei-fonts wqy-zenhei-fonts wqy-unibit-fonts -y<\/code><\/pre>\n\n\n\n<p>2\u3001\u5b89\u88c5\u5b9d\u5854\u9762\u677f<\/p>\n\n\n\n<p>yum install -y wget &amp;&amp; wget -O install.sh http:\/\/download.bt.cn\/install\/install_6.0.sh &amp;&amp; sh install.sh<\/p>\n\n\n\n<p>3\u3001\u4e0b\u8f7d\u4e0e\u4e0a\u4f20\u5b89\u88c5\u6587\u4ef6<\/p>\n\n\n\n<p>\u4e0b\u8f7d\uff1ahttps:\/\/download.seafile.top\/d\/8c29766a64d24122936f\/<\/p>\n\n\n\n<p>\u4e0a\u4f20\u6587\u4ef6\u5e76\u89e3\u538b tar  -zxvf  seafile-pro-server_7.1.9_x86-64.tar.gz <\/p>\n\n\n\n<p>4\u3001\u6267\u884c\u5b89\u88c5<\/p>\n\n\n\n<p> \u8fd0\u884c.\/setup-seafile-mysql.sh <\/p>\n\n\n\n<p>Checking python on this machine \u2026<br>\n  Checking python module: python-mysqldb \u2026 Done.<\/p>\n\n\n\n<p>Checking for java \u2026Done.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>This script will guide you to setup your seafile server using MySQL.<br>\nMake sure you have read seafile server manual at<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    https:&#47;&#47;github.com\/haiwen\/seafile\/wiki<\/code><\/pre>\n\n\n\n<p>Press ENTER to continue  \u6b64\u5904\u56de\u8f66\u5373\u53ef<\/p>\n\n\n\n<p>What is the name of the server? It will be displayed on the client.<br>\n3 &#8211; 15 letters or digits<br>\n[ server name ] \u4f60\u7684\u7ad9\u70b9\u540d\u79f0\uff0c\u968f\u610f\u586b\u5199<br>\nWhat is the ip or domain of the server?<br>\nFor example: www.mycompany.com, 192.168.1.101<br>\n[ This server&#8217;s ip or domain ] \u4f60\u7684\u57df\u540d\u6216\u8005\u672c\u673aIP<br>\nWhere do you want to put your seafile data?<br>\nPlease use a volume with enough free space<br>\n[ default &#8220;\/opt\/seafile\/seafile-data&#8221; ] \u9ed8\u8ba4\u56de\u8f66<br>\nWhich port do you want to use for the seafile fileserver?<\/p>\n\n\n\n<p>[ default &#8220;8082&#8221; ] \u9ed8\u8ba4\u56de\u8f66<\/p>\n\n\n\n<p>Please choose a way to initialize seafile databases:<\/p>\n\n\n\n<p>[1] Create new ccnet\/seafile\/seahub databases<br>\n[2] Use existing ccnet\/seafile\/seahub databases<br>\n[ 1 or 2 ] 1<br>\nWhat is the host of mysql server?<br>\n[ default &#8220;localhost&#8221; ] \u9ed8\u8ba4\u56de\u8f66<br>\nWhat is the port of mysql server?<br>\n[ default &#8220;3306&#8221; ] \u9ed8\u8ba4\u56de\u8f66<br>\nWhat is the password of the mysql root user?<br>\n[ root password ] \u8f93\u5165root\u5bc6\u7801<br>\nverifying password of user root \u2026  done<br>\nEnter the name for mysql user of seafile. It would be created if not exists.<br>\n[ default &#8220;seafile&#8221; ] \u9ed8\u8ba4\u56de\u8f66<br>\nEnter the password for mysql user &#8220;seafile&#8221;:<br>\n[ password for seafile ] \u8bbe\u7f6e\u6570\u636e\u5e93\u7528\u6237seafile\u7684\u5bc6\u7801<br>\nEnter the database name for ccnet-server:<br>\n[ default &#8220;ccnet-db&#8221; ] \u9ed8\u8ba4\u56de\u8f66<br>\nEnter the database name for seafile-server:<br>\n[ default &#8220;seafile-db&#8221; ] \u9ed8\u8ba4\u56de\u8f66<br>\nEnter the database name for seahub:<\/p>\n\n\n\n<p>[ default &#8220;seahub-db&#8221; ] \u9ed8\u8ba4\u56de\u8f66<\/p>\n\n\n\n<p>This is your configuration<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server name:            seafile\nserver ip\/domain:       192.168.2.81\n\nseafile data dir:       \/opt\/seafile\/seafile-data\nfileserver port:        8082\n\ndatabase:               create new\nccnet database:         ccnet-db\nseafile database:       seafile-db\nseahub database:        seahub-db\ndatabase user:          seafile<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Press ENTER to continue, or Ctrl-C to abort<\/p>\n\n\n\n<p>\u6b64\u5904\u7ee7\u7eed\u56de\u8f66<br>\nGenerating ccnet configuration \u2026<\/p>\n\n\n\n<p>done<br>\nSuccessly create configuration dir \/opt\/seafile\/ccnet.<br>\nGenerating seafile configuration \u2026<\/p>\n\n\n\n<p>Done.<br>\ndone<br>\nGenerating seahub configuration \u2026<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Now creating ccnet database tables \u2026<\/p>\n\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p>Now creating seafile database tables \u2026<\/p>\n\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p>Now creating seahub database tables \u2026<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>creating seafile-server-latest symbolic link \u2026  done<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Your seafile server configuration has been finished successfully.<\/p>\n\n\n\n<p>run seafile server:     .\/seafile.sh { start | stop | restart }<br>\nrun seahub  server:     .\/seahub.sh  { start  | stop | restart  }<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>If you are behind a firewall, remember to allow input\/output of these tcp ports:<\/p>\n\n\n\n<p>port of seafile fileserver:   8082<br>\nport of seahub:               8000<\/p>\n\n\n\n<p>When problems occur, Refer to<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    https:&#47;&#47;github.com\/haiwen\/seafile\/wiki<\/code><\/pre>\n\n\n\n<p>for information.<br> \u81f3\u6b64\u5b89\u88c5\u5b8c\u6210<\/p>\n\n\n\n<p>5\u3001\u542f\u52a8\u5e76\u914d\u7f6e\u7ba1\u7406\u5458<\/p>\n\n\n\n<p>\u521b\u5efa\u7528\u6237<\/p>\n\n\n\n<p>useradd &#8211;system &#8211;comment &#8220;seafile&#8221; seafile &#8211;create-home &#8211;home-dir  \/home\/seafile<\/p>\n\n\n\n<p>\u4fee\u6539\u76ee\u5f55\u6743\u9650<\/p>\n\n\n\n<p>chown -R seafile.seafile \/opt\/seafile<\/p>\n\n\n\n<p>\u5207\u6362seafile\u7528\u6237\u6267\u884c\u542f\u52a8<\/p>\n\n\n\n<p>sudo -u seafile    *\/seafile-server-latest\/seafile.sh start<\/p>\n\n\n\n<p>\u542f\u52a8seahub\uff0c\u4f1a\u63d0\u793a\u8ba9\u4f60\u521b\u5efa\u7ba1\u7406\u5458\u7528\u6237\uff0c\u5b89\u88c5\u63d0\u793a\u521b\u5efa<\/p>\n\n\n\n<p>sudo -u seafile    *\/seafile-server-latest\/seahub.sh start<\/p>\n\n\n\n<p>\u914d\u7f6e\u53cd\u5411\u4ee3\u7406<\/p>\n\n\n\n<p>server {<br>     listen 80;<br>     server_name 8.130.30.60;<br>     proxy_set_header X-Forwarded-For $remote_addr;<br>     location \/ {<br>          proxy_pass         http:\/\/127.0.0.1:8000;<br>          proxy_set_header   Host $host;<br>          proxy_set_header   X-Real-IP $remote_addr;<br>          proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;<br>          proxy_set_header   X-Forwarded-Host $server_name;<br>          proxy_read_timeout  1200s;<br>          # used for view\/edit office file via Office Online Server<br>          client_max_body_size 0;<br>          access_log  \/www\/wwwlogs\/8.130.30.60.log;<br>          error_log  \/www\/wwwlogs\/8.130.30.60.error.log;<br>     }<\/p>\n\n\n\n<p>location \/seafhttp {<br>     rewrite ^\/seafhttp(.*)$ $1 break;<br>     proxy_pass http:\/\/127.0.0.1:8082;<br>     client_max_body_size 0;<br>     proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;<br>     proxy_connect_timeout  36000s;<br>     proxy_read_timeout  36000s;<br>     proxy_send_timeout  36000s;<br>     send_timeout  36000s;<br> }<br> location \/media {<br>     root \/opt\/seafile-server-latest\/seahub;#\u91cd\u8981<br> }<br> }<\/p>\n\n\n\n<p>Centos\u8bbe\u7f6e \u5f00\u673a\u81ea\u542f\u53c2\u7167\u5982\u4e0b<br>\n\u7f16\u8f91\/etc\/systemd\/system\/seafile.service\uff0c\u53ef\u4ee5\u4f7f\u7528\u901a\u8fc7\u5b9d\u5854\u56fe\u5f62\u5316\u754c\u9762\u7f16\u8f91<\/p>\n\n\n\n<p>vi  \/etc\/systemd\/system\/seafile.service<br>\n\u628a\u5982\u4e0b\u590d\u5236\u8fdb\u53bb\uff0c\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8c03\u6574\u542f\u52a8\u7528\u6237\u548c\u5b89\u88c5\u76ee\u5f55<\/p>\n\n\n\n<p>[Unit]<br>\nDescription=Seafile Server<\/p>\n\n\n\n<p>\u5982\u679c\u7528\u7684\u662fmysql\u4e0d\u662fmariadb\uff0c\u5219\u628a\u201cmariadb.service\u201d \u6539\u6210 &#8220;mysql.service&#8221;<\/p>\n\n\n\n<p>After=network.target remote-fs.target  mysql.service<\/p>\n\n\n\n<p>[Service]<\/p>\n\n\n\n<p>\u542f\u52a8\u811a\u672c\u76ee\u5f55<\/p>\n\n\n\n<p>ExecStart=\/opt\/seafile\/seafile-server-latest\/seafile.sh start<br>\nExecStop=\/opt\/seafile\/seafile-server-latest\/seafile.sh stop<\/p>\n\n\n\n<p>\u542f\u52a8\u7528\u6237<\/p>\n\n\n\n<p>User=root<br> Group=root<br> LimitNOFILE=infinity<br> Type=oneshot<br> RemainAfterExit=yes<\/p>\n\n\n\n<p>[Install]<br> WantedBy=multi-user.target <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><br> \u518d\u7f16\u8f91\/etc\/systemd\/system\/seahub.service\uff0c\u53ef\u4ee5\u4f7f\u7528\u901a\u8fc7\u5b9d\u5854\u56fe\u5f62\u5316\u754c\u9762\u7f16\u8f91<\/p>\n\n\n\n<p>vi  \/etc\/systemd\/system\/seahub.service<br>\n\u628a\u5982\u4e0b\u590d\u5236\u8fdb\u53bb\uff0c\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8c03\u6574\u542f\u52a8\u7528\u6237\u548c\u5b89\u88c5\u76ee\u5f55<\/p>\n\n\n\n<p>[Unit]<br>\nDescription=Seafile Seahub<br>\nAfter=network.target seafile.service<\/p>\n\n\n\n<p>[Service]<br> ExecStart=\/opt\/seafile\/seafile-server-latest\/seahub.sh start<br> ExecStop=\/opt\/seafile\/seafile-server-latest\/seahub.sh stop<br> User=root<br> Group=root<br> Type=oneshot<br> RemainAfterExit=yes<\/p>\n\n\n\n<p>[Install]<br>\nWantedBy=multi-user.target<br>\n\u6dfb\u52a0\u5230\u5f00\u673a\u81ea\u542f<\/p>\n\n\n\n<p>systemctl enable seafile<br>\nsystemctl enable seahub<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528\u5b89\u88c5\u811a\u672c\u5728CentOS 7 \u4e0a\u5feb\u901f\u5b89\u88c5 1\u3001\u5b89\u88c5\u4f9d\u8d56 2\u3001\u5b89\u88c5\u5b9d\u5854\u9762\u677f yum install -y wg &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.qutongbuluo.cn\/index.php\/2020\/12\/10\/linux-%e4%b8%8b%e9%83%a8%e7%bd%b2-seafile-%e6%9c%8d%e5%8a%a1%e5%99%a8\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cLinux \u4e0b\u90e8\u7f72 Seafile \u670d\u52a1\u5668\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-162","post","type-post","status-publish","format-standard","hentry","category-qy"],"_links":{"self":[{"href":"https:\/\/blog.qutongbuluo.cn\/index.php\/wp-json\/wp\/v2\/posts\/162"}],"collection":[{"href":"https:\/\/blog.qutongbuluo.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qutongbuluo.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qutongbuluo.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qutongbuluo.cn\/index.php\/wp-json\/wp\/v2\/comments?post=162"}],"version-history":[{"count":10,"href":"https:\/\/blog.qutongbuluo.cn\/index.php\/wp-json\/wp\/v2\/posts\/162\/revisions"}],"predecessor-version":[{"id":312,"href":"https:\/\/blog.qutongbuluo.cn\/index.php\/wp-json\/wp\/v2\/posts\/162\/revisions\/312"}],"wp:attachment":[{"href":"https:\/\/blog.qutongbuluo.cn\/index.php\/wp-json\/wp\/v2\/media?parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qutongbuluo.cn\/index.php\/wp-json\/wp\/v2\/categories?post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qutongbuluo.cn\/index.php\/wp-json\/wp\/v2\/tags?post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}