SEAFILE:Deploy Server Side on CentOS using MySQL
Seafile的官方下载页面:
https://www.seafile.com/download/
获取安装介质病上传服务器:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[root@seafile ~]# mkdir /software [root@seafile ~]# cd /software/ [root@seafile software]# ls seafile-server_6.2.5_x86-64.tar.gz seafile-server_6.3.3_x86-64.tar.gz [root@seafile software]# [root@seafile software]# tar -xzf seafile-server_6.2.5_x86-64.tar.gz [root@seafile software]# ls seafile-server-6.2.5 seafile-server_6.3.3_x86-64.tar.gz seafile-server_6.2.5_x86-64.tar.gz [root@seafile software]# [root@seafile software]# cd seafile-server-6.2.5/ [root@seafile seafile-server-6.2.5]# ls check_init_admin.py seaf-fuse.sh seahub setup-seafile.sh reset-admin.sh seaf-gc.sh seahub.sh upgrade runtime seafile setup-seafile-mysql.py seaf-fsck.sh seafile.sh setup-seafile-mysql.sh [root@seafile seafile-server-6.2.5]# |
安装:MySQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
[root@seafile ~]# cd /software [root@seafile software]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm --2019-01-13 02:09:11-- http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm Resolving repo.mysql.com (repo.mysql.com)... 23.51.209.162 Connecting to repo.mysql.com (repo.mysql.com)|23.51.209.162|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 6140 (6.0K) [application/x-redhat-package-manager] Saving to: ‘mysql-community-release-el7-5.noarch.rpm’ 100%[======================================>] 6,140 --.-K/s in 0s 2019-01-13 02:09:11 (740 MB/s) - ‘mysql-community-release-el7-5.noarch.rpm’ saved [6140/6140] [root@seafile software]# rpm -ivh mysql-community-release-el7-5.noarch.rpm Preparing... ################################# [100%] Updating / installing... 1:mysql-community-release-el7-5 ################################# [100%] [root@seafile software]# [root@seafile software]# yum install -y mysql-server Loaded plugins: langpacks, product-id, search-disabled-repos, subscription- : manager This system is not registered with an entitlement server. You can use subscription-manager to register. Repository epel is listed more than once in the configuration Repository epel-debuginfo is listed more than once in the configuration Repository epel-source is listed more than once in the configuration base | 3.6 kB 00:00 extras | 3.4 kB 00:00 gitlab-ce | 2.9 kB 00:00 grafana | 2.9 kB 00:00 mongodb-org | 2.9 kB 00:00 updates | 3.4 kB 00:00 (1/7): grafana/primary_db | 18 kB 00:00 (2/7): base/x86_64/group_gz | 166 kB 00:00 (3/7): extras/x86_64/primary_db | 156 kB 00:01 (4/7): mongodb-org/primary_db | 106 kB 00:00 (5/7): updates/x86_64/primary_db | 1.3 MB 00:01 (6/7): gitlab-ce/primary_db | 2.6 MB 00:02 (7/7): base/x86_64/primary_db | 6.0 MB 00:02 Resolving Dependencies --> Running transaction check ---> Package mysql-community-server.x86_64 0:5.6.42-2.el7 will be installed --> Processing Dependency: mysql-community-common(x86-64) = 5.6.42-2.el7 for package: mysql-community-server-5.6.42-2.el7.x86_64 --> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.42-2.el7.x86_64 --> Processing Dependency: perl(Data::Dumper) for package: mysql-community-server-5.6.42-2.el7.x86_64 --> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.42-2.el7.x86_64 --> Running transaction check ---> Package mysql-community-client.x86_64 0:5.6.42-2.el7 will be installed --> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.42-2.el7.x86_64 ---> Package mysql-community-common.x86_64 0:5.6.42-2.el7 will be installed ---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed --> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64 --> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64 ---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed --> Running transaction check ---> Package mariadb-libs.x86_64 1:5.5.60-1.el7_5 will be obsoleted ---> Package mysql-community-libs.x86_64 0:5.6.42-2.el7 will be obsoleting ---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed --> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch --> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch --> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch --> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch --> Running transaction check ---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed --> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch --> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch ---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed --> Running transaction check ---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed ---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: mysql-community-libs x86_64 5.6.42-2.el7 mysql56-community 2.0 M replacing mariadb-libs.x86_64 1:5.5.60-1.el7_5 mysql-community-server x86_64 5.6.42-2.el7 mysql56-community 59 M Installing for dependencies: mysql-community-client x86_64 5.6.42-2.el7 mysql56-community 20 M mysql-community-common x86_64 5.6.42-2.el7 mysql56-community 257 k perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k perl-DBI x86_64 1.627-4.el7 base 802 k perl-Data-Dumper x86_64 2.145-3.el7 base 47 k perl-IO-Compress noarch 2.061-2.el7 base 260 k perl-Net-Daemon noarch 0.48-5.el7 base 51 k perl-PlRPC noarch 0.2020-14.el7 base 36 k Transaction Summary ================================================================================ Install 2 Packages (+9 Dependent packages) Total download size: 82 M Downloading packages: warning: /var/cache/yum/x86_64/7Server/mysql56-community/packages/mysql-community-common-5.6.42-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Public key for mysql-community-common-5.6.42-2.el7.x86_64.rpm is not installed (1/11): mysql-community-common-5.6.42-2.el7.x86_64.rpm | 257 kB 00:01 (2/11): mysql-community-libs-5.6.42-2.el7.x86_64.rpm | 2.0 MB 00:03 (3/11): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm | 32 kB 00:00 (4/11): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm | 57 kB 00:00 (5/11): perl-Data-Dumper-2.145-3.el7.x86_64.rpm | 47 kB 00:00 (6/11): perl-IO-Compress-2.061-2.el7.noarch.rpm | 260 kB 00:00 (7/11): perl-Net-Daemon-0.48-5.el7.noarch.rpm | 51 kB 00:00 (8/11): perl-DBI-1.627-4.el7.x86_64.rpm | 802 kB 00:00 (9/11): perl-PlRPC-0.2020-14.el7.noarch.rpm | 36 kB 00:00 (10/11): mysql-community-client-5.6.42-2.el7.x86_64.rpm | 20 MB 01:07 (11/11): mysql-community-server-5.6.42-2.el7.x86_64.rpm | 59 MB 02:53 -------------------------------------------------------------------------------- Total 474 kB/s | 82 MB 02:58 Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql Importing GPG key 0x5072E1F5: Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>" Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5 Package : mysql-community-release-el7-5.noarch (installed) From : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql Running transaction check Running transaction test Transaction test succeeded Running transaction Warning: RPMDB altered outside of yum. Installing : perl-Data-Dumper-2.145-3.el7.x86_64 1/12 Installing : mysql-community-common-5.6.42-2.el7.x86_64 2/12 Installing : mysql-community-libs-5.6.42-2.el7.x86_64 3/12 Installing : mysql-community-client-5.6.42-2.el7.x86_64 4/12 Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 5/12 Installing : perl-Net-Daemon-0.48-5.el7.noarch 6/12 Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 7/12 Installing : perl-IO-Compress-2.061-2.el7.noarch 8/12 Installing : perl-PlRPC-0.2020-14.el7.noarch 9/12 Installing : perl-DBI-1.627-4.el7.x86_64 10/12 Installing : mysql-community-server-5.6.42-2.el7.x86_64 11/12 Erasing : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 12/12 Verifying : mysql-community-libs-5.6.42-2.el7.x86_64 1/12 Verifying : mysql-community-common-5.6.42-2.el7.x86_64 2/12 Verifying : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 3/12 Verifying : perl-Net-Daemon-0.48-5.el7.noarch 4/12 Verifying : mysql-community-server-5.6.42-2.el7.x86_64 5/12 Verifying : perl-Data-Dumper-2.145-3.el7.x86_64 6/12 Verifying : mysql-community-client-5.6.42-2.el7.x86_64 7/12 Verifying : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 8/12 Verifying : perl-DBI-1.627-4.el7.x86_64 9/12 Verifying : perl-IO-Compress-2.061-2.el7.noarch 10/12 Verifying : perl-PlRPC-0.2020-14.el7.noarch 11/12 Verifying : 1:mariadb-libs-5.5.60-1.el7_5.x86_64 12/12 Installed: mysql-community-libs.x86_64 0:5.6.42-2.el7 mysql-community-server.x86_64 0:5.6.42-2.el7 Dependency Installed: mysql-community-client.x86_64 0:5.6.42-2.el7 mysql-community-common.x86_64 0:5.6.42-2.el7 perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 perl-DBI.x86_64 0:1.627-4.el7 perl-Data-Dumper.x86_64 0:2.145-3.el7 perl-IO-Compress.noarch 0:2.061-2.el7 perl-Net-Daemon.noarch 0:0.48-5.el7 perl-PlRPC.noarch 0:0.2020-14.el7 Replaced: mariadb-libs.x86_64 1:5.5.60-1.el7_5 Complete! [root@seafile software]# |
启动:MySQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
[root@seafile software]# service mysql start Redirecting to /bin/systemctl start mysql.service [root@seafile software]# [root@seafile software]# mysqladmin -u root password "*********" Warning: Using a password on the command line interface can be insecure. [root@seafile software]# [root@seafile software]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.6.42 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+ 3 rows in set (0.00 sec) mysql> |
安装依赖包:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
[root@seafile software]# yum install -y python-imaging MySQL-python Loaded plugins: langpacks, product-id, search-disabled-repos, subscription- : manager This system is not registered with an entitlement server. You can use subscription-manager to register. Repository epel is listed more than once in the configuration Repository epel-debuginfo is listed more than once in the configuration Repository epel-source is listed more than once in the configuration Package python-pillow-2.0.0-19.gitd1c6db8.el7.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package MySQL-python.x86_64 0:1.2.5-1.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: MySQL-python x86_64 1.2.5-1.el7 base 90 k Transaction Summary ================================================================================ Install 1 Package Total download size: 90 k Installed size: 284 k Downloading packages: MySQL-python-1.2.5-1.el7.x86_64.rpm | 90 kB 00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : MySQL-python-1.2.5-1.el7.x86_64 1/1 Verifying : MySQL-python-1.2.5-1.el7.x86_64 1/1 Installed: MySQL-python.x86_64 0:1.2.5-1.el7 Complete! [root@seafile software]# |
安装SEAFILE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
[root@seafile ~]# cd /software [root@seafile software]# ls mysql-community-release-el7-5.noarch.rpm seafile-server_6.2.5_x86-64.tar.gz seafile-server-6.2.5 seafile-server_6.3.3_x86-64.tar.gz [root@seafile software]# [root@seafile software]# cd seafile-server-6.2.5/ [root@seafile seafile-server-6.2.5]# [root@seafile seafile-server-6.2.5]# ls -ltr total 132 drwxrwxr-x 4 root root 4096 Jan 22 2018 upgrade drwxrwxr-x 12 adamhuan adamhuan 4096 Jan 22 2018 seahub -rwxrwxr-x 1 root root 22058 Jan 22 2018 setup-seafile.sh -rwxrwxr-x 1 root root 2604 Jan 22 2018 setup-seafile-mysql.sh -rw-rw-r-- 1 root root 52792 Jan 22 2018 setup-seafile-mysql.py -rwxrwxr-x 1 root root 7751 Jan 22 2018 seahub.sh -rwxrwxr-x 1 root root 5176 Jan 22 2018 seafile.sh -rwxrwxr-x 1 root root 2832 Jan 22 2018 seaf-gc.sh -rwxrwxr-x 1 root root 3325 Jan 22 2018 seaf-fuse.sh -rwxrwxr-x 1 root root 1937 Jan 22 2018 seaf-fsck.sh -rwxrwxr-x 1 root root 1821 Jan 22 2018 reset-admin.sh -rw-rw-r-- 1 root root 11322 Jan 22 2018 check_init_admin.py drwxr-xr-x 2 root root 25 Jan 22 2018 runtime drwxr-xr-x 6 root root 53 Jan 22 2018 seafile [root@seafile seafile-server-6.2.5]# [root@seafile seafile-server-6.2.5]# ./setup-seafile-mysql.sh Checking python on this machine ... Checking python module: setuptools ... Done. Checking python module: python-imaging ... Done. Checking python module: python-mysqldb ... python-mysqldb is not installed, Please install it first. On Debian/Ubuntu: sudo apt-get install python-mysqldb On CentOS/RHEL: sudo yum install MySQL-python Error occured during setup. Please fix possible problems and run the script again. [root@seafile seafile-server-6.2.5]# [root@seafile seafile-server-6.2.5]# ./setup-seafile-mysql.sh Checking python on this machine ... Checking python module: setuptools ... Done. Checking python module: python-imaging ... Done. Checking python module: python-mysqldb ... Done. ----------------------------------------------------------------- This script will guide you to setup your seafile server using MySQL. Make sure you have read seafile server manual at https://github.com/haiwen/seafile/wiki Press ENTER to continue ----------------------------------------------------------------- What is the name of the server? It will be displayed on the client. 3 - 15 letters or digits [ server name ] seafile What is the ip or domain of the server? For example: www.mycompany.com, 192.168.1.101 [ This server's ip or domain ] 192.168.159.130 Where do you want to put your seafile data? Please use a volume with enough free space [ default "/software/seafile-data" ] Which port do you want to use for the seafile fileserver? [ default "8082" ] ------------------------------------------------------- Please choose a way to initialize seafile databases: ------------------------------------------------------- [1] Create new ccnet/seafile/seahub databases [2] Use existing ccnet/seafile/seahub databases [ 1 or 2 ] 1 What is the host of mysql server? [ default "localhost" ] What is the port of mysql server? [ default "3306" ] What is the password of the mysql root user? [ root password ] verifying password of user root ... done Enter the name for mysql user of seafile. It would be created if not exists. [ default "seafile" ] Enter the password for mysql user "seafile": [ password for seafile ] Enter the database name for ccnet-server: [ default "ccnet-db" ] Enter the database name for seafile-server: [ default "seafile-db" ] Enter the database name for seahub: [ default "seahub-db" ] --------------------------------- This is your configuration --------------------------------- server name: seafile server ip/domain: 192.168.159.130 seafile data dir: /software/seafile-data fileserver port: 8082 database: create new ccnet database: ccnet-db seafile database: seafile-db seahub database: seahub-db database user: seafile --------------------------------- Press ENTER to continue, or Ctrl-C to abort --------------------------------- Generating ccnet configuration ... done Successly create configuration dir /software/ccnet. Generating seafile configuration ... Done. done Generating seahub configuration ... ---------------------------------------- Now creating seahub database tables ... ---------------------------------------- creating seafile-server-latest symbolic link ... done ----------------------------------------------------------------- Your seafile server configuration has been finished successfully. ----------------------------------------------------------------- run seafile server: ./seafile.sh { start | stop | restart } run seahub server: ./seahub.sh { start <port> | stop | restart <port> } ----------------------------------------------------------------- If you are behind a firewall, remember to allow input/output of these tcp ports: ----------------------------------------------------------------- port of seafile fileserver: 8082 port of seahub: 8000 When problems occur, Refer to https://github.com/haiwen/seafile/wiki for information. [root@seafile seafile-server-6.2.5]# |
启动SEAFILE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
[root@seafile seafile-server-6.2.5]# netstat -tupln | grep 80 [root@seafile seafile-server-6.2.5]# [root@seafile seafile-server-6.2.5]# ./seafile.sh start [01/13/19 02:25:35] ../common/session.c(132): using config file /software/conf/ccnet.conf Starting seafile server, please wait ... Seafile server started Done. [root@seafile seafile-server-6.2.5]# ./seahub.sh start LC_ALL is not set in ENV, set to en_US.UTF-8 Starting seahub at port 8000 ... ---------------------------------------- It's the first time you start the seafile server. Now let's create the admin account ---------------------------------------- What is the email for the admin account? [ admin email ] dkseven_eli@163.com What is the password for the admin account? [ admin password ] Enter the password again: [ admin password again ] ---------------------------------------- Successfully created seafile admin ---------------------------------------- Seahub is started Done. [root@seafile seafile-server-6.2.5]# [root@seafile seafile-server-6.2.5]# netstat -tupln | grep 80 tcp 0 0 0.0.0.0:8082 0.0.0.0:* LISTEN 20551/seaf-server tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 20586/python2.7 [root@seafile seafile-server-6.2.5]# |
然后登陆页面:
http://IP:8000
http://192.168.159.130:8000/
——————————
Done。