FIREFOX SYNC SERVER DEBIAN FAQ
FIREFOX SYNC SERVER DEBIAN FAQ (Stand 13.05.2013) [ © Oliver Schuetz aka OppTupacShakur | http://OPPServer.net | http://unix.oppserver.net ]
Alle Befehle sind als user root auszufuehren:
Die noetigen Pakete installieren:
aptitude install libapache2-mod-wsgi python-dev mercurial python-virtualenv php-services-json sqlite3 libmysqlclient-dev mysql-server
Benutzer ffsync erstellen:
adduser --system --home /home/ffsync --group ffsync passwd ffsync usermod -s /bin/bash ffsync
Den Apache User zu der Gruppe ffsync hinzufuegen:
adduser www-data ffsync
Mysql einrichten:
mysql -u root -p mysql create database ffsync; CREATE USER 'ffsync'@'localhost' IDENTIFIED BY 'ffsync'; SET PASSWORD FOR 'ffsync'@'localhost' = PASSWORD('P@ssw0rt'); grant all on ffsync.* to 'ffsync'@'localhost'; quit
Den User wechseln:
su - ffsync
Den Server holen und installieren:
hg clone https://hg.mozilla.org/services/server-full mkdir data tmp cd server-full make build bin/easy_install Mysql-Python
In sync.wsgi folgendes aendern:
os.environ['PYTHON_EGG_CACHE'] = '/tmp/python-eggs'
in
os.environ['PYTHON_EGG_CACHE'] = '/home/ffsync/tmp/python-eggs'
ini_file = os.path.join(_CURDIR, 'development.ini')
in
ini_file = os.path.join(_CURDIR, 'server.ini')
cp development.ini server.ini
In server.ini folges aendern:
[server:main] use = egg:Paste#http host = 0.0.0.0
in
[server:main] use = egg:Paste#http host = 192.168.0.2 << Beispiel
[handler_syncserver_errors] class = handlers.RotatingFileHandler args = ('/tmp/sync-error.log',)
in
[handler_syncserver_errors] class = handlers.RotatingFileHandler args = ('/home/ffsync/tmp/sync-error.log',)
In etc/sync.conf folgendes aendern:
[captcha] use = true public_key = 6Le8OLwSAAAAAK-wkjNPBtHD4Iv50moNFANIalJL private_key = 6Le8OLwSAAAAAEKoqfc-DmoF4HNswD7RNdGwxRij use_ssl = true
Die Keys kann man hier https://www.google.com/recaptcha/admin/create generieren.
Im folgenden sind nur die Aenderungen aufgefuehrt:
[storage] backend = syncstorage.storage.sql.SQLStorage sqluri = mysql://ffsync:P@ssw0rt@localhost/ffsync [auth] backend = services.auth.sql.SQLAuth sqluri = mysql://ffsync:P@ssw0rt@localhost/ffsync [nodes] # You must set this to your client-visible server URL. # fallback_node = http://example.com/path/to/sync fallback_node = http://ffsync.oppserver.net/ [smtp] host = localhost port = 25 sender = ffsync@oppserver.net [reset_codes] backend = services.resetcodes.rc_sql.ResetCodeSQL #sqluri = sqlite:////tmp/test.db sqluri = mysql://ffsync:P@ssw0rt@localhost/ffsync
Apache und Vhost einrichten:
Hier wieder weiter als User root:
a2enmod wsgi
/etc/apache2/sites-available/ffsync.oppserver.net.conf Datei anlegen:
<VirtualHost *:80> DocumentRoot "/home/ffsync/server-full" ServerName ffsync.oppserver.net CustomLog ${APACHE_LOG_DIR}/ffsync.oppserver.net-access.log combined ErrorLog ${APACHE_LOG_DIR}/ffsync.oppserver.net-error.log <Directory "/home/ffsync/server-full"> Order deny,allow Allow from all </Directory> WSGIProcessGroup ffsync WSGIDaemonProcess ffsync user=ffsync group=ffsync processes=2 threads=25 WSGIPassAuthorization On WSGIScriptAlias / /home/ffsync/server-full/sync.wsgi </VirtualHost> <IfModule mod_ssl.c> <VirtualHost *:443> DocumentRoot "/home/ffsync/server-full" ServerName ffsync.oppserver.net CustomLog ${APACHE_LOG_DIR}/ffsync.oppserver.net-access.log combined ErrorLog ${APACHE_LOG_DIR}/ffsync.oppserver.net-error.log SSLEngine on SSLCertificateFile /usr/share/ssl-cert/oppserver.net.pem <Directory "/home/ffsync/server-full"> Order deny,allow Allow from all </Directory> WSGIProcessGroup ffsync WSGIDaemonProcess ffsyncs user=ffsync group=ffsync processes=2 threads=25 WSGIPassAuthorization On WSGIScriptAlias / /home/ffsync/server-full/sync.wsgi </VirtualHost> </IfModule>
a2ensite ffsync.oppserver.net.conf /etc/init.d/apache2 reload
Ich musste bei meinem VPS die threads beim WSGIDaemonProcess von 25 auf 10 senken, damit nicht zuviel RAM Verbrauch an stand.