Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # We need to gain access to epel repo for nginx packages
- root@seafile-server ~ $ yum install -y epel-release
- # Now lets install everything we will need
- root@seafile-server ~ $ yum install -y python python-imaging MySQL-python python-setuptools nginx mariadb mariadb-server
- # Lets start then do basic security for our mariadb server
- root@seafile-server ~ $ systemctl start mariadb
- root@seafile-server ~ $ mysql_secure_installation # follow all recommended basic security settings
- # Now let's prepare our database and privileges
- root@seafile-server ~ $ mysql -p
- Enter password:
- create database `ccnet-db` character set = 'utf8';
- create database `seafile-db` character set = 'utf8';
- create database `seahub-db` character set = 'utf8';
- create user 'seafile'@'localhost' identified by '<REPLACE_PASSWORD>';
- GRANT ALL PRIVILEGES ON `ccnet-db`.* to `seafile`@localhost;
- GRANT ALL PRIVILEGES ON `seafile-db`.* to `seafile`@localhost;
- GRANT ALL PRIVILEGES ON `seahub-db`.* to `seafile`@localhost;
- # Make mariadb start with system
- root@seafile-server ~ $ systemctl enable mariadb
- # Let's prepare our directories for sea-file server and download/extract the latest tar
- root@seafile-server ~ $ mkdir /opt/seafile
- root@seafile-server ~ $ cd /opt/seafile
- root@seafile-server /opt/seafile $ wget https://bitbucket.org/haiwen/seafile/downloads/seafile-server_4.0.6_x86-64.tar.gz
- root@seafile-server /opt/seafile $ tar -xzf seafile-server_4.0.6_x86-64.tar.gz
- root@seafile-server /opt/seafile $ mkdir installed
- root@seafile-server /opt/seafile $ mv seafile-server_4.0.6_x86-64.tar.gz installed
- # Directory structure should look like this now
- root@seafile-server /opt/seafile $ tree -L 2
- .
- ├── installed
- │ └── seafile-server_4.0.6_x86-64.tar.gz
- ├── seafile-server-4.0.6
- ├── check_init_admin.py
- ├── reset-admin.sh
- ├── runtime
- ├── seaf-fuse.sh
- ├── seaf-gc.sh
- ├── seafile
- ├── seafile.sh
- ├── seahub
- ├── seahub.sh
- ├── setup-seafile-mysql.py
- ├── setup-seafile-mysql.sh
- ├── setup-seafile.sh
- └── upgrade
- # Execute the setup script, remember to change options denoted by <>
- root@seafile-server /opt/seafile $ cd seafile-server-4.0.6
- root@seafile-server /opt/seafile/seafile-server-4.0.6 $ ./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 ] <ENTER_SERVERNAME>
- What is the ip or domain of the server?
- For example: www.mycompany.com, 192.168.1.101
- [ This server's ip or domain ] <ENTER_HOSTNAME>
- Which port do you want to use for the ccnet server?
- [ default "10001" ]
- Where do you want to put your seafile data?
- Please use a volume with enough free space
- [ default "/opt/seafile/seafile-data" ]
- Which port do you want to use for the seafile server?
- [ default "12001" ]
- 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 ] 2
- What is the host of mysql server?
- [ default "localhost" ]
- What is the port of mysql server?
- [ default "3306" ]
- Which mysql user to use for seafile?
- [ mysql user for seafile ] seafile
- What is the password for mysql user "seafile"?
- [ password for seafile ]
- verifying password of user seafile ... done
- Enter the existing database name for ccnet:
- [ ccnet database ] ccnet-db
- verifying user "seafile" access to database ccnet-db ... done
- Enter the existing database name for seafile:
- [ seafile database ] seafile-db
- verifying user "seafile" access to database seafile-db ... done
- Enter the existing database name for seahub:
- [ seahub database ] seahub-db
- verifying user "seafile" access to database seahub-db ... done
- ---------------------------------
- This is your configuration
- ---------------------------------
- server name: <SERVERNAME_FROM_ABOVE>
- server ip/domain: <HOSTNAME_FROM_ABOVE>
- ccnet port: 10001
- seafile data dir: /opt/seafile/seafile-data
- seafile port: 12001
- fileserver port: 8082
- database: use exising
- 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 /opt/seafile/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.
- # now lets add a seafile user and chown
- root@seafile-server /opt/seafile $ adduser seafile
- root@seafile-server /opt/seafile $ chown -R seafile .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement