Installing WordPress MU on a Dreamhost Server

Blandname is currently hosted with DreamHost, and we’ve been here for years. It’s cheap, offers lots of goodies, and one-click installs allow us to easily install and test web-based software. Not to mention that they also support Ruby on Rails, and give you SSH access and the ability to run a Jabber server as well as unlimited MySQL databases. If you are wanting to host your own website then choose a UKservers.

You’ve also probably gathered that blandname is currently running WordPress. Dreamhost Circulo Marketing has had a one-click install for WordPress just like ipage has for a while now, and since it was handy at the time, we went for it.

But things change, and one-click installs often are not enough to satisfy most webmasters, which is how we got where we are today. Since my goal with blandname is to create another multiuser blog similar to what has already been running for years at yottabite, but instead of having one big weblog, we’d like to have multiple subdomains like string.blandname.com, which WordPress MU allows you to accomplish, automatically.

Unfortunately DreamHost doesn’t support WordPress MU‘s subdomains by default yet (you can always send them an email), but we can still get away with subfolders, which is more than good enough for a test.

This guide will require familiarity with DreamHost’s control panel, as well as common Bash shell commands as we will be using SSH.

The first step is to make a test domain for you WordPress MU install. In my case, I navigated to the “Domains” section of the left-hand menu, then to the “Manage Domains” section of the DreamHost panel, and created the new subdomain test.blandname.com. You’ll want to make sure to select PHP5, and enable extra security. This typically takes about 10 minutes to complete, but we still have the database to add, so let’s get to that at the same time.

In the “goodies” section of the DreamHost control panel, select “Manage MySQL”. The default view is to set up a new MySQL database, which is what we’re going to do. Create a unique database name, the subdomain you would like it to use, as well as the data base username and password. Make sure to keep note of all of these settings as we will need them when installing WPMU.

DreamHost will have by now created a folder in your SSH root that will allow you to place files there and start some of the work while we wait for the subdomain to be created and propagate. Login to your server using SSH (you’ll need to use either your DreamHost hostname here or another web address for now – you can use the WordPress Mu domain later). Now we’ll navigate to the new subdirectory that was created when we setup the new subdomain by typing: cd test.blandname.com Change the folder name to whatever is pertinent in this case.

Now that we’re in the correct folder, we’ll grab the latest using the always-handy WGET. Here’s the code:

wget http://mu.wordpress.org/latest.tar.gz

gunzip latest.tar.gz

tar -xvf latest.tar

cd wordpressmu-1.0 (this will probably change, ls -al will tell you the dirname)

cp -rf * /home/YOURUSERNAME/test.yourdomain.com/

cd ..

rm -rf wordpressmu-1.0/

Now we’ve got a clean directory structure in the root of our test domain, and we’re set to go ahead with the WordPress MU installation.

By now the subdomain has probably propagated because DreamHost is getting faster and faster, so using your web browser, navigate to test.yourdomain.com

Next you’ll want to retrieve the soiled napkin, SubEthaEdit file or whatever else it was that you used to jot down the database settings, and plop them in here. They are very straightforward, and this is typically the most problematic so check them twice but have no fear: if you mess up WP MU will tell you, and you can retrieve the settings from the “Manage MySQL” section in the DreamHost web control panel.

The rest is quite simple: you’ll be met with a typical WordPress installation page, but instead it’s for WorPress MU. The first question that needs to be asked is whether or not WordPress MU users will be using subdomains or subfolders of the root WPMU installation. As previously stated, DreamHost currently does not support subdomains by default (I’ve put in a request, here’s hoping), so we’ll select subfolders here. WP MU will have already placed the domain name you will be using in the yellow textfield, but if you had decided to use subfolders instead of the webroot, you’ll want to specify that here as this will affect all links as well as your RSS feeds.

Lastly, we’ll want to name our multi-user WordPress MU blog, and specify the email address that you will use for things like spam reports, and replies to your comments on the parent blog.

Click on that small “submit” button, and let’s see what happens!

Hopefully on the next screen you’ll see this message:

Creating Database Config File: DONE
Congrats! Your WPMU site has been set up and you have been sent details of your login and password in an email.

Click on the link provided, and get with customization, as we’re all done.

Run IE 6 and IE 7 at the same time

Now that Internet Explorer 7 has been released in its final form, a lot of people are rushing out to install it as soon as possible. However, some web designers will want to keep a working version of Internet Explorer 6 to make sure their designs for IE7 aren’t broken in IE6. Jon Galloway has a great tool to have both versions of Internet Explorer installed and working at the same time, using a launcher comprised of a batch file and some registry hacks.

I tested the hackish launcher, and had no problems whatsoever.

Another mention: very soon IE7 is going to be a forced (pushed) update, so it’s going to be installed without you noticing, and Microsoft is going to reboot your computer, regardless of what you have left open overnight. To prevent having Internet Explorer 7 from being installed in the fashion, you’ll need to download the IE7 blocking tool from Microsoft.

Finally, if you don’t pass the WGA check to download the blocking tool, SnapFiles is providing a mirror of the IntelliAdmin IE7 Blocking Tool.

9 Great, Free Applications that Work with Vista

This is a list of my favorite Windows applications that I honestly couldn’t live without that also work on Microsoft Windows Vista RC as well, much to my surprise. All of the software is free to download and use, and in fact most of them are open source.

ConTEXT – ConTEXT is a free and lightweight editor for programming or can be used as a notepad replacement. ConTEXT supports find and replace in multiple files at once so changing one method in loads of files is no longer an issue. Works in Vista with no problems whatsoever.

Synergy – Synergy is like a software KVM, but only shares keyboard and mouse capabilities. Synergy is multiplatform, and I currently use it to have my keyboard and mouse work in Ubuntu, Vista, and my Mac Mini running Leopard with no problem at all! This way I get to use my favorite keyboard and mouse and get to free up some space on my desk at the same time.

VLC – VLC has been my favorite media player for years now. VLC comes with most of the codecs you will need to watch videos on your PC already. VLC is very lightweight, and JUST WORKS, something that can’t be said about many media players. The only issue with VLC in Vista is that it turns Aero Glass off while it is playing.

FileZilla – I use FileZilla to interface with clients that still haven’t moved to SCP. FileZilla is an open source FTP client that gets the job done, supporting drag and drop, SSL, and NAT to NAT connections. The only thing it is missing is FXP support, but that’s not really a big deal in my case. Works fine in Vista with no problems at all.

IMGBurn – I love IMGBurn. This is hands-down the easiest way to burn .IMG, .ISO and BIN/CUE disk images to backup CDs or DVDs. Free, open source, and awesome. Works a treat in Microsoft Vista Beta 2 as well.

WinSnap – I use WinSnap to make many of the screen shots you see on blandname. WinSnap supports full screen and windowed screen shots, and also allows for rotation and drop shadows if you feel the need.

Electric Sheep – I often refer to Electric Sheep as “the best screensaver ever”, but truth be told, it’s really a collection of computer-generated screensavers that allow users to vote on them using a Digg-like system. On Windows, Electric Sheep uses bit torrent to transfer the sheep data. Again, working just fine in Vista!

Xming – Xming is my prefered interface to remote Linux boxes. Xming is for Linux what RDP is for Windows – you get a local X server and acceleration that displays data from remote applications running on Linux machines. Tested more than a few times to a remote Ubuntu computer, and one Gentoo box with no caveats.

WinSCP3 – SCP is now my preferred file transfer method. Luckily my favorite client also works on Vista, or I may not have used it at all. Much like FileZilla, WinSCP3 has a very simple, streamlined interface that is feature-rich and gets the job done, even on Vista.

So there you have it: 9 free applications I couldn’t live without that work just fine on Vista, and make it easy for me to do my day-to-day tasks. Hopefully someday this list will include F-Spot and Amarok, but I’m happy with this as a start considering neither of them work on Windows XP SP2 either!

Make Prototype.js TINY – Keep Compatibility

Prototype.js is a very popular AJAX framework used when building dynamic websites. You will find Prototype in most Ruby on Rails projects as it is included by default, and for good reason; Prototype.js is a great library that includes a lot of functionality.

Unfortunately it is rather large in size, weighing in at roughly 50KB.

Although many have managed to reduce the file size of Prototype by paring down the code and gzipping the file, we’re going to use an additional tool to approach the problem, one from the Mozilla foundation that appears to work very well – Rhino.

(Oh, in the interest of full disclosure, I am a Java fanboy, having studied at a university that got a lot of Sun funding back in the day. I hope you can see past that and check out this Javascipt hack, I really do.)

An informative quote from the Mozilla page for the Rhino project goes like this:

“Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users.”

Alright then, so what you have is a Java bytecode version of Javascript that will work in most browsers.

Sounds interesting, let’s see what we can do with Protoype.js!

I decided early on to use a Rhino tool that I found on the Dojo site that allows me to compile Javascript and make it Rhino compatible. The page give you a brief walkthrough and some examples on how to use the tool, so I won’t need to cover that here in detail.

So we compile our Prototype Javascript file, let’s see what our results are then, shall we?

Before: 47445

After Rhino: 32716

After Rhino and gzip: 9454

So it’s at about 9KB now!

In order to utilize the new file, upload it to the directory that houses your original Prototype javascript file, then any instances of prototype.js in your code to prototype.jgz (zipped javascript).

You’ll also want to change your .htaccess file so that you handle the new script properly by typing pico (or nano or vi or what-have you) .htaccess:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ".*Safari.*" [OR]
RewriteCond %{HTTP:Accept-Encoding} !gzip
RewriteRule (.*)\.jgz$ $1\.js [L]

AddType "text/javascript;charset=UTF-8" .jgz
AddEncoding gzip .jgz

You'll notice here that we're doing user agent detection for Safari. When I did my testing it seemed to be spotty, so what we're doing is falling back to javascript if we see that the user is using Safari. We're still compatible, and the code works everywhere else.

Allow Multiple Logins/Users for Mint Stats Tracker

I have been testing the Mint PHP web statistics script for my development sites lately, and though I love it and the modular plugins you can get for it, one feature is sorely lacking – multiple user logins.

This quick hack is by no means revolutionary, but it certainly does get the job done.

A new feature in Mint 1.2.x is to allow what’s called a “client mode” where anyone can access the statistics without the need to login. While this works for locally hosted Mint installations, the is definitely sub-optimal when it comes to a production site.

The solution? I’m sure you may have guessed it already, but by using .htaccess, you can easily set up multiple logins to Mint!

In my case I use subdomains like minttea.mytestsite.com. Using SSH, I logon to minttea.mytestsite.com, and issue this command:

pico .htaccess

In order to add user to the file, you must append the .htaccess file with lines similar to this htaccess guide.

You’ll need to encrypt the usernames and passwords, but once it’s done you will have logins enabled.

Please note that this method is susceptible to a brute-force attack, but it will keep most people from poking around with your stats.

Once I have figured out a better way (using PHP for example) I will post it here too.

blandname launches prefoc.us beta

We finally launched our online RSS reader today, and are looking for testers. The site is called prefoc.us

prefoc.us (prefocus) will eventually allows (!) for more interactivity (!!) but since it’s still in beta these functions aren’t available yet. You can also add feeds to be parsed, and view pictures, listen to audio, and even watch videos!

Stay tuned to blandname as the site develops.

Oh, and more tech tips coming soon!

Copy Files From a Mac to Windows Using SCP

Whenever you start adding funny-flavored operating systems to a network, you eventually run into filesharing problems. Even if you only have a few machines, coming to a consensus on how to get files from point A to B can be quite taxing – especially if there’s work to be done.

Over the years I’ve tried FTP, Samba, NFS and a host of others. When configured well they work like a charm. However, when a new node joins the network (that shiny new Mac Pro of yours), things need to be reconfigured and can generally be a royal pain that´s why i always chose the best web hosting.

That has changed, though. We now have an acceptable solution that is free, easy to use and above all, secure. Introducing… SCP.

SCP has been around for a while now, and is gaining quite a bit of traction in the hosting world where it is (albeit slowly) starting to replace FTP for upload and download tasks. SCP stand for Secure Copy (CP being Copy on *nix variants). SCP works a lot like FTP in that you require an address to connect to, a username (login) and a password (we won’t get into stored keys today).

Now that we’ve decided what to try in our ad hoc network, how do we set it up? If you’re blessed with any variant of Linux or Unix, the work has been done for you already – the tools come with the operating system, and are generally found under the network tools in your fancy menus.

