User Tools

Site Tools


blog:set_up_private_firefox_sync_server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
blog:set_up_private_firefox_sync_server [2012-09-28 12:27] brbblog:set_up_private_firefox_sync_server [2014-04-24 09:39] (current) brb
Line 1: Line 1:
 ====== Set up private firefox sync server ====== ====== Set up private firefox sync server ======
-  $ apt-get install python-dev mercurial sqlite3 python-virtualenv apache2-mpm-prefork libapache2-mod-wsgi make 
  
 +
 +Firefox sync is very handy, if you use firefox on several computers. Since all data is encrypted before it is sent to the server, I could life with my bookmarks stored on a cloud server. However, it wanted the added security of using my own server. Here's how to install one:
 +
 +<code>$ apt-get install python-dev mercurial sqlite3 python-virtualenv apache2-mpm-prefork libapache2-mod-wsgi make</code>
 Add user ffsync: Add user ffsync:
-  $ adduser --group --system --home /usr/local/firefox-sync-server --disabled-password ffsync+<code>$ adduser --group --system --home /usr/local/firefox-sync-server --disabled-password ffsync</code>
  
 Add apache user (www-data) to group ffsync: Add apache user (www-data) to group ffsync:
-  $ adduser www-data ffsync+<code>$ adduser www-data ffsync</code>
  
 Change user: Change user:
-  $ su - ffsync+<code>$ su - ffsync</code>
  
 Download source files: Download source files:
-  $ hg clone https://hg.mozilla.org/services/server-full+<code>$ hg clone https://hg.mozilla.org/services/server-full</code>
  
 Create tmp and data subdirectories Create tmp and data subdirectories
-  $ mkdir data tmp+<code>$ mkdir data tmp</code>
  
 Change permissions Change permissions
-  $ chmod 770 data tmp+<code>$ chmod 770 data tmp</code>
  
 Compile sync server Compile sync server
-  $ cd server-full +<code>$ cd server-full 
-  $ make build+$ make build</code>
  
 Change config files, paths in default install store user data in /tmp, not very useful. Change config files, paths in default install store user data in /tmp, not very useful.
-    $ vi sync.wsgi +<code>$ vi sync.wsgi 
-    [..] +[..] 
-    os.environ['PYTHON_EGG_CACHE'] = ‘/usr/local/firefox-sync-server/tmp/python-eggs’ +os.environ['PYTHON_EGG_CACHE'] = ‘/usr/local/firefox-sync-server/tmp/python-eggs’ 
-    [..] +[..] 
-    $ vi development.ini +$ vi development.ini 
-    [..] +[..] 
-    [handler_syncserver_errors] +[handler_syncserver_errors] 
-    class = handlers.RotatingFileHandler +class = handlers.RotatingFileHandler 
-    args = (‘/usr/local/firefox-sync-server/tmp/sync-error.log’,+args = (‘/usr/local/firefox-sync-server/tmp/sync-error.log’,
-    [..] +[..] 
-    $ vi etc/sync.conf +$ vi etc/sync.conf 
-    [..] +[..] 
-    [storage] +[storage] 
-    backend = syncstorage.storage.sql.SQLStorage +backend = syncstorage.storage.sql.SQLStorage 
-    sqluri = sqlite:////usr/local/firefox-sync-server/data/usersettings.db +sqluri = sqlite:////usr/local/firefox-sync-server/data/usersettings.db 
-    [..] +[..] 
-    [auth] +[auth] 
-    backend = services.auth.sql.SQLAuth +backend = services.auth.sql.SQLAuth 
-    sqluri = sqlite:////usr/local/firefox-sync-server/data/usersettings.db +sqluri = sqlite:////usr/local/firefox-sync-server/data/usersettings.db 
-    [..] +[..] 
-    fallback_node = http://sync.mytestdomain.com/ +fallback_node = http://sync.mytestdomain.com/ 
-    [..] +[..] 
 +</code>
  
 Change login shell of ffsync to /bin/false. Change login shell of ffsync to /bin/false.
-    $ usermod -s /bin/false ffsync+<code>$ usermod -s /bin/false ffsync</code>
  
 Enable wsgi module Enable wsgi module
-    $ a2enmod wsgi+<code>$ a2enmod wsgi</code>
  
  
 Create new apache virtual host Create new apache virtual host
-    $ vi /etc/apache2/sites-available/firefox-sync+<code>$ vi /etc/apache2/sites-available/firefox-sync
  
-    <VirtualHost *:80> +<VirtualHost *:80> 
-    ServerName sync.mytestdomain.com +ServerName sync.mytestdomain.com 
-    ServerAdmin webmaster@mytestdomain.com+ServerAdmin webmaster@mytestdomain.com
  
-    DocumentRoot /usr/local/firefox-sync-server/server-full+DocumentRoot /usr/local/firefox-sync-server/server-full
  
-    CustomLog ${APACHE_LOG_DIR}/firefox-sync-server_access.log combined +CustomLog ${APACHE_LOG_DIR}/firefox-sync-server_access.log combined 
-    ErrorLog ${APACHE_LOG_DIR}/firefox-sync-server_error.log+ErrorLog ${APACHE_LOG_DIR}/firefox-sync-server_error.log
  
-    <Directory /usr/local/firefox-sync-server/server-full> +<Directory /usr/local/firefox-sync-server/server-full> 
-    Order deny,allow +Order deny,allow 
-    Allow from all +Allow from all 
-    </Directory>+</Directory>
  
-    WSGIProcessGroup ffsync +WSGIProcessGroup ffsync 
-    WSGIDaemonProcess ffsync user=ffsync group=ffsync processes=2 threads=25 +WSGIDaemonProcess ffsync user=ffsync group=ffsync processes=2 threads=25 
-    WSGIPassAuthorization On +WSGIPassAuthorization On 
-    WSGIScriptAlias / /usr/local/firefox-sync-server/server-full/sync.wsgi +WSGIScriptAlias / /usr/local/firefox-sync-server/server-full/sync.wsgi 
-    </VirtualHost>+</VirtualHost></code>
  
 Activate virtual host Activate virtual host
-    $ cd /etc/apache2/sites-enabled +<code>$ cd /etc/apache2/sites-enabled 
-    $ ln -s ../sites-available/firefox-sync .+$ ln -s ../sites-available/firefox-sync .</code>
  
 Check config and restart apache Check config and restart apache
-    $ apachectl configtest && /etc/init.d/apache restart+<code>$ apachectl configtest &amp;&amp; /etc/init.d/apache restart</code>
  
 Now you can configure firefox sync with Tools>Sync Now you can configure firefox sync with Tools>Sync
  
-Ref: http://www.apfelschwein.net/firefox-sync-now-mit-eigenem-apache-server.html +Ref: [[http://www.apfelschwein.net/firefox-sync-now-mit-eigenem-apache-server.html]]
- +
-{{tag>}}+
  
-~~LINKBACK~~ 
-~~DISCUSSION~~ 
  
blog/set_up_private_firefox_sync_server.1348828036.txt.gz · Last modified: 2012-09-28 12:27 by brb