Configuring MOWES on a USB Stick

There’s an old saying that you can neither be too thin  or have too much money.  I’d like to add to that list – you can’t have too many web servers available on your PC.   For the non-geeks amongst you, a web server is a program that runs on a computer to ‘serve up’ web pages.  because I write web software for part of my living, I run my own web server on my PC.  Actually, that’s not quite true…because there are two main web servers used today – Microsoft’s IIS and Apache – I have two.  And today I decided that it would be really useful to have a web server and associated software on a USB stick that I could plug in to computers to demonstrate my web applications out on client sites.

I decided to use the MOWES installation – after all, it’s designed to run on USB sticks – and as well as the standard Apache, PHP and mySQL I decided to also install Mediawiki and WordPress.  As well as being used for demonstrations, I decided that I’d also like to have a portable Wiki to use for note taking / book research when I’m on my travels, and run a demonstration instance of WordPress.

Installation

The simplest installation involves putting a package together on the MOWES website, downloading it to your PC and installing it.  To get started with this, Google for MOWES and select what you want to install.

NOTE – when this post was written I pointed to a particular site.  That site – chsoftware.net – now reports back as a source of malware, so I’ve removed the link.

For my purposes I chose the full versions of Apache, mySQL 5 , PHP5,  ImageMagick, Mediawiki, WordPress, and phpMyAdmin.  This selection process is done by ticking the displayed checkboxes – if you DON’T get a list of checkboxes for the ‘New Package’ option, try the site again later – I have had this occasionally and it will eventually give you the ‘ticklist’ screen.

Tick the desired components and download the generated package.

Plug in your USB stick, and unzip and install the MOWES package as per their instructions.  First thing to note here is that you may need to keep an eye on any requests from the computer for allowing components access to the firewall.  The default settings will be Port 80 for the Apache web server and 3306 for mySQL.  If these aren’t open / available – especially the mySQL one – then the automatic install of the packages by the MOWES program will fail miserably.

Once you have the files installed on your memory stick, then you can configure them.

Configuration

If you never intend to run the installation on any PC that has a local Web Server or instance of mySQL, then you don’t need to do anything else in terms of configuration.  You might like to take a look at ‘Tidying Up’ section below.

If you ARE going to use the USB Stick on PCs that may have other web servers or mySQL instances running, then it’s time to come up with a couple of ports to use for your USB stick that other folks won’t normally use on their machines.  The precise values don’t matter too much – after all, the rest of the world won’t be trying to connect to your memory stick – but be sensible, and avoid ports used by other applications.

I eventually chose 87 for the Apache Web Server, and 4407 for mySQL – 87 fitted with my own laptop where I already have a web server at Port 80 and another one at Port 85, and I run mySQL at the standard port of 3306.  NOTE that if you run the installation using an account with restricted privileges, you may not be able to open the new ports you use.

In order to configure the MOWES installation you’ll need a text editor of some sort – Windows Notepad will do at a push.  You’ll be editing a couple of files on the USB stick, as follows:

apache2\conf\httpd.conf

Open this file up and look for a line starting with Listen.  Change the number following it to the number you’ve chosen for your Apache Port – e.g. 87.

Now look for ‘ServerName’ – change the line to include the Port number – e.g. localhost:87

php5\php.ini

Open this file and find the line starting mysql.default_port.  Change the port referenced in this to the Port you have chosen for your mySQL installation.  E.g. mysql.default_port=4407

mysql\my.ini

Open the file and look for two lines like port=3306.  Change the port number to the one you have chosen – e.g. 4407 – port=4407.  There will be two lines like this in the file, one in the [client] section and one in the [server] section.

www\phpmyadmin\config.inc

This is the configuration file for the phpMyAdmin program that provides a graphical user interface on to the mySQL database.  Look for a line that starts with : $cfg[‘Servers’][$i][‘port’] and replace the port number in the line with (in this example) 4407.

And that, as they say, is that for the configuration files.  You can now start up the MOWES server system by running the mowes.exe program.  If all is working, after a few seconds your web browser will be started and will load the ‘home page’ of the MOWES installation.  With the configuration carried out in this article, the browser will show the url http://localhost:87/start/ and the page displayed will show links to WordPress, Mediawiki and phpmyadmin.

WordPress Configuration

The final stage of configuration is to make a change to WordPress that allows WordPress to run on a non-standard Apache port.  This needs to be done via phpmyadmin, as it involves directly changing database entries.  Open phpmyadmin, and then open the wordpress database from the left hand menu.

