500 Errors when communicating with Firefox Sync Server through mod_wsgi and Apache2
I recently set up the new version of the Firefox Sync Server written in Python. I used the tutorial which can be found here: http://docs.services.mozilla.com/howtos/run-sync.html
After I completed the steps in the tutorial, I have configured the ini files accordingly to point to my MySQL Server, installed MySql-Python bindings and tested everything using the built-in Paster webserver.
No problem so far, Paster works fine, has no errors in my config and I can see in the MySQL Database that all tables (I think that this are really all tables ;) ) have been created.
Now I wanted to run my FF Sync Server behind Apache2 using mod_wsgi as supposed in the tutorial. Therefore I changed my VirtualHost config for my domain to look like this:
<VirtualHost ip:80>
<Directory /home/user/domains/subdomain/public_html/weave>
Order deny,allow
Allow from all
</Directory>
ServerName subdomain.domain.com
DocumentRoot /home/user/domains/subdomain/public_html/weave
WSGIProcessGroup sync
WSGIDaemonProcess sync user=sync group=sync processes=2 threads=25
WSGIPassAuthorization On
WSGIScriptAlias / /home/user/domains/subdomain/public_html/weave/sync.wsgi
CustomLog /var/log/apache2/example.com-access.log combined
ErrorLog /var/log/apache2/example.com-error.log
Loglevel info
</VirtualHost>
The files are located under /home/... because I use virtualmin and webmin for configuration and these are the default paths for html files. Apache runs as the user who owns this home directory so access restrictions should not be a problem (I also tried setting chmod 777 for the complete home path).
My problem now is, that I only get 500 error codes when FF Sync tries to connect to the server. As I can see in the access_log file, FF Sync tries to access subdomain.domain.com/user/1.0/a and even if I try subdomain.domain.com for myself in FF, only a 500 error is returned. The error_log does not show anything ..
Any suggestions what could go wrong or what I can try to figure this out? If further information are needed, I can post the config files for sync.wsgi, development.ini and sync.conf as well.
Best Regards, Tobias
For me, this problem was caused by the following:
When you first start weave via Paster (as root), it creates the file /tmp/sync-error.log
with rw permissions for root and only r for everybody else.
When trying to run under mod_wsgi, it tries to write to this file as user "sync", which fails.
I had to delete /tmp/sync-error.log
to resolve this issue.