Setting up a test web server on Ubuntu
1st November 2007Installing all the bits and pieces is painless enough so long as you know what's what; Synaptic does make it thus. Interestingly, Ubuntu's default installation is a lightweight affair with the addition of any additional components involving downloading the packages from the web. The whole process is all very well integrated and doesn't make you sweat every time you need to install additional software. In fact, it resolves any dependencies for you so that those packages can be put in place too; it lists them, you select them and Synaptic does the rest.
Returning to the job in hand, my shopping list included Apache, Perl, PHP and MySQL, the usual suspects in other words. Perl was already there, as it is on many UNIX systems, so installing the appropriate Apache module was all that was needed. PHP needed the base installation as well as the additional Apache module. MySQL needed the full treatment too, though its being split up into different pieces confounded things a little for my tired mind. Then, there were the MySQL modules for PHP to be set in place too.
The addition of Apache preceded all of these, but I have left it until now to describe its configuration, something that took longer than for the others; the installation itself was as easy as it was for the others. However, what surprised me were the differences in its configuration set up when compared with Windows. There are times when we get the same software but on different operating systems, which means that configuration files get set up differently. The first difference is that the main configuration file is called apache2.conf
on Ubuntu rather than httpd.conf
as on Windows. Like its Windows counterpart, Ubuntu's Apache does use subsidiary configuration files. However, there is an additional layer of configurability added courtesy of a standard feature of UNIX operating systems: symbolic links. Rather than having a single folder with the all configuration files stored therein, there are two pairs of folders, one pair for module configuration and another for site settings: mods-available/mods-enabled and sites-available/sites-enabled, respectively. In each pair, there is a folder with all the files and another containing symbolic links. It is the presence of a symbolic link for a given configuration file in the latter that activates it. I learned all this when trying to get mod_rewrite going and changing the web server folder from the default to somewhere less susceptible to wrecking during a re-installation or, heaven forbid, a destructive system crash. It's unusual, but it does work, even if it takes that little bit longer to get things sorted out when you first meet up with it.
Apart from the Apache set up and finding the right things to install, getting a test web server up and running was a fairly uneventful process. All's working well now, and I'll be taking things forward from here; making website Perl scripts compatible with their new world will be one of the next things that need to be done.
Ubuntu: an appraisal of hardware support
31st October 2007After a painless start with Ubuntu, I have been able to overcome the obstacles placed in my way thus far. In fact, it is certain to yield a goodly number of blog posts, never a bad thing from my point of view. And so to this instalment...
For this post, I'll stick with the hardware side of things. Compared with previous voyages into the Linux universe, I have not encountered any "brick walls" placed in my path. Though audio support was one bugbear in the past, Ubuntu simply took care of that with no intervention from me. Then, I popped in a CD and music was played back to me, leaving me with the same confidence with MP3 files. In the same way, graphics were set up to my liking with having to lift a finger; while there is a proprietary ATI driver available, I'll stick with the standard set up since it easily works well enough for me. Printer set up needed a prod from my end, but it got on with things and found my HP LaserJet 1018 with nary a bother and all was set up rapidly. All other items of hardware but one scarcely merit a mention, so seamless was their detection and set up.
The one piece of hardware that made me work was my Epson Perfection 4490 Photo scanner. Though it wasn't supported out of the box, a spot of googling was all that it took to find out how to set things to rights. In fact, the best answer turned out to be on Ubuntu's forum, hardly a surprise really. The step-by-step instructions sent me over to Epson's repository of open source Linux drivers for the correct files; I did need to make sure I wasn't selecting 4990 in place of 4490, a straightforward thing to do. I snagged Debian RPM's and used alien to convert them to DEB files. Running dpkg as root did the installation and quick checks with the sane-find-scanner
and scanimage
commands revealed that all was well, to my clear relief.
Hardware support has always been an Achilles heel for Linux but, based on this experience, the Linux community seem to be more on top of it than ever before. The proprietary nature of the devices is an ever present challenge for driver developers, so getting as far as they have is an impressive achievement. It's a long way from roadblocks due to tempestuous support of modems, sound cards, printers and scanners and I seem to have got over the biggest hurdle on my Linux journey this time around.
A move to Ubuntu?
30th October 2007After a pretty rotten weekend attempting to keep Windows XP running, I finally lost the will to persevere and began yearning for stability. That has taken me into the world of Ubuntu; I am writing this in Firefox running on the said Linux distribution. Thanks to the wonders of VMware, I have been able to observe the swish and slick nature of Ubuntu, and I must that it did sway me. Installation has been slick and efficient and is a dream compared to XP, let alone previous Linux incarnations that I have encountered over the years. Start up is also speedy. All in all, there appears to be a certain confidence about the OS that was sadly absent from my Windows experience in recent times.
Still, I am not deserting the world of Windows completely, though. As it happens, I installed Ubuntu on a spare hard drive that I had, so the Windows installation is still out there. In addition, VMware virtual machines should allow me to stay in there without the ever present risk of a PC getting rendered inoperable. There is also the unfinished business of making myself at home on Ubuntu, hopefully without my wrecking anything. I have yet to give my hardware a full workout to check that all is well. Setting up a web development capability is also on the cards, as is getting those virtual machines. Assuming that there are no showstoppers, it could be an interesting ride.
One mouse at a time please…
29th October 2007I am referring to computer pointing devices, of course. Though his may sound a daft thing to do, I have two mice attached to my main PC. One is my ergonomic Evoluent, a device that I am growing to like a lot. To explain the set-up of the other mouse, I am going to have to say that I use a Belkin OmniCube 2-port KVM switch so that I can have two PC's controlled with the same keyboard, mouse and screen: the main machine and a backup for when things go awry. To the switch, I have attached the base unit for a Logitech MX700, my usual mouse at home until my hand troubles began (the symptoms now seem to be easing, thankfully).
Strangely, I cannot just have the KVM cable for the keyboard attached to my main computer, or the keyboard itself seems to lose contact. Alternatively, I cannot seem to get the KVM switch to recognise the Evoluent either. The result is that I two mice attached to a PC and the thing will not boot up in those circumstances. Unplugging the Evoluent and doing a cold boot seems to do the trick; the wonders of USB mean that I can always hook it up when all is running fully. I still must sort out my set-up, though...
More digital than film?
26th October 2007Despite the rampant progress of digital photography, I have continued to stick with film and sit astride the fence. While that is something that I wish to continue, my most recent trips into the outdoors have seen me use my Pentax K10D exclusively. That, however, could be something to do with the subject matter.
My most recent trot took me into what might be described as featureless moorland, a tricky subject to capture in the best way. So, possibly because of the lesser likelihood of success, I stuck with digital since any lack of success costs less. Previous trips took me out and about locally where I live and where I seem more likely to use digital, possibly because I have been around the area a lot with my film camera anyway. Also, the vistas, as pleasant as they are, do not possess the drama of the likes of Highland Scotland, the English Lake District, or the mountainous parts of North Wales.
A simple to create a batch file running a load of files one after another
25th October 2007Repairing Windows installations like I have had to do all too often in the last few weeks means that I have a load of updates that need to be performed. My preference for using Shavlik NetChk Protect that I have a folder full of executable path files. That encapsulates the first step: creating a folder and adding the files that you want to run. The next step is to run a command like this:
dir /b * > exec.bat
The /b
is the switch that gives a bare file list and that is stored in exec.bat. Running exec.bat affords a bit more automation. While it is that this might need a spot more sophistication to be truly automatic, it's still a good start.
Evaluating an ergonomic mouse
24th October 2007Recent hectic mouse work has left my right hand feeling the worse for wear, so a recent opportunity to try out a colleague's Evoluent VerticalMouse 3 was one that I took up. I gave it a go for a day, and it left me impressed enough to go out and order one for myself. It's not a cheap item, with some selling for a smidgen less than £60 and others selling for significantly more than this. Also, it is a handed item; the latest version is available to right-handers like myself, along with an earlier one for lefties. While It will work with Windows 2000, the supplied software is for XP and later.
The idea behind the gadget is intriguing: rather than having your hand held parallel to your desk as with a conventional mouse, you have it almost perpendicular to it. The claim is that when you have your arm this way, it is less likely to get tired. The arrangement may sound as if it might not work, yet it does in practice: your thumb is the anchor for the hand and the little finger (lúidín in Irish) rests on a little ledge that stops it getting dragged along either the mouse mat or the surface of the desk. This arrangement does allow you to relax your hand on the mouse. You get the usual mouse functions plus extra buttons that you can use to go back and forward through web pages; even without installing the included software, you get these. However, I have observed drift of the mouse cursor across the screen of my home PC when the unit is not being moved around. At first, I wasn't sure what was causing this, but it now appears to be the mouse mat that I was using. I'll continue to give it a go.
Update: a mouse such as this really needs you to rest your arm on the desk for it to be at its most helpful. Though that's fine for work, my home set up had me stretching my arm and that leads to a lot of discomfort. That isn't the fault of the mouse: it is actually telling me something useful. The primary cause is a pull-out keyboard drawer that I have to use due to a lack of space on the desk itself. So, I raised my full tower computer case a little from the floor and now use that as a platform for the mouse. While I know that it's an unconventional approach, it seems to be working so far, and I can make further adjustments if needs be...
Is computer mousemat wrist support a waste of time?
23rd October 2007It is an occupational hazard for those who use computers a lot that they feel twinges in their wrists, hands, fingers and forearms. I, for one, have to admit that I end up getting my continual warnings. Previously, this has taken the form of wrist fatigue, weakness and discomfort and mouse mats with wrist support have taken pride of place on computer desks frequented by my person. Keyboard wrist supports have been another staple when at my workplace.
More recently, I have been exposed to a new bespoke-built application at work and its testing has meant a lot of intensive mouse work, and it can be very repetitive. The can take its toll, and my fatigued fingers have been enough to make me speak to the occupational health department at work. To their credit, they recognise the issues, and I am getting some advice from a physiotherapist. The obvious resolution is of course the very one that you can never do as much as you want when you are an application developer: rest from computer-related activities. I work with someone for whom rest has not worked, and his problems have made him ambidextrous; I am right-handed and find it tricky to use a mouse with my left, but that's what he has mastered. Exercises are another necessity; vigorous hand shaking together with wrist rotations and stretches are among those that I have been told to do every thirty minutes while using a PC. I don't know how that appears to my work colleagues, but it sounds like something that could look a little odd to those not in the know. Anything has to be better than doing permanent and lasting damage...
Doing daft exercise is fine in the comfort of one's own home, though, and that brings me to another point: you cannot just concentrate on your work set up and forget about that at home. Spending hours playing computer games on a dining table and seated on a dining room chair is never going to help your cause; that's not something that I have ever done, but it's a story that I have heard. I have certainly made some adjustments so that my wrist and arm are level with one another; the latter was likely to be inclined at an angle at times, with some strain on the wrist. Nine years go, I have had an inappropriate chair adding to the discomfort of pulled back muscles, so my current home computer chair became a required acquisition, from Argos as it happened. It performs sterling service, but that has not stopped me wondering about one with armrests, but that could be down to my using a computer desk with a roll-out keyboard shelf.
Another key piece of advice is to relax my hand on the mouse and for that, you need to set up your desk properly. Many problems are caused by the habit of holding the palm of one's hand in thin air over a mouse, and my long fingers make the practice easier to do than it should be. Having a mouse with wrist support exacerbates the situation and I have come to the conclusion that I need my wrist resting directly on the desk and that allows my arm to move the mouse too and not just my wrist. That allows me to rest the palm of my hand and my fingers on the mouse. It appears to be better for me, but it leaves one question: how did wrist supports get added to mouse mats in the first place? Saying that, I am not in a position to question the use of keyboard wrist supports, but typing has never been known to cause me any real problems.
Firefox spell checking: getting rid of a mispelling from your dictionary.
22nd October 2007Mozilla Firefox includes a spell checker and, like any such function, it offers a chance to add words to a custom dictionary. Of course, you can also add misspellings too, and these definitely need to be removed. With Word, it's a matter of looking for custom.dic
and deleting the nefarious item. With Firefox, it's similar, at least on Windows anyway. The file that you need to edit is persdict.dat
which you'll find it in C:\Documents and Settings\[user name]\Application Data\Mozilla\Firefox\Profiles\[random name].default
. My search for the relevant information took me over to Lifehacker.
Update 2012-12-11: For users of Linux, the location of the above file is as follows: /home/[user id]/.mozilla/firefox/[random name].default
. Once you find persdict.dat
in there, the required editing can be performed.
Repairing Windows XP
21st October 2007I have been having an accident-prone time of it with Windows XP recently, and have had plenty of reason to be thankful for the ability to perform a repair installation. Here are the steps:
- Pop the installation disk into your PC's DVD drive and reboot the PC.
- If you have your PC set it up to boot from DVD's in its BIOS, then you at least will have the option to do this. You may find that this happens by default, but I needed to tell it to do the deed.
- Select normal installation from the first menu that is presented to you by the installer.
- Accept the licence agreement.
- Press R at the next menu and that'll repair the installation.
- Follow all the menus from there on; it'll be all the usual stuff from here on in, and there should be no need to reactivate Windows or reinstall all of your other software afterwards.
There is a repair option on the first screen (step 3 above) but this takes you into the dark recesses of the command line and isn't what I was needing. I do have to say that they do leave the required option late on in the installation process and that assumes on users having a risk taking streak in them, something that definitely does not apply to everyone. If your boot.ini file is not well, you may find yourself needing to do the full installation and that wipes the slate clean for you, extending the recovery process.