Fugu on OS X Server

It’s a different story on Apple Macs and PCs, though. For example, Tiger comes with an SCP server, but no client. Right, about the Mac server. In order to activate it in Panther, Tiger and even Leopard, head on over to the System Preferences pane, and choose the Sharing applet (the folder with the caution sign on it). Once it has opened, check the Remote Login checkbox. This will enable SSH, and in turn, SCP. We’re halfway there. You can connect to an SCP server by using the Terminal on a Mac, but from what I can tell most Mac users are frightfully scared of it. But that gives me the oppurtunity to tell you about one of my favorite applications – Fugu (japanese for blowfish – and sporting a suitably cute icon to boot). Fugu allows you to connect to an SCP server to both download and upload files. Fugu is quite easy to use, so we won’t get into that, but will save it for another time if need be (just like stored keys). Oh, and as the screenshot shows you, it works with Mac OS X Server 10.4.7 too! (as well as Leopard)

WinSCP Screenshot

In the PC world, WinSCP is Fugu’s sibling. You get an extremly easy to use interface, complete with drag and drop. Installation is a breeze, and best of all it’s free as in both beer and speech. Just like those soapbox ramblers. Getting a Windows SCP server is a bit more difficult, but currently exists in the form of BitVise WinSSHD. WinSSHD is slightly complicated, but most of the configuration is done during the installation procedure. They supply you with the needed variables, and one you have finished you will have set up an account you can use to test from your other workstations. The screenshot above was taken with the wonderful WinSnap – it comes highly recommended.
Let the cross-platform filesharing begin!

If you have any questions, or would like to suggest a topic for a future article, head on over to the blandname contact page and we’ll see what we can do!

Oh, and by the way, since you’ve noticed I always talk about virtualization, this certainly applies to getting files to and fro from your virtual machines in VMWare Server, Virtual Server (Virtual PC if need be) and Parallels – I have even found it to be faster than any other technique!

Ruby on Rails installed by default in Leopard

This is more of a teaser, but my dream has come true! Ruby on Rails is now installed by default on Apple Mac OS X 10.5 Beta (Leopard WWDC edition). Getting it up and running is really a snap.

Here’s the quick and dirty way to make a sample Rails environment and start the server.

Firstly, open the Terminal application. You know the scary black window with white text. Well actually it could even be white with black text – your mileage may vary (mine is black with green, for example).

Anyway, we’re wasting time – this is quick and dirty right? Otherwise I would be talking about chunky bacon.

In Terminal, type:

rails example

You’ll be met with a nice list of scrolling lines and when it’s done your “example” Rails application will have been initialised.

And that’s pretty well it!

Moving on, we want to see something tangible to prove to ourselves just how flippin’ impressive this really is, and why you knew when you saw that Apple Developper Connection article about Rails you knew good things were to come.

In Terminal, once more, sweating profusely now, we type:

cd example

ruby script/server

This runs the server for us. Once it has been set up, you can safely minimize the Terminal, and fire up Safari, Firefox, Camino, iCab, heck even Internet Explorer. We’re navigating ourselves to: 127.0.0.1:3000

Here’s what we find there (click the thumbnail to enlarge the screenshot):

Ruby on Rails 1.1.2 running on OS X Leopard

The nitty-gritty (no dirt band):

  • Ruby version – 1.8.4
  • RubyGems Version – 0.9.0
  • Rails version – 1.1.2
  • Active Record version – 1.14.2
  • Action Pack version – 1.12.1
  • Action Web Service version – 1.1.2
  • Action Mailer Version – 1.2.1
  • Active Support version – 1.3.1

It’s set up in a development environment by default (where you want it), using the sqlite3 database adapter (pretty typical).

Next time we’ll show you how to update these and run irb. Until then feel free to vote in our poll and support us!

Mephisto Immortus (0.6) Released

Mephisto is a CMS engine written using Ruby on Rails. The newest version has been released today and many people are very excited about it as it adds yet another Rails application to the ever-expanding list.

Some quick Mephisto features:

  • Easy Typo and Textpattern Blog Conversion
  • Easy Asset Management
  • Slick GUI
  • Article Tagging, Filtering, and Improvements