A little corner of the Empire on the web.

Showing posts with label firefox. Show all posts
Showing posts with label firefox. Show all posts

29 April, 2010

Mozilla Weave Minimal Server Setup on Windows

So I've been following Mozilla's Weave project for while, and kept meaning to have a play with it. It's one of their experimental labs projects which recently came out of beta with a 1.0 release. Essentially it's a Firefox add-in that syncs and backs up a whole load of your settings and data back to a central server, including your bookmarks (and I have a lot!), saved passwords, preferences, history and open tabs. If, like me, you use more than one PC in more than one location then it's great knowing that Firefox is always setup how you like it wherever you are.

There are two parts to Weave; the Weave Firefox add-on (Weave is also available as an add-on for Mozilla's Fennec mobile browser), and the Weave server.

Most people install the add-on and sync their data back to Mozilla's Weave server, there's nothing wrong with that, all of your data is encrypted on your PC before it's sent to Mozilla's web server, so it's all secure and they have no way to access your private information. However you can also download the code for the Weave server and set it up on your own machine. Now, being that I have my own Windows Home Server* that's on 24/7 and accessible both within my home network and across the world via the internet I didn't really see the point in using someone else's server!

So I looked into it, and there are two options for installing your own Weave server there's the full server, which is a complex install and has all sorts of components that are only needed if you're going to act as a Weave server for many thousands of clients, or there's the Minimal Weave server, which has an incredibly simple server install (provided your machine already has all of the pre-reqs) and yet still implements the full Weave 1.0 API. Linux PCs are very likely already going to have most of the pre-reqs already installed (Apache web server and PHP for the Minimal server), Windows machines very likely won't.

I decided that as my Weave server is only ever going to be used by me, and possibly a few family members in the future, the simple install option sounded best! Particularly after I'd looked into it, and seen just how much effort was needed to install a full Weave server on a WHS box!

(Instructions on how to install an older version of the full Weave server on WHS are available on WeGotServed's wiki. note that this is for an outdated Weave version and won't SSL encrypt your traffic)

* A great little Tranquil PC SQA-5H series 1 server running MS Windows Home Server.


Stage 1: Setting up Weave Minimal server on Windows Vista

I don't like to mess up my server too much, it has a job to do, and does it well. I have a number of WHS add-ins installed, but have done the minimal amount of messing around on the server directly (and as a Microsoft certified server admin, this is against my nature ;). So to work it out, step one was to set Weave up on my Vista desktop, which luckily already happened to have a copy of Apache running, and I really don't care if this box gets messed up in the process!
Step by step instructions for how I did it are below.

Installing and configuring all required software for the Weave Minimal server:

  1. Download and install the Apache 2.2 web server (I cheated here as I already had Apache set up and working on my PC, stage 2 coming in a few days will have more detail for this step). Apache download page.
  2. Test Apache, point your web browser at http://localhost/ and make sure that you can see the Apache welcome page.
  3. Stop the Apache server -
    • Either using the Stop item in your Start menu under Apache HTTP Server -> Control Apache Server
    • Or by double-clicking the Apache 'feather' icon in your Windows system tray and clicking the Stop button in the Apache Service Monitor window that appears.
  4. Download and install PHP 5.2. Go to the PHP for Windows Download page scroll down to PHP 5.2 and click the Installer link under the VC6 x86 Thread Safe link. Run the installer, it will ask you the following questions after you Accept the licensing agreement:
    • Where to install PHP to, just accept the default that it offers you.
    • Select the web server you wish to setup: Select Apache 2.2.x Module.
    • Apache Configuration Directory, click Browse and go to C:\Program Files\Apache Software Foundation\Apache2.2\conf\
    • Ensure that the following Extensions are selected:
      • Extensions -> Multi-Byte Strings
      • Extensions -> PDO -> SQLite
      • Extensions -> SQLite
  5. Download the Weave Minimal server files from tobyelliott.wordpress.com/2009/09/11/weave-minimal-server/ unzip them using Winzip (or any other similar tool, Windows' built-in unzip tool can't unzip .tgz files) into a new folder called weave_minimal in the following folder: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs
  6. Open Apache's configuration file via Start -> All Programs -> Apache HTTP Server... -> Configure Apache Server -> Edit the Apache httpd.conf... and add the following line to it at the bottom:
    Alias /weave "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\weave_minimal\index.php"
  7. Start Apache
    • Either using the Start item in your Start menu under Apache HTTP Server -> Control Apache Server
    • Or by double-clicking the Apache 'feather' icon in your Windows system tray and clicking the Start button in the Apache Service Monitor window that appears.
  8. In Firefox go to http://localhost/weave/1.0/blah/info/collection if everything has worked you should see an "Authentication Required" box pop up, enter "blah" for the username and type anything as the password. The box will pop up again, just click Cancel, don't worry about this. You'll see a "File not found" web page, don't worry this is normal. Now if you go to the weave_minimal folder that you created earlier you should see a new file called weave_db this means that you now have your very own, working Weave server - well done!
  9. All that remains now is to create your user account(s) on the server and set up Firefox to talk to the server!

Setting up user accounts on the Weave server

Go to your weave_minimal folder that you created earlier in Windows Explorer, hold down the shift key and click the right-mouse button on a blank bit of the window, you should see a menu entry that says "Open Command Window Here" select that. Copy and paste the following line into the new window (Right-click -> Paste):

"C:\Program Files\PHP\php.exe" create_user

You can then press "c" to create your user and enter the desired username and password. Repeat for any further user accounts that you want to set up on your server.

Setting up Weave in Firefox to sync with your new server

  1. Install the Weave Browser SyncFirefox add-on from the Firefox add-ons website.
  2. Restart Firefox
  3. When Firefox starts up again it should take you straight to the Weave settings screen in Firefox's Options. Select Use a custom server from the drop-down menu. Fill out the boxes as below:
    • Server URL: http://localhost/weave/
    • User Name: The username you created earlier
    • Password: The password you created earlier
    • Click Sign In
  4. You'll be asked to type in a secret passphrase, you need to make a not of and remember this, it is a bit like a second password and is used to encrypt your data in Firefox before it is sent to the Weave server. You'll need to enter this and your user name and password when you set another copy of Firefox to sync with your Weave.
  5. If everything went well you should get a successful login and the Weave status at the bottom of your Firefox windows should show that it is successfully syncing
  6. Well done!
Next Steps

The server that we set up above is OK as a test server but is only accessible by Firefox on your one PC (or by other copies of Firefox on your home network if you enter the Server URL Weave's settings as your http://yourPCname/weave/ but it's not accessible over the internet at all. That's deliberate, the Minimal server doesn't encrypt your username and password as you login to Weave, these are sent over the network in clear text, not something you want to do over the internet.

Next time I'll be setting up Weave on my Windows Home Server box and taking advantage of the free dynamic domain name and free SSL encrypted connection that you get with WHS to allow me to connect to my Weave server over the internet using an SSL encrypted connection, so that my username and password are encrypted as they travel across the internet, and safe from anyone snooping.


Music that got me through this: The Orb - "The Orb's Adventures Beyond the Ultraworld, deluxe edition" playing on my Logitech Squeezebox Boom, classic, calming ambient house - just what I need.


Edited 16/5/2010 to correct the PHP version used.

18 June, 2007

Safari for Windows Update

An update to the previous post: Safari for Windows.

I'd like to say that the Safari 3.01 beta update fixed the problems with my curved borders mentioned in the the previous post, but I probably ought to stick my hand up and admit that uploading the updated CSS file that's been sitting on my hard disk for about 2 months is almost certainly what fixed it! So Safari's new border radius properties do actually work on Windows, and they really do look gorgeous, all anti-aliased and shaded, against Firefox 2's pixellated efforts, or IE 7's non-existent effort :).

However still some quite quirky UI issues:
I'm really not sure I like the way that the Preferences window shrinks and grows every time you change tabs, and the fact that it's all instant apply with no 'OK' or 'Cancel'.
Also the Mac-style window re-sizing is really beginning to wind me up, particularly as the cursor doesn't change to the 'double-headed' resize arrow until after you start dragging in the one place that actually works, so there's absolutely no clue which parts of the UI you can or can't grab to resize until after you click the mouse to try it!
And finally just noticed that clicking the File menu on a non-resized window (with my Classic XP style) gives a really ugly blocky overlap of the window edge.

11 June, 2007

Safari for Windows

So Apple have just released a beta of the "Safari 3 web browser for Windows!Windows Safari

First impressions are great, all my web sites, and my favourite sites seem to work well, and look beautiful. Text flowing around flowing objects is definitely better than Firefox 2 or IE 7. Text just looks great full stop.

Downsides, its a bit like when Apple first shoved all that brushed chrome theme stuff over Quicktime for Windows, its just not a Windows app at the moment. You can't drag window borders to resize, you can't even drag window corners (except for one in the bottom right).Windows Safari - menus with coloured borders Also if you're using XP with the Classic theme the menus are a bit messed up :).

Just remember to deselect all the stuff-ware that you don't want when you download and install it (the default download bundles Quicktime, and it tries to get you to install some network discovery tool as you install).

Hmmm seems to dislike my curved borders, even though I'd thought that I had the Safari CSS right, guess there's nothing quite like actually testing to find out what happens instead of just crossing your fingers and hoping!

Via Asa and Burnt Electrons.

UPDATE 18/6/07, see the follow-up post.

20 December, 2006

ServiceCenter/Firefox Printing Redux

Some may remember this post from back in July when I was having trouble printing from a web app after upgrading from Firefox 1.0x to Firefox 1.5. Wherein I laid out a way to fix the problem using a custom usercontent.css file, and also logged a bug on the Mozilla Bugzilla system.

Well it looks like its come to an end! Not with today's Firefox 2.0.0.1 update, as you might imagine. But the latest 'Minefield' (Firefox 3 alpha) builds have the new "reflow" changes (from Dbaron's bug 30030) in them.

And it works!!

So now we just need to wait for Firefox 3's release and the whole world can feel the love!

27 July, 2006

Unisys ServiceCenter Firefox printing fix

For anyone still living in Unisys-land (aren't I glad they're not filling out my wage slip any more smile ), and for anyone else forced to use their "idiosyncratic" (read shite) web tools here's a little something.

If you've been forced to use the web (ie HTML not Java) version of their (Peregrine-based) ServiceCenter tool, you'll notice that its dog-slow if you're using IE and has a whole myriad of intermittent problems. The obvious, and really quite effective, solution is to use Firefox. This speeds up ServiceCenter measurably and seems to get around most of the other problems.

Or at least it used to. Firefox v1.0 to v1.08 all work absolutely perfectly, but Firefox 1.5 introduced one teeny-weeny and yet show-stopping printing bug that stops you from being able to print any useful info from ServiceCenter (technical details here in Mozilla bug 326162 if you're interested). Unfortunately according to the recent Firefox 2 beta release it doesn't look like it'll be fixed in Firefox 2 when that's released , and checking Firefox trunk (the ongoing work to create the not even alpha yet Firefox 3) the bug actually looks even worse at the moment.

So after reading this page on creating your own "user stylesheets" in Mozilla and this page that mentions a new experimental CSS rule, I put two and two together and actually came up with four for once!

So here's how to get Unisys ServiceCenter printing correctly in Firefox versions 1.5 and newer:

  • Download a recent version of Firefox
  • Run it
  • Close it
  • Find your Firefox profile folder (see here if you can't find your profile folder, and bear in mind that your profile may be in a Windows network roaming profile, or may be on your C drive).
  • Inside your Firefox profile folder look in the "Chrome" folder
  • Do you have a file in there called "userContent.css"? If so, open that file in Notepad, if not create a new text file with that name and then open it in Notepad.
  • Paste the following text into the "userContent.css" file:
    
    /* Fix b0rked ServiceCenter printing in Firefox 1.5+
    see Mozilla Bug 326162 https://bugzilla.mozilla.org/show_bug.cgi?id=326162 */
    
    @-moz-document domain(www.sc-ps.unisys.com){
    div.labl, div.val { overflow:visible !important; } }
    
  • Save the file
  • Open Firefox
  • Re-visit ServiceCenter and try printing a ticket out
  • Send me thanks, adoration, first-born children, money or just leave me a comment below saying how it worked out for you (actually forget the first-born children I wouldn't have a clue what to do with them).

One final note, Unisys have been known to change the server these web apps are on periodically, if so you need to edit the bit that says domain(www.sc-ps.unisys.com) to reflect the new server name. This may or may not work for other company's Peregrine web interfaces, may be broken at some point in the future by an upgrade to the website or to FIrefox, YMMV). Also this Mozilla bug may be fixed at some point in the future, so at that point you can safely delete the above lines from Firefox's userContent.css.

01 November, 2005

So, Javascript is a workable programming language!

I've used a fair bit of JavaScript code in the past to add client-side flourishes to web-pages and build simple, calculator-style apps, but I've never really done anything very complex with it before.

I think that probably the last time that I tried writing any serious kind of an app using JavaScript was back in the Netscape 3/IE 3 days, and it was very, very painful. Since my apparently futile attempts to work around myriad browser bugs, implementation differences, browser differences, DOM differences (not that I even really knew what a DOM was then, did people call them that then?) and so on, I've stuck to simple work with form boxes, style changes and simple things like that.

Then came the MSN Messenger World's Best App competition, and I'm suddenly in the middle of building a really fairly complicated platform for building simple multi-player internet games, and I'm doing it all in JavaScript. Well, I might eventually build in a bit of server-side persistance with Perl, but that's going to be completely independent of the client-side bits and only really for providing the icing on the cake (I'm even thinking of implementing save-game client-side rather than saving on the server).

So obviously one of my first unconscious choices was, just how hard can I make this for myself? Well to answer that I took a look at my favourite web testing platform: Gecko/Mozilla and realised I couldn't do without all the amazing development, testing and debugging tools it gives you, and decided that I was going to make the core of the program totally cross-browser (obviously this can only go so far with an app that is going to eventually use the MSN Messenger API for cross-internet comms, but I'll be going right up to that line). So we have hurdle one, it must work in both IE5 & 6 (as per competition rules), and Mozilla (to allow me to use my favourite tools) and also Opera (as I didn't feel like leaving it out)!

Next choice, if I'm going to make it run on all three web browsers it had better use standards as far as humanly possible (so that theoretically compatibility should just work, no giggling at the back there!), and if I'm going to code it to W3C/ECMA standards, then there's no point in going half-measures, so no browser specific coding allowed. If it's being coded to standards, without any browser-specific code, then why not pick a decent standard? So XHTML 1.1 loose it is (and by that I mean also testing with an XML MIME type to trigger the totally intolerant strict XML processing mode in Mozilla browsers).

Quick summary of choices made simply to make my life harder, but also more challenging and interesting:

  1. All parts not dependant on the MSN Activity API must work in:
    • IE 5 & 6
    • Mozilla/Firefox
    • Opera
  2. Stick to standards, no browser specific hacks or code paths
  3. XHTML 1.1 loose doctype
  4. Must also work when served to Mozilla with an XML MIME type.

So, I'm not getting much sleep lately!

22 October, 2003

Extensions I have browsed

A follow up to a previous post on my favourite Mozilla (and other Gecko browser) extensions.

Just put Mozilla Firebird 0.7 on my laptop, and I've noticed that the style sheet switcher that I used to add in as an extension is now included by default. Excellent! Hopefully this will encourage a few more web sites to take advantage of alternative styles, and show us what they can do.

So now that I don't have to install that any more, what extensions should I use? Well I took a quick trip over to the Mozilla Firebird Extensions page to have a look around.

So what have I installed now?

  • Well first had to be the Link Toolbar that restores (and enhances) the link toolbar found in the main Mozilla suite.
  • Second, the Live HTTP Headers, a great tool for anyone who writes server side web applications, because they don't always work perfectly and this is just the best and easiest way to debug so many problems.
  • I've been getting into RSS quite a bit lately, and until I get around to writing my own web-based RSS reader, then the RSS Reader Panel is simply the most convenient way to keep up with events.
  • Text Links is great for extracting URLS from so many different places where people don't bother linking them, or mess it up (a couple of forums I visit and a couple of email newsletters I get).

And I think that's my lot for the moment, all installed and ready for action!