Installing WordPress on a Mac

The software platform which markwilson.it runs on is in desperate need of an updated but there is only me to make it happen (supported by ascomi) and if I make a mistake then it may take some time for me to get the site back online (time which I don’t have!). As a result, I really needed a development version of the site to work with.

I thought that it would also be handy if that development version of the site would run offline – i.e. if it were served from a web server on one of my computers. I could run Windows, IIS (or Apache), MySQL and PHP but as the live site runs on CentOS, Apache, MySQL and PHP it makes sense to at least use something similar and my Mac fits the bill nicely, as a default installation of OS X already includes Apache and PHP.

I should note that there are alternative stacks available for running a web server on a Mac (MAMP and XAMPP are examples); however my machine is not a full web server serving hundreds of users, it’s a development workstation serving one user, so the built in tools should be fine. The rest of this post explains what I did to get WordPress 2.7 up and running on OS X 10.5.5.

  1. Open the System Preferences and select the Sharing pane, then enable Web Access.
  2. Web Sharing in OS X

  3. Test access by browsing to the default Apache website at http://computername/ and a personal site at http://computername/~username/.
  4. Download the latest version of MySQL Community Server (I used mysql-5.1.31-osx10.5-x86_64) and run the corresponding packaged installer (for me that was mysql-5.1.31-osx10.5-x86_64.pkg).
  5. After the MySQL installation is completed, copy MySQL.PreferencePane to /Library/PreferencePanes and verify that it is visible in System Preferences (in the Other group).
  6. MySQL Preferences in OS X

  7. Launch the MySQL preference pane and start MySQL Server (if prompted by the firewall to allow mysqld to allow incoming connections, allow this). Optionally, select automatic startup for MySQL.
  8. MySQL running in OS X

  9. Optionally, add /usr/local/mysql/bin to the path (I didn’t do this, as creating a .profile file containing export PATH="$PATH:/usr/local/mysql/bin" seemed to mess up my path somehow – it just means that I need to specify the full path when running mysql commands) and test access to MySQL by running /usr/local/mysql/bin/mysql.
  10. Enable PHP by editing /etc/apache2/httpd.conf (e.g. by running sudo nano /etc/apache2/httpd.conf) to remove the # in front of LoadModule php5_module libexec/apache2/libphp5.so.
  11. Test the PHP configuration by creating a text file named phpinfo.php containing <?php phpinfo(); ?> and browse to http://localhost/~username/phpinfo.
  12. With Mac OS X, Apache, MySQL and PHP enabled, start to work on the configuration by by running /usr/local/mysql/bin/mysql and entering the following commands to secure MySQL:
    drop database test;
    delete from mysql.user where user = '';
    flush privileges;
    set password for root@localhost = password('{newrootpassword}');
    set password for root@127.0.0.1 = password('{newrootpassword}');
    set password for 'root'@'{hostname}.local' = password('{newrootpassword}');
    quit
  13. Test access to MySQL. using the new password with /usr/local/mysql/bin/mysql -u root -p and entering newrootpassword when prompted.
  14. Whilst still logged in to MySQL, enter the following commands to create a database for WordPress and grant permissions (I’m not convinced that all of these commands are required and I do not know what foo is!):
    create database wpdatabasename;
    grant all privileges on wpdatabasename.* to wpuser@localhost identified by 'foo';
    set password for wpuser@localhost = old_password('wppassword');
    quit
  15. Download the latest version of WordPress and extract it to ~username/Sites/ (i chose to put my copy in a subfolder called blog, as it is on the live site).
  16. Configure WordPress to use the database created earlier by copying wordpressdirectory/wp_config_sample.php to wordpressdirectorywp_config.php and editing the following lines:
    define('DB_NAME', 'wpdatabasename');
    define('DB_USER', 'wpuser');
    define('DB_PASSWORD', 'wppassword');
    define('DB_HOST', 'localhost:/tmp/mysql.sock');
  17. Restart Apache using sudo apachectl restart.
  18. If WordPress is running in it’s own subdirectory, copy wordpressdirectory/index.php and wordpressdirectory/.htaccess to ~/Sites/ and then edit index.php so that WordPress can locate it’s environment and templates (require('./wordpressdirectory/wp-blog-header.php');).
  19. Browse to http://localhost/~username/wordpressdirectory/wp-admin/install.php and follow the “five minute WordPress installation process”.
  20. WordPress installation

  21. After installation, the dashboard for the new WordPress site should be available at http://localhost/~username/wordpressdirectory/wp-admin/.
  22. WordPress fresh out of the box (dashboard)

  23. The site may be accessed at http://localhost/~username/wordpressdirectory/.
  24. WordPress fresh out of the box

Credits

I found the following articles extremely useful whilst I was researching this post:

As XenServer goes free, new management tools are promised, and VMware gets another thorn in its side

I may be a Microsoft MVP for Virtual Machine technology so my bias towards Hyper-V is pretty obvious (I’m also a VMware Certified Professional and I do try to remain fairly objective) but I did have to giggle when a colleague tipped me off this morning about some new developments at Citrix just as VMware are gearing up for next week’s VMworld Europe conference in Cannes.

Officially under embargo until next week (not an embargo that I’ve signed up to though), ZDNet is reporting that Citrix is to offer XenServer for free (XenServer is a commercial product based on the open source Xen project). From my standpoint, this is great news because Citrix and Microsoft already work very closely (Citrix developed the Linux integration for Hyper-V) and Citrix will be selling new management tools which will improve the management experience for both XenServer and Hyper-V but, in addition, Microsoft SCVMM will support XenServer (always expected, but never officially announced), meaning that SCVMM will further improve its position as a “manager of managers” and provide a single point of focus for managing all three of the major hypervisors.

VMware, of course, will respond and tell us that this is not simply a question of software cost (to some extent, they are correct, but many of the high-end features that they offer over the competition are just the icing on the top of the cake), that they have moved on from the hypervisor and how their cloud-centric Virtual Datacentre Operating System model will be the way forward. That may be so, but with server virtualisation now moving into mainstream computing environments and with Citrix and Microsoft already working closely together (along with Novelland now Red Hat), this is almost certainly not good news for VMware’s market dominance.

Further reading

Windows 7 feature walkthoughs

I’ve just come across a link to a section on the Microsoft TechNet website with walkthroughs for new features in Windows 7. If you’re looking to get up to speed on the next version of Microsoft’s client operating system then these videos might be worth a look (there is an RSS feed to keep up-to-date with new releases).

These videos are not the same series as the “how to” videos I have been producing for TechNet (one of which was featured in the TechNet newsletter last week!) but are actually from the Springboard series.

Spending money to increase organisational agility at a time of economic uncertainty

Last week I attended a Microsoft TechNet event in Birmingham, looking at Microsoft systems management and the role of System Center. The presenter was Gordon McKenna, who has a stack of experience with the System Center products (in particular System Center Operations Manager, for which he is an MVP) but had only a limited time to talk about the products as the first half of his session was bogged down in Microsoft’s Infrastructure Optimisation (IO) marketing.

Infrastructure optimisationI’ve written about IO before and, since then, I’ve found that the projected savings were often difficult to relate to a customer’s particular business model but as an approach for producing a plan to increase the agility of the IT infrastructure, the Microsoft IO model can be a useful tool.

For me, the most interesting part of Gordon’s IO presentation was seeing the analysis of over 15,000 customers with more than 500 employees who have taken part in these studies. I’m sure that most IT Managers would consider their IT to be fairly standardised, but the figures seem to suggest otherwise:

Basic Standard Rational Dynamic
Core 91.1% 8.7% 0.2% 0.0%
Identity and Access Management 27.9% 62.8% 5.9% 3.4%
Desktop, Device and Server Management 90.1% 8.9% 0.7% 0.3%
Security and Networking 30.5% 65.0% 3.0% 1.4%
Data Protection and Recovery 28.0% 34.9% 37.1% 0.0%
Security Process 81.1% 11.9% 7.0% 0.0%
ITIL/COBIT-based Management Process 68.9% 20.7% 7.1% 3.3%
Business Productivity
Unified Communications (Conferencing, Instant Messaging/Presence, Messaging, Voice) 96.3% 3.5% 0.2% 0.0%
Collaboration (Collaborative Workspaces and Portals) 76.5% 21.3% 1.4% 0.7%
Enterprise Content Management (Document and Records Management, Forms, Web Content Management) 86.7% 12.9% 0.3% 0.2%
Enterprise Search 95.0% 4.1% 0.4% 0.5%
Business Intelligence (Data Warehousing, Performance Management, Reporting and Analysis) 88.3% 10.5% 0.8% 0.3%
Application Platform
User Experience (Client and Web Development) 75.3% 20.9% 2.5% 1.3%
Data Management (Data Infrastructure and Data Warehouse) 87.6% 11.7% 0.6% 0.0%
SOA and Business Process (Process Workflow and Integration) 80.7% 18.0% 1.2% 0.1%
Development (Application Lifecycle Management, Custom Applications, Development Platform) 72.2% 26.2% 1.4% 0.3%
Business Intelligence (Data Warehousing, Performance Management, Reporting and Analysis) 88.3% 10.5% 0.8% 0.3%

