Advertisement
kevoh

Seafile 1

Jul 5th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.48 KB | None | 0 0
  1.  
  2. # We need to gain access to epel repo for nginx packages
  3. root@seafile-server ~ $ yum install -y epel-release
  4.  
  5. # Now lets install everything we will need
  6. root@seafile-server ~ $ yum install -y python python-imaging MySQL-python python-setuptools nginx mariadb mariadb-server
  7.  
  8. # Lets start then do basic security for our mariadb server
  9. root@seafile-server ~ $ systemctl start mariadb
  10. root@seafile-server ~ $ mysql_secure_installation # follow all recommended basic security settings
  11.  
  12. # Now let's prepare our database and privileges
  13. root@seafile-server ~ $ mysql -p
  14. Enter password:
  15.  
  16. create database `ccnet-db` character set = 'utf8';
  17. create database `seafile-db` character set = 'utf8';
  18. create database `seahub-db` character set = 'utf8';
  19.  
  20. create user 'seafile'@'localhost' identified by '<REPLACE_PASSWORD>';
  21.  
  22. GRANT ALL PRIVILEGES ON `ccnet-db`.* to `seafile`@localhost;
  23. GRANT ALL PRIVILEGES ON `seafile-db`.* to `seafile`@localhost;
  24. GRANT ALL PRIVILEGES ON `seahub-db`.* to `seafile`@localhost;
  25.  
  26. # Make mariadb start with system
  27. root@seafile-server ~ $ systemctl enable mariadb
  28.  
  29. # Let's prepare our directories for sea-file server and download/extract the latest tar
  30. root@seafile-server ~ $ mkdir /opt/seafile
  31. root@seafile-server ~ $ cd /opt/seafile
  32. root@seafile-server /opt/seafile $ wget https://bitbucket.org/haiwen/seafile/downloads/seafile-server_4.0.6_x86-64.tar.gz
  33. root@seafile-server /opt/seafile $ tar -xzf seafile-server_4.0.6_x86-64.tar.gz
  34. root@seafile-server /opt/seafile $ mkdir installed
  35. root@seafile-server /opt/seafile $ mv seafile-server_4.0.6_x86-64.tar.gz installed
  36.  
  37. # Directory structure should look like this now
  38. root@seafile-server /opt/seafile $ tree -L 2
  39. .
  40. ├── installed
  41. │ └── seafile-server_4.0.6_x86-64.tar.gz
  42. ├── seafile-server-4.0.6
  43. ├── check_init_admin.py
  44. ├── reset-admin.sh
  45. ├── runtime
  46. ├── seaf-fuse.sh
  47. ├── seaf-gc.sh
  48. ├── seafile
  49. ├── seafile.sh
  50. ├── seahub
  51. ├── seahub.sh
  52. ├── setup-seafile-mysql.py
  53. ├── setup-seafile-mysql.sh
  54. ├── setup-seafile.sh
  55. └── upgrade
  56.  
  57. # Execute the setup script, remember to change options denoted by <>
  58. root@seafile-server /opt/seafile $ cd seafile-server-4.0.6
  59. root@seafile-server /opt/seafile/seafile-server-4.0.6 $ ./setup-seafile-mysql.sh
  60. Checking python on this machine ...
  61. Checking python module: setuptools ... Done.
  62. Checking python module: python-imaging ... Done.
  63. Checking python module: python-mysqldb ... Done.
  64.  
  65. -----------------------------------------------------------------
  66. This script will guide you to setup your seafile server using MySQL.
  67. Make sure you have read seafile server manual at
  68.  
  69. https://github.com/haiwen/seafile/wiki
  70.  
  71. Press ENTER to continue
  72. -----------------------------------------------------------------
  73.  
  74.  
  75. What is the name of the server? It will be displayed on the client.
  76. 3 - 15 letters or digits
  77. [ server name ] <ENTER_SERVERNAME>
  78.  
  79. What is the ip or domain of the server?
  80. For example: www.mycompany.com, 192.168.1.101
  81. [ This server's ip or domain ] <ENTER_HOSTNAME>
  82.  
  83. Which port do you want to use for the ccnet server?
  84. [ default "10001" ]
  85.  
  86. Where do you want to put your seafile data?
  87. Please use a volume with enough free space
  88. [ default "/opt/seafile/seafile-data" ]
  89.  
  90. Which port do you want to use for the seafile server?
  91. [ default "12001" ]
  92.  
  93. Which port do you want to use for the seafile fileserver?
  94. [ default "8082" ]
  95.  
  96. -------------------------------------------------------
  97. Please choose a way to initialize seafile databases:
  98. -------------------------------------------------------
  99.  
  100. [1] Create new ccnet/seafile/seahub databases
  101. [2] Use existing ccnet/seafile/seahub databases
  102.  
  103. [ 1 or 2 ] 2
  104.  
  105. What is the host of mysql server?
  106. [ default "localhost" ]
  107.  
  108. What is the port of mysql server?
  109. [ default "3306" ]
  110.  
  111. Which mysql user to use for seafile?
  112. [ mysql user for seafile ] seafile
  113.  
  114. What is the password for mysql user "seafile"?
  115. [ password for seafile ]
  116.  
  117. verifying password of user seafile ... done
  118.  
  119. Enter the existing database name for ccnet:
  120. [ ccnet database ] ccnet-db
  121.  
  122. verifying user "seafile" access to database ccnet-db ... done
  123.  
  124. Enter the existing database name for seafile:
  125. [ seafile database ] seafile-db
  126.  
  127. verifying user "seafile" access to database seafile-db ... done
  128.  
  129. Enter the existing database name for seahub:
  130. [ seahub database ] seahub-db
  131.  
  132. verifying user "seafile" access to database seahub-db ... done
  133.  
  134. ---------------------------------
  135. This is your configuration
  136. ---------------------------------
  137.  
  138. server name: <SERVERNAME_FROM_ABOVE>
  139. server ip/domain: <HOSTNAME_FROM_ABOVE>
  140. ccnet port: 10001
  141.  
  142. seafile data dir: /opt/seafile/seafile-data
  143. seafile port: 12001
  144. fileserver port: 8082
  145.  
  146. database: use exising
  147. ccnet database: ccnet-db
  148. seafile database: seafile-db
  149. seahub database: seahub-db
  150. database user: seafile
  151.  
  152.  
  153.  
  154. ---------------------------------
  155. Press ENTER to continue, or Ctrl-C to abort
  156. ---------------------------------
  157.  
  158. Generating ccnet configuration ...
  159.  
  160. done
  161. Successly create configuration dir /opt/seafile/ccnet.
  162. Generating seafile configuration ...
  163.  
  164. Done.
  165. done
  166. Generating seahub configuration ...
  167.  
  168. ----------------------------------------
  169. Now creating seahub database tables ...
  170.  
  171. ----------------------------------------
  172.  
  173. creating seafile-server-latest symbolic link ... done
  174.  
  175. -----------------------------------------------------------------
  176. Your seafile server configuration has been finished successfully.
  177. -----------------------------------------------------------------
  178.  
  179. run seafile server: ./seafile.sh { start | stop | restart }
  180. run seahub server: ./seahub.sh { start <port> | stop | restart <port> }
  181.  
  182. -----------------------------------------------------------------
  183. If you are behind a firewall, remember to allow input/output of these tcp ports:
  184. -----------------------------------------------------------------
  185.  
  186. port of seafile fileserver: 8082
  187. port of seahub: 8000
  188.  
  189. When problems occur, Refer to
  190.  
  191. https://github.com/haiwen/seafile/wiki
  192.  
  193. for information.
  194.  
  195.  
  196.  
  197.  
  198. # now lets add a seafile user and chown
  199. root@seafile-server /opt/seafile $ adduser seafile
  200. root@seafile-server /opt/seafile $ chown -R seafile .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement