Foxmarks: Using Your Own Server
From Foxmarks Wiki
This article is a place where users can describe their experiences with or provide tips for using your own server.
Contents |
Special note for Xmarks BYOS users
While the information in this document refers to the regular [Fo]Xmarks extension, most of the configuration is the same for BYOS, so you can probably find useful information below. However, if you have a BYOS-specific issue or suggestion, please check the BYOS user forum on GetSatisfaction here.
How Foxmarks 2.x (and Xmarks 3.x) works with your own server
While Foxmarks can't provide support for people using their own server, we do provide this section of notes to help you understand how it works. This in turn should help you to determine how to set up your own server.
- By default, Foxmarks assumes that you are syncing with the Foxmarks server. The Setup Wizard, for instance, only works for setting up an account on the Foxmarks server; if you're using your own server, there's no need to use the Setup Wizard.
- Configuration of your own server happens primarily in the "Advanced" pane of the Foxmarks Settings dialog. Check the "Use own server" button and enter the url which identifies the location on your server where your sync file is to be stored. This url can be anything that Firefox knows how to read and write, such as http:, https:, or ftp:. For example, http://myserver.example.com/homedirectory/foxmarks.json. (Note that the filename itself, foxmarks.json, can be anything you choose, but the url must denote a file, not a directory). If you wish to sync passwords, provide a second (different) url.
- When accessing the file via the above url, Foxmarks will supply (as necessary) the username and password you have provided in the General pane of the Foxmarks Settings dialog.
- When using FTP, Foxmarks fetches and parses the entire sync file every time you sync. This can be slow.
- When using HTTP, Foxmarks will fetch and parse the entire sync file only if the file's etag has changed since Foxmarks last wrote the file. This can be quite a performance boost, but some servers (notably Apache WebDAV) don't support etags correctly; to disable them, set foxmarks.disableIfMatchOnPut in about:config (see below for more info).
- If you have trouble connecting to your Foxmarks server, and you are using Microsoft IIS, you might have to make some changes to your IIS configuration to allow it to send/receive .json files. If this is the case, take the following steps: 1) Open your server's Internet Information Services Manager; 2) Open up your Web Sites section; 3) Right-click on the website which holds your Foxmarks .json file and choose Properties; 4) Select the HTTP Headers tab, and then press the MIME Types button; 5) Create a Mime type for the .json file. MIME type text/css works fine. 6) save your changes.
- If performance is still a problem, you can likely improve speed by sacrificing favicon sync.
- Note that the Foxmarks server is in general faster than using your own server, as the Foxmarks server transmits only deltas.
- Additional online services (such as My Foxmarks) are available only to users of the Foxmarks server.
Foxmarks version 2.0.+
Shortly after the upgrade was released, "Quix" posted to the Foxmarks blog an excellent summary on how to get things working with your own server. In his own words:
Upgrading to 2.x when you are using your own server, a step-by-step guide. This is what I had to do.Then it started working fine for me. My environment:
- make sure you have every machine you are interested in synced with version 1.0.1 first.
- upgrade foxmarks on all machines
- Pick one machine (hereby called MASTER), make sure it has file.json in the URL setting. (The URL might look something like: http://myfoxmarksserver.com/mypath/foxmarks.json)
- on MASTER, do a manual overwrite “Upload” of bookmarks (Note that you may have to restart Firefox and try this twice for this to complete successfully.)
- on every other machine, do a manual overwrite “Download”
Some other notes:
- Machine 1: Win XP, FF 2.0.0.11
- Machine 2: Win XP, FF 2.0.0.11
- Machine 3: linux Ubuntu feisty, FF 2.0.0.11
- Machine 4: linux Fedora 5, FF 1.5.0.3
- Server: RHEL4, apache 2.0.52 (Using webdav interface)
- foxmarks is busy: restart firefox
- verifying account stall: I got this on machines that upgraded to 2.x but hadn’t done a manual download yet
- connection reset: I think I was getting this after getting 404’s from the server.. then:
- foxmarks would be busy: restart firefox
Additional notes:
- If your server does not require a user name or password, then don't supply a dummy one. When prompted for user and password, just press the OK button without making any entry.
Using password synching
There are three settings you should be concerned with in about:config
* foxmarks.url-bookmarks (string) * foxmarks.url-passwords (string, needs to be a different file) * foxmarks.useOwnServer (boolean, set to True)
Sync Foxmarks 2.0 to cPanel Web Disk
- Get a cPanel Web Disk account assigned to you. Make sure that the directory that the Web Disk account points to is not in the /public_html directory tree of your account if you don't want your files to be accessible to the public.
- Access Foxmarks Settings using Tools > Foxmarks > Settings path through the Firefox menu system.
- General Settings
- Account
- Type username@myfoxmarksserver.com (replace with the user name assigned to you) in the "Username" field.
- Type the password assigned to you in the "Password" field.
- Account
- Advanced Settings
- Server
- Check the "Use own server" checkbox.
- Type https://myfoxmarksserver.com:2078/foxmarks.json (replace "myfoxmarksserver.com" with the fully qualified name of your server) in the "URL".
- Manual Overwrite
- Click the "Upload" button next to "Force overwrite of server bookmarks".
- Server
- General Settings
Sync Foxmarks 2.0 to Jungledisk
Jungledisk is an online storage product backed by either Amazon S3 or Rackspace Cloud Files Service.
Note: You must have a Jungledisk account with web access. I use their workgroup product and made a specific user for this using Rackspace's storage as it has no access fees.
- Login to your web-based storage (usually something like https://username.myjungledisk.com)
- Create a new directory (I used "foxmarks")
- In Foxmarks, change username to your Jungledisk user and your password as appropriate.
- Under Advanced Settings->Server check the "use your own server" box
- Type https://username.myjungledisk.com/foxmarks/foxmarks.json (replacing the username, directory, and filename as necessary) for Bookmark URL
- Type https://username.myjungledisk.com/foxmarks/password.json (replacing the username, directory, and filename as necessary) for Password URL
- Under "Manual Overwrite" force an upload
Foxmarks version 1.0.1
Microsoft IIS/WebDAV
Check out this article.
Microsoft IIS 5.0 ETag issues
When using your own Microsoft Windows 2000 IIS 5.0 server Foxmarks may seem to hang whilst displaying the "Status: Copying local file to remote..." message:
After several minutes the message will change to "Status: Connection reset":
At the beginning of a Synchronize session, when Foxmarks downloads the foxmarks.xml file with a HTTP GET command, IIS issues an ETag header that is effectively a Version Control Timestamp - the ETag value is guaranteed to remain the same so long as the file on the web server remains unmodified. Some IIS 5.0 installations have issues updating the foxmarks.xml file when using the corresponding ETag header is used later with a HTTP PUT command. Foxmarks does not recognize the "HTTP/412 Precondition failed" secondary status that gets returned by IIS after the "HTTP/100 Continue" initial status and so waits until IIS closes the connection - generating the Connection reset message.
You can disable Foxmarks' usage of the ETag header by creating a new Preference entry in Firefox's about:config section:
- Preference name: foxmarks.disableIfMatchOnPut
- Type: boolean
- Value: true
Caveat: Ignoring the ETag value means that changes made to the foxmarks.xml file on the IIS 5.0 server by other Firefox browsers concurrently running Foxmarks may be lost.
Apache 2.0/WebDAV
This article is a reasonable tutorial
on setting up WebDAV with Apache under Debian. However, for Foxmarks you don't want to allow WebDAV access
to the entire web tree, only to part of it, so omit the Alias directive. I also suggest putting
the AuthDigestFile inside the webdav subdirectory so it can't be read by any random browser.
When you try to make a second firefox sync its bookmarks you will
probably get the error Foxmarks: Error: Precondition Failed, due to a bug in Apache.
The workaround is to set foxmarks.disableIfMatchOnPut to true using about:config,
as detailed at the bottom of that page.
Foxmarks with self-signed SSL certificate under Ubuntu Server/Apache
Please feel free to edit this section if you find something out of place or incorrect. I am not an expert by a long shot, so please point out anything that could be changed. Thanks!
- These instructions assume install of Ubuntu Server 8.04 with LAMP and OpenSSL installed (see the Ubuntu Server Guide for details).
- NOTE: Throughout these instructions, replace yourdomain.com with your own domain. It is assumed that this domain has been routed to the Ubuntu server. I choose to use a subdomain for this purpose (i.e. sync.yourdomain.com).
- NOTE: Following these instructions, Apache will need to be started/restarted from the terminal prompt in order to input the passphrase from the certificate key. I choose to have Apache start manually, rather than have it autostart on boot. I can then connect via ssh to start Apache, so the machine doesn't need a monitor/keyboard attached.
Configure Apache to load the dav and ssl modules (I prefer to use Webmin to handle administration like this, but you can also do it manually.)
At a terminal prompt, execute the following commands:
- cd /var/www
- sudo mkdir -p yourdomain.com/www/user/foxmarks
- sudo chown -R www-data:www-data yourdomain.com
- cd /var/www/yourdomain.com/www/user/foxmarks
- sudo nano .htaccess
Add to the .htaccess file (ctrl-x to exit, y to save):
require user foxmarks
At a terminal prompt, execute the following commands:
- sudo chown www-data:www-data .htaccess
- sudo htpasswd -c /var/www/yourdomain.com/passwords foxmarks
- Enter password for user foxmarks.
- sudo openssl genrsa –des3 –out foxmarks.key 1024
- sudo openssl req –new –key foxmarks.key –out foxmarks.csr
- Enter data for the csr (defaults are fine).
- sudo openssl x509 –req –days 365 –in foxmarks.csr -signkey foxmarks.key -out foxmarks.crt
- sudo mv foxmarks.crt /etc/ssl/certs
- sudo mv foxmarks.key /etc/ssl/private
Use a text editor to add the following to the httpd.conf file. I prefer to use the text editor in Webmin file manager to this, but you can do it manually (#sudo nano /etc/apache2/httpd.conf):
<VirtualHost *:443>
ServerName yourdomain.com
DocumentRoot /var/www/yourdomain.com/www
ErrorLog /var/log/httpd/yourdomain_com-error.log
CustomLog /var/log/httpd/yourdomain_com-access.log combined
<Directory "/var/www/yourdomain.com/www">
SSLRequireSSL
Options Indexes FollowSymLinks
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
AuthType Basic
AuthName "WebDAV Restricted"
AuthUserFile /var/www/yourdomain.com/passwords
require valid-user
</Directory>
<Location />
DAV On
</Location>
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/ssl/certs/foxmarks.crt
SSLCertificateKeyFile /etc/ssl/private/foxmarks.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</VirtualHost>
- Start/restart Apache from the terminal (sudo /usr/sbin/apache2ctl start).
- Enter your RSA passphrase.
- Open Firefox and browse to your new SSL URL (https://yourdomain.com). Accept the certificate as an exception (normally you wouldn’t do this, but you signed it yourself).
- Verify you have the latest Foxmarks add-on package installed in Firefox. Open the Foxmarks settings, browse to the Advanced tab and add the following to your Bookmark URL:
https://yourdomain.com/user/foxmarks/foxmarks.json
- Browse to the Account tab and add your username and password from above (not the RSA passphrase).
- Browse to the Advanced tab and choose to Upload. After this, you should be able to sync.
- NOTE: Any other instances of Foxmarks on Firefox syncing to this account should choose Download under Advanced, rather than Upload.
Sync with iDisk using dotMac account
Tested with Firefox v2.0.0.14 and Foxmarks v2.0.46.9 on both Mac and PC.
1. Backup your Firefox bookmarks first
- In Firefox, go to Bookmarks > Organize Bookmarks
- Click on File > Export
- Save
2. Manually upload your bookmarks to .Mac iDisk using Foxmarks
- Install the Foxmarks plugin
- When the wizard comes up, hit cancel.
- Open the Foxmarks preferences by clicking on the Foxmarks logo found in the bottom right hand corner of your browser.
- In the "General" tab, under Account, type in your .Mac account name and password for the Username and password.
- Put a check mark under "Remember the password between sessions"
- Go to the "Advanced" tab
- Put a check mark next to "Use own Server"
- Under the URL type: https://idisk.mac.com/iDiskUsername/Documents/foxmarks.xml
- Under the Manual Overwrite section, click on "Upload"
Check to make sure that the foxmarks.xml file has been correctly uploaded by going to your iDisk and looking for the "foxmarks.xml" file in your Documents folder.
3. Setting up other computers to sync your bookmarks
- Install the Foxmarks plugin
- When the wizard comes up, hit cancel.
- Open the Foxmarks preferences by clicking on the Foxmarks logo found in the bottom right hand corner of your browser.
- In the "General" tab, under Account, type in your .Mac account name and password for the Username and password.
- Put a check mark under "Remember the password between sessions"
- Go to the "Advanced" tab
- Put a check mark next to "Use own Server"
- Under the URL type: https://idisk.mac.com/iDiskUsername/Documents/foxmarks.xml
- Either ....
Using FTP server with Foxmarks
LifeHacker has an article up discussing setting up Foxmarks to use an FTP server. Lots of good info.
The above site gives instructions for an older version of Foxmarks. Here are some basic instructions for use with newer versions of Foxmarks (e.g. v2.0.43).
There is a basic assumption you already have an established FTP server. Explaining how to setup an FTP server is way beyond the scope of these instructions.
Fill in your login information for your own FTP server on the "General" settings page. Then proceed to the "Advanced" page and click the "Use own server" check box. Add a URL to point to the location of your bookmarks save file in the edit box provided.
The basic URL format for using your own FTP server is as follows (leave out the quotes):
ftp://<hostname>/<pathname>/<filename>
examples:
ftp://myserver.homeip.net/bookmarks/filemarks.jim
or
ftp://192.168.1.125/mybookmarks
The first example places a file called "filemarks.jim" in the "bookmarks" subfolder. The second example creates a file called "mybookmarks" in the root folder assigned to your login credentials.
Preventing Foxmarks from checking for upgrades
For those who are using version 1.0.1 of Foxmarks with their own server, the auto-check in Firefox to update to the newest version can sometimes become annoying. To prevent this from happening follow these instructions:
- In Firefox, open
about:config(by typing that alone in the address bar) - Type foxmark in the search box and press enter, this shows all the configurations for foxmarks. If there is already a boolean value for
extensions.foxmarks@kei.com.update.enabledthen ignore the next step and move on to the last step. - Right click and select New and then Boolean from the submenu. For the name type in:
extensions.foxmarks@kei.com.update.enabled - Set the value of
extensions.foxmarks@kei.com.update.enabledtofalse(either as you create it, or modify the already existing one).
This will prevent Firefox from ever checking for an update to this extension. If you wish to update the extension at a later date, just open about:config again change the value of extensions.foxmarks@kei.com.update.enabled to true.