As we enter a world recession/depression and money is tight, it’s difficult to justify increases in IT spending – but it’s potentially a different story if those IT projects can help to increase organisational agility and reduce costs overall.

Alinean founder and CEO, Tom Pisello, has identified what he calls “simple savvy savings” to make anyone a cost-cutting hero. In a short white paper, he outlines nine projects that could each save money (and at the same time move the organisation further across the IO model):

  • Server virtualisation (to reduce infrastructure investments, energy and operations overhead costs, and to help improve server administration).
  • Database consolidation.
  • Improved storage management.
  • Leveraging licensing agreements to save money.
  • Implement server systems management to reduce administration costs.
  • Virtualised destop applications to help reduce application management costs.
  • Save on PC engineering costs through PC standardisation and security management.
  • Unified communications.
  • Collaboration.

Looking at the figures quoted above it seems that many IT organisations have a way to go in order to delever the flexibility and return on investment that their businesses demand and a few of these projects could be a step in the right direction.

Joint user group meeting (Windows Server UK User Group/Active Directory UK User Group)

After lying dormant for some time, the Windows Server UK User Group (and the associated LinkedIn group) and the Active Directory UK User Group are pleased to announce a joint user group meeting on 11 March 2009 at Microsoft’s offices in London (Victoria) (map and directions).

The draft agenda is:

  • 18:00 for 18:25 arrival and registration
  • 18:25-18:30 Welcome and introductions
  • 18:30-19:45 James O’Neill takes a quick tour through the new features in Windows Server 2008 R2 (just to whet your appetite).
  • 19:45-20:00 Refreshments
  • 20:00-21:15 Amish Lukka (from Microsoft PFE) will be presenting an insight into new Active Directory features in Windows Server 2008 R2.
  • 21:15-21:30 Wrap-up.
  • 21:30 Adjourn to a nearby public house where Mark Parris will be happy to share his experiences of the Microsoft Certified Masters: Windows Server 2008: Directory class that he attended last November.

If you are interested in attending the meeting – please send an email to registration@adug.co.uk with your name and we’ll see you there. For those who can’t make it in person, we will set up a Live Meeting session (which will be recorded) and details will be made available closer to the event.

One more “How Do I?” video on the Microsoft TechNet website

Last month I mentioned that I’d produced a video for Microsoft TechNet on preparing for and deploying Windows Server 2008 Read Only Domain Controllers (RODCs) and I’ve just seen that the follow-up video which looks at RODC password replication policies went live a few days ago.

I plan to record some more videos soon (the next few that I do should be on virtualisation) but if you want to keep up to date on these (and there are many other people producing videos on a variety of topics), subscribe to the TechNet How-to Videos RSS feed.

Copying Outlook profiles, looking up SIDs and rediscovering Outlook 2007’s autodiscovery functionality

One of the benefits of not being so “hands on” these days is not having to mess around with Outlook profiles but, after joining my Windows 7 workstation to my employer’s Active Directory domain last week, I was faced with the prospect of migrating certain settings between the profile for a local user account and the profile for my cached domain logon. It should have been easy to set up a new profile, but for some reason I couldn’t get Outlook to connect to my server, so I decided to copy the working profile from the local user account.

There are various ways to do export Outlook account information but I decided to fall back to direct registry manipulation, exporting the registry values at HKEY_USERS\SID\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook (thanks to Dave Saxon for that tip), then massaging the resulting .reg file to change the SID and re-importing.

Incidentally, to find out which SID relates to which username, I followed a Microsoft Scripting Guys article to run the following VBScript:

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objAccount = objWMIService.Get _
("Win32_UserAccount.Name='username',Domain='computername'")
Wscript.Echo objAccount.SID

The main problem with this method was that my profile included an offline folder file (.OST) which was not accessible for my domain user account. It did, however, allow me to verify the settings that were required and to attempt to set up an new profile.

As it happens, even that was unsuccessful, so I tried the Repair button in the Outlook account settings, which invoked Outlook 2007’s autodiscovery functionality. If only I’d thought to use that in the first place… Still, at least it exposed me to the workings of an Outlook profile.

Incidentally, whilst researching this post, I came across some more information that might be useful if you’re trying to move Outlook data around.

There are two key locations containing many of the Outlook data files:

  • %userprofile%\AppData\Roaming\Microsoft\Outlook (also accessible at %userprofile%\Application Data\Microsoft\Outlook)
  • %userprofile%\AppData\Local\Microsoft\Outlook (also accessible at %userprofile%\Local Settings\Application Data\Microsoft\Outlook)

Some of the useful files (which may exist outside those two folders, and which may vary according to the version of Outlook) include:

  • profilename.NK2 (or .NICK) – nickname files with auto completion information.
  • profilename.xml – navigation pane settings.
  • .PST files – personal folders.
  • archive.pst – archived data (my personal preference is to turn off auto Archive and manage it manually).
  • .PAB files – personal address book files.
  • .FAV files – Outlook Bar shortcuts.
  • .RWZ files – Rules Wizard rules.
  • .DIC files – dictionary files.
  • views.dat – customized system folder views.
  • outcmd.dat – customised toolbar settings.
  • extend.dat – references to extensions (add-ins).
  • .sharing.xml.obi files – RSS subscription names.
  • .xml.kfl – RSS known feed list.

Signatures, Stationery and Templates have their own folders under %userprofile%\AppData\Local\Microsoft:

  • \Signatures (.RTF, .HTM, and .TXT files).
  • \Stationary (.HTM files).
  • \Templates (.OFT files).

You may also find some send and receive settings (.SRS) files. These are workstation specific and appear to be created on the first run of Outlook for each messaging profile. Consequently they do not need to be migrated.

Similarly, offline address book (.OAB) files should be downloaded from the server.

Finally, just as I was about to post this, I found an Outlook Backup Tutorial covering both Outlook and Outlook Express, which might be useful if you want to back up just your Outlook data (I tend to back up the whole machine).

Upgrading to Windows 7 – it’s all about reliability

There’s been plenty written over the last week or so about Microsoft’s plans for users upgrading to Windows 7 and, in short, customers will be able to purchase an upgrade license, but there will be no in-place upgrade path from Windows XP (direct in-place upgrades from Vista will be supported but are not recommended).

After all the anti-Vista press, I’ve been pleasantly surprised to see that much of what’s been written about Windows 7 has been relatively positive (I even wondered if they should market the product as Windows Mojave!) but now the critics have found something to complain about.

“What! No direct upgrade path from my 8-year old (n-minus-2) OS?”

Yes. Exactly. And that is A Good Thing.

I’ve often wondered why Windows gets such a hard time with stories of system crashes and general unreliability but that’s just not been my experience. I thought that maybe it was because I’ve been running NT-based systems (including Windows 2000, XP, 2003, 2008, Vista, 7) for the last thirteen years – after all, I certainly experienced that sort of chaos at one company where I worked but when we migrated the 4000 European employees from something approximating 4000 customised installations (mostly Windows 95/98, with users rebooting several times a day) to a standard Windows XP image, reliability improved significantly.

Ironically, it was buying a Mac that helped me to realise why people think that Windows is buggy and unstable. My Windows systems are my workhorses. I install standard software and I use them. I might install the odd application here and there, but it’s generally well-written software and it’s not a succession of installations and uninstallations. I also tend to dump the OEM installation and to perform a clean installation of Windows with each new operating system (although I have also used upgraded machines). On the Mac I’m much more of a novice: I have to learn how to do things; I download things that look interesting, then take them off again – and then I have reliability issues. Not a huge problem – but probably the cause of more forced restarts than I experience on my Windows PCs.

So what exactly is my point? Well, firstly this is not a Mac vs. PC discussion. The point I’m making is that, on any platform, the key to stability is only making configuration changes where necessary (i.e. incessent tweaking is generally not a good thing). The other point is that starting from a known baseline (i.e. a clean OS installation) is highly recommended.

When Apple shipped the last major update of its operating system (Mac OS X 10.5 “Leopard”) the general advice was to perform an “archive and install” installation. Basically, that’s what Microsoft is offering for XP users moving to Windows 7 but, unlike Apple, who have the benefit of a closed system with only a few devices (at least at a hardware and operating system level), Microsoft has to support almost infinite permutations of hardware and software for its operating system. And, from a brief conversation yesterday with one of my colleagues, it seems the situation is no different on Linux – if I want to move from an old distribution of Ubuntu to the latest version then I should expect to have to reinstall.

There was one comment on the article that Randall C Kennedy’s wrote for his enterprise desktop column at InfoWorld which just about summed this up for me:

“[…] I’ll bet if Microsoft did allow for an upgrade his next article would be bitching about all the upgrade problems Windows 7 caused from XP systems.

Next blog we’ll probably see how puppies (really cute ones too) are slaughtered in the process of making Windows 7. Desperate stories call for desperate measures.”

Even his colleague J Peter Bruzzese at InfoWorld can’t agree when he argues why Microsoft’s XP-Windows 7 upgrade strategy is right.

Opinion aside, for most corporates, clean, imaged, installations will be the preferred deployment option for Windows 7. Meanwhile, the majority of consumers will run an OEM-installed copy of Windows that came with their PC. Only a relatively small number of consumers, small business users and hobbiests will want to upgrade directly from Windows XP or Vista to Windows 7 (and the Vista users will be able to do this in-place, if they so desire) and, from Microsoft’s perspective, limiting the options to reduce the likelihood of users experiencing upgrade issues makes sound business sense.

A real use for Google Maps Street View

If all has gone to plan, by the time you read this, I’ll just have returned from a romantic weekend in Paris with Mrs. W. In itself, that’s not particularly relevant to a technology blog but, whilst booking the hotel for the weekend, I found Google Maps incredibly useful. Not just because the search results were integrated with people’s reviews on Trip Advisor and other such sites but also because Google Maps Street View really came into its own.

If you’re reading this in the US, then you’re probably wondering why the fuss? Well, here in the UK street view is not available (Google’s cameras have started to photograph the country, much to the dismay of privacy campaigners) but for me to have a look at our prospective hotels (albeit on a very grey day) was really useful and provided a real-world view (to compare with the hotel website’s slightly more enticing images).

The map shows a link to street view:

Google Maps France with a link to street view

And this is what it looks like:

Google Maps France in street view

Previously I’d failed to see any use for this technology. Now I can’t wait for it to come to the UK.

Photographic filters

In these days of digital photography and post-production, the need for photographic filters is greatly reduced (polarising filters cannot be emulated in PhotoShop through and I still find my Lee Filters 0.6 ND grad useful); however, as I was clearing out my office last weekend, I found a useful list of the various filter types (possibly supplied with an old Hoya or Cokin filter) and I thought it was still useful information although some of the descriptions were a bit odd (so I’ve modified them slightly based on some Internet research):

Filter Description
Skylight Absorbs ultraviolet rays (and blue/green). Often used for lens protection.
1B Used to eliminate blue cast in distant scenes and in shade.
UV(0) Absorbs only ultraviolet rays. Makes distant scenes sharp and clear.
80A (blue) Colour conversion filter. Allows daylight-balanced colour films to be used with 3200°K lamps (tungsten bulbs).
80B (blue) Colour conversion filter. Allows daylight-balanced colour films to be used with 3400°K lamps (professional studio lamps).
80C (blue) Colour conversion filter. Allows daylight-balanced colour films to be used with 3800°K lamps (clear flash bulbs).
81A Light balancing filter. Allows Type B (tungsten balanced) colour films to be used with 3400°K (studio) lamps.
81B Light balancing filter. Eliminates strong blue cast when buildings, trees, etc., are photographed in daylight.
81C Light balancing filter. Prevents blue cast in cloudy or rainy weather.
82A Light balancing filter. Allows Type A (studio-balanced) colour films to be used with 3200°K (tungsten) illumination.
82B Light balancing filter. Type B filters can be used with 2900°K illumination (home bulbs).
82C Light balancing filter. Reduces the reddish cast found when shooting in early morning or late afternoon.
85 Colour conversion filter for use of type A (studio-balanced) colour films in daylight.
85B Colour conversion filter for use of type B (tungsten-balanced) colour films in daylight.
85C Colour conversion filter. Used to convert 5500°K (daylight) lighting to 3800°K.
FL-D Eliminates green cast when daylight-balanced films are used under fluorescent lights.
FL-W Eliminates green cast when tungsten-balanced films are used under fluorescent lights.
ND Used to lower intensity of light striking the film to enable larger -apertures for shallow depth of field, slower speeds and special effects.
K2 (yellow) Absorbs part of the spectrum between ultraviolet and violet. Makes clouds stand out. Also used for natural rendition of colors in black and white tones.
G (orange) Absorbs part of the spectrum between ultraviolet and bluegreen. Provides stronger contrast than K2. Especially effective for distant scenes.
25A (red) Absorbs the spectrum between ultraviolet and yellow. Provides the strongest contrast. Makes daylight scenes appear as though photographed at night. Also used in infrared photography.
XO (yellow-green) Transmits green and absorbs part of the spectrum between ultraviolet and blue. Natural rendition of skin and lips of female models. Highly effective for outdoor portraits.
X1 (green) Absorbs more red than XO. Effective for reducing the reddish cast of lights for indoor photography. Suitable for photographing green trees and colourfu! subjects.

This table just lists the technical filters but special effect filters are also available from the major filter manufacturers. For more technical information, check out Ken Rockwell’s post on how to use camera filters.