This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
fileservices:seafile [2013/10/24 12:56] tschulz created |
fileservices:seafile [2013/10/24 13:20] tschulz [Enable SSL through Apache2 on port 443] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Seafile 2.x on Ubuntu 12.04 ====== | ====== Seafile 2.x on Ubuntu 12.04 ====== | ||
- | ===== install deps ===== | + | ===== Download and Install ===== |
- | <file> | + | - install deps<file> |
- | apt-get install python2.7 python-setuptools python-simplejson python-imaging python-mysqldb python-flup mysql-server | + | apt-get install python2.7 python-setuptools python-simplejson\ |
+ | python-imaging python-mysqldb mysql-server | ||
</file> | </file> | ||
- | ===== extract and install ===== | + | - extract and install<file> |
- | <file> | + | |
mkdir /vol1/seafile/ | mkdir /vol1/seafile/ | ||
cd /vol1/seafile/ | cd /vol1/seafile/ | ||
Line 14: | Line 14: | ||
./setup-seafile-mysql.sh | ./setup-seafile-mysql.sh | ||
</file> | </file> | ||
- | ===== Setup Smtp Server ===== | + | - Setup Smtp Server<file py /vol1/seafile/seahub_settings.py> |
- | <file py /vol1/seafile/seahub_settings.py> | + | |
... | ... | ||
EMAIL_USE_TLS = False | EMAIL_USE_TLS = False | ||
Line 26: | Line 25: | ||
... | ... | ||
</file> | </file> | ||
- | ===== /etc/init.d/seafile ===== | + | ===== Enable Seafile Automatic Startup ===== |
- | <file bash /etc/init.d/seafile> | + | |
+ | - create /etc/init.d/seafile<file bash /etc/init.d/seafile> | ||
#!/bin/sh | #!/bin/sh | ||
### BEGIN INIT INFO | ### BEGIN INIT INFO | ||
Line 80: | Line 80: | ||
;; | ;; | ||
esac | esac | ||
+ | </file> | ||
+ | - Turn on automatic startup<file bash> | ||
+ | # make the script executable | ||
+ | sudo chmod +x /etc/init.d/seafile | ||
+ | # update system rc.d config to enable seafile-server | ||
+ | sudo update-rc.d seafile defaults | ||
+ | # restart once to make sure everything is running | ||
+ | echo "/etc/init.d/seafile restart" >> /etc/rc.local | ||
+ | </file> | ||
+ | ===== Enable SSL through Apache2 on port 443 ===== | ||
+ | - Install Apache and enable mods<file> | ||
+ | apt-get install python-flup apache2 libapache2-mod-fastcgi | ||
+ | a2enmod proxy_http | ||
+ | a2enmod rewrite | ||
+ | a2enmod ssl | ||
+ | a2ensite default-ssl | ||
+ | </file> | ||
+ | - Enable fastcgi on seafile<file bash /etc/init.d/seafile> | ||
+ | ... | ||
+ | # Change the value of fastcgi to true if fastcgi is to be used | ||
+ | fastcgi=true | ||
+ | ... | ||
+ | </file> | ||
+ | - Create ssl certs<file> | ||
+ | mkdir /vol1/seafile/ssl | ||
+ | cd /vol1/seafile/ssl | ||
+ | openssl genrsa -out privkey.pem 2048 | ||
+ | openssl req -new -x509 -key privkey.pem -out cacert.pem -days 9999 | ||
+ | </file> | ||
+ | - Update apache ssl virtual host<file apache /etc/apache2/sites-enabled/default-ssl> | ||
+ | ... | ||
+ | SSLCertificateFile /vol1/seafile/ssl/cacert.pem | ||
+ | SSLCertificateKeyFile /vol1/seafile/ssl/privkey.pem | ||
+ | |||
+ | FastCGIExternalServer /vol1/seafile/seafile-server-2.0.1/seahub/seahub.fcgi -host 127.0.0.1:8000 | ||
+ | |||
+ | DocumentRoot /vol1/seafile/seafile-server-2.0.1/seahub | ||
+ | Alias /media /vol1/seafile/seafile-server-2.0.1/seahub/media | ||
+ | RewriteEngine On | ||
+ | RewriteRule ^/(media.*)$ /$1 [QSA,L,PT] | ||
+ | RewriteCond %{REQUEST_FILENAME} !-f | ||
+ | RewriteRule ^(.*)$ /seahub.fcgi/$1 [QSA,L,E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | ||
+ | ... | ||
+ | </file> | ||
+ | - Update SERVICE_URL in ccnet.conf<file conf /vol1/seafile/ccnet/ccnet.conf> | ||
+ | ... | ||
+ | SERVICE_URL = https://<SERVER FQDN> | ||
+ | ... | ||
+ | </file> | ||
+ | - Disable port 80 on apache<file apache /etc/apache2/ports.conf> | ||
+ | ... | ||
+ | #NameVirtualHost *:80 | ||
+ | #Listen 80 | ||
+ | ... | ||
</file> | </file> |