Now browse the wp_options table.  Find the record where option_name is ‘siteurl’ and change the option_value field to (for using a port number of 86) http://localhost:86/wordpress.  Now find teh record with option_name of ‘home’ and again change the option_value to http://localhost:86/wordpress.

Tidying Up

You may like to put an autorun.inf file on the root of your memory stick, so that when it is plugged in to a machine it will automatically start the MOWES system (if the machine is so configured).  The file can be created with a text editor and should contain the following:

[autorun]
open=mowes_portable\mowes.exe
label=Your Name for the Installation

And that’s that!

Enjoy!

A quick guide to blog spam…

I’ll soon be hitting a landmark on Joe’s jottings – 10,000 spam posts caught by the Akismet spam trapping plug-in for WordPress.  Not at all bad going – I would advise anyone who runs a WordPress Blog to get their hands on this very useful piece of kit!  Anyway – I saw a comment posted by another blogger that made me wonder about ‘spam spotting’ in general, especially as I’ve seen a number of spam posts that are plausible enough to look like a ‘real’ comment sneak through Akismet (not many – about 2% in total) in to my moderation queue, and I’ve also seen quite a few comments on other blogs that are clearly spammy.

So, here’s a few thoughts as to keeping your Blog spam free!

  1. First of all – why bother?  The simple answer is that if you allow spam posts to appear in your blog comments then it gives the impression that you don’t care enough to keep the spammers at bay.  I’ve set my blog up so that all comments need to be moderated / checked before they show up on the live blog.
  2. Use a good spam-trap like Akismet.  It save so much trouble and effort and is well worth it – and it’s free for personal use.  There’s no excuse! It isn’t perfect – it will sometimes allow stuff through in to your comment queue which you then need to check out. 
  3. When you get comments in your comment queue, it’s worth looking at the email address.  My general rule of thumb is that if the mail comes from a .ru address, or just looks ‘unusual’, I bin it, irrespective of what the actual comment is.  This may sound rather ruthless but I’ve yet to have a single real comment from an .ru email address, so I can’t be bothered to spend brain cells on it.
  4. Take a look at the relevance of the comment made against the article on which the comment is givn.  Some spammers apply ‘generic’ comments such as ‘great post’ to everything – don’t be deceived – take a look at the email adderss and any link.  Don’t necessarily click on the link – you have no idea what’s on the other end of it.
  5. Some comments may be of the form ‘How did you get this template working?  Please mail me and let me know how.’  Occasionally these even have sensible looking email addresses, but I NEVER reply to a comment on my blog through email.  Basically it’s just a way for the spammers to get a ‘live’ email address from you.
  6. A general piece of advice is to be wary of any comment that is complimentary or that is in bad English or just a single sentence of the ‘I agree with this post’.  ‘I agree’ posts add little to debate around posts on a blog anyway – if the person is genuinely commenting they’ll tend to put a little more on to the comment.  Some comments are in incredibly poor English – even if they’re not spam, I bin them as they just look poor on the comment list for an article.
  7. If you do get comments that are spam, and that have escaped the attention of your spam filter, please ensure you report it as spam using whatever ‘report spam’ options are available in the spam filter you’re using – that way you’ll be contributing to improving the quality of spam filtering.

And there you go!  May you be spamless!

Link Listing in WordPress

WordPress supports the ‘Blogroll’ model for links, which works fine for links but I wanted to be able to put together a series of pages listing links on different subjects for my CommunityNet project.

For example, I wanted to have links grouped into such topics as ‘Think Tanks’, ‘Animal Welfare Groups’, etc.  I couldn’t work out a way of doing this in a manageable fashion through the existing WordPress functionality.  I had a look around for Plugins but found nothing that seemed sensible for what I wanted, so I decided to ‘homebrew’. 

Continue reading

WordPress Template Pages

I use WordPress to run a few other websites, such as my CommunityHost site, and wanted to add a form to support a mailing list.  My hosting company, Servage, supports mailing lists and I’ve used them with some success, so I didn’t need to re-invent the wheel and decided that the best bet would be to somehow get the HTML form that Servage supply on to a WordPress page.

I did try the obvious – just paste the HTML source code in to a page – and that was about as effective as the proverbial cat flap in an elephant house.  So I then decided to create a new template page containing the code.  And for all who’re interested, here’s what I did in Version 2.3.x.

Continue reading

Web’n’Walk to the Rescue

Well, BT decided to throw some sort of unholy wobbly on me this evening and I ended up being unable to contact numerous sites I regularly use (including this Blog) and also experienced extremely slow performance on other sites and mail servers.

The irony was that I couldn’t actually get to BT’s ‘Service Status’ page – it kept timing out – which I guess gave some indication of where the problem lay.

Continue reading