Hi all, I've broken this into four parts so it doesn't get to confusing .... Here we Go!
Tip: Do the following using SSH so you can copy and paste line by line (google putty for more info).
Tip: Depending on which browser you use copying code from forums can be troublesome. The code can be corrupted and cause errors.
Make sure you use the little copy buttons to the right of the page or try a good web browser like Chrome or Firefox
Video: I finally found time to make a video tutorial here, It's my first video so I hope you like it ...
## Part One ##
As always:
apt-get update
apt-get upgrade
1. Create a user to install Seafile.
useradd -m -d /opt/seafile -c "Seafile Service Account" -s /bin/bash -r -g users seafile
2. Create the Shared Folders
- Create a Shared Folder for MySQL Databases.
- Create a Share Folder for Seafile. (You will need the full directory path for this folder later. You can find it using SFTP/FTP.
(eg. /media/7b1e06d4-f77a-47e4-a024-822c0d29a9fe/Seafile-Data)
3. Install the MySQL plugin (if not already installed)
- Go to MySQL Settings
- Set the Data directory to the database folder you created in the previous step.
- Enable the MySQL plugin
- Save & Apply
4. For new MySQL Plugin installations you will need to change the MySQL root password. The default password is blank.
mysql -u root -p
password: << BLANK
UPDATE mysql.user SET Password = PASSWORD('NEW.PASSWORD.HERE') << INSERT YOUR NEW PASSWORD HERE
WHERE User = 'root';
FLUSH PRIVILEGES;
exit
5. Install the python packages: (copy & paste both lines together, use the copy button to the right >>)
apt-get install python2.7 libpython2.7 python-setuptools python-imaging \
python-ldap python-mysqldb python-memcache python-urllib3
## Part Two: Install Seafile ##
su -s /bin/bash seafile
cd
1. Download Seafile: (choose your 64bit or 32bit version)
64bit: wget https://bintray.com/artifact/download/seafile-org/seafile/seafile-server_5.1.3_x86-64.tar.gz
32bit: wget https://bintray.com/artifact/download/seafile-org/seafile/seafile-server_5.1.3_i386.tar.gz
2. Create the directories for the installation:
tar -xzf seafile-server_*
mkdir installed
mv seafile-server_* installed
3. Go to the Seafile server directory and run the setup:
cd seafile-server-*
./setup-seafile-mysql.sh
4. Install Seafile & connect the MySQL Databases, Follow the instructions:
- Give your server a name
- When asked for an IP enter OMV's local IP.
- When asked for the Seafile Data directory use the full directory path to the Seafile-data folder you created in Part 1 Step 2 and append /data to the end of the path e.g.
/media/fa8088ed-5de5-4c2c-b4dc-d84abe3dd7ec/Seafile-Data/data (/media/your-number-is different/Seafile-Data/data)
- hit enter for the default port number
### Choose option 1 to initialize database. ###
- Hit enter for the default MySQL server & port
- Enter the MySQL root user password you changed in part 1.
- Enter a name for the MySQL seafile user - seafile
- Enter a password for the MySQL seafile user - new.password
- Hit enter on all of the default database names
- Hit enter to finish the Seafile installation
5. Start the Seafile Server:
su -s /bin/bash seafile (only do this if you are staring a new terminal session)
cd /opt/seafile/seafile-server-* (only do this if you are starting a new terminal session)
./seafile.sh start
./seahub.sh start
- enter your admin account info (this will be your admin login details).
- log into your Seafile server using your admin email and password at:http://local-ip:8000 (NOT HTTPS)
Tip: Though you can open port 8000 in your firewall and access Seafile remotely it will not be secure without SSL. It's recommended you continue with the rest of the steps and add SSL Security.
6. Extra Settings: Add memcached to speed up Seafile server for 50+ users.
nano /opt/seafile/conf/seahub_settings.py
- Paste the following code into the bottom of the file then save and close. Ctrl+O to save, Ctrl+X to exit. (Use the copy button to the right >>)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
## Part Three: Start Seafile at System Boot ##
1. Create a startup script file /etc/init.d/seafile-server (The script file is seafile-server.txt if you prefer manual installation)
su (if not already root user)
cd
wget http://forums.openmediavault.org/index.php/Attachment/4495-seafile-server-txt/seafile-server.txt
mv seafile-server.txt /etc/init.d/seafile-server
chmod +x /etc/init.d/seafile-server
update-rc.d seafile-server defaults
2. Make sure your system reboots with Seafile running:
reboot
## Part Four: SSL and the Nginx plugin ##
1. Create an SSL Certificate to use with Seafile.
2. Install the Nginx plugin (if not already installed)
3. Add a server and copy the settings from attached images
3. In the Extra options paste the following code. (Use the copy button to the right >>)
location / {
fastcgi_pass 127.0.0.1:8000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;
access_log /var/log/nginx/seahub.access.log;
error_log /var/log/nginx/seahub.error.log;
fastcgi_read_timeout 36000;
}
location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass http://127.0.0.1:8082;
client_max_body_size 0;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
send_timeout 36000s;
}
location /media {
root /opt/seafile/seafile-server-latest/seahub;
}
Alles anzeigen
4. Save & Apply
5. Enable the Nginx plugin
6.apt-get clean
7. Change the fastcgi=false value to true in the startup script.
replace "fastcgi=false" "fastcgi=true" -- /etc/init.d/seafile-server
/etc/init.d/seafile-server restart (if you see "bad Gateway" after this then try it again or reboot)
Tip: The following Warning can be fixed with the following commands:
/opt/seafile/seafile-server-latest/seahub.sh: line 207: warning: setlocale: LC_A
LL: cannot change locale (en_US.UTF-8): No such file or directory
locale-gen "en_US.UTF-8"
dpkg-reconfigure locales
add/select en_US.UTF-8 UTF-8 from the list and click ok.
Select your correct locale as the default and click ok.
Check the warning has gone with /etc/init.d/seafile-server restart
8. You can now log into Seafile using https://yourdomain.com:[chosen ssl port]. You need to open your chosen HTTPS port in your firewall for remote access.
9. Log into Seafile and go to system admin settings in the top right-hand corner. Change the settings below to your external IP address or domain name. File uploads won't work on your local IP after changing theses settings, therefore you need to access Seafile using your external IP address or Domain name and SSL port.
SERVICE_URL https://yourdomain.com:[chosen ssl port]
FILE_SERVER_ROOT https://yourdomain.com:[chosen ssl port]/seafhttp
That's it!
UPDATING SEAFILE...
I've never updated Seafile before so I'm not going to tell you how to in this tutorial...Yet!. I Will post something when I've learned how to update mine
For now here is a good place start: http://manual.seafile.com/deploy/upgrade.html