Installing WordPress Multisite for TLDs

These days, a lot of the websites I create are using WordPress on the backend. It’s a breeze to install, fairly light weight, and the developer community around it is fantastic.

The only complaint that I ever have with it is that its framework is being updated ALL THE FREAKING TIME. And it probably wouldn’t bother me as much as it does, but having it say “There’s a new WordPress version” every time you login is kind of annoying. And its even MORE annoying when it happens on CLIENT sites because they expect you to constantly update it for every little change in version. Usually I just say “No thanks”, but despite this I still try and update it for the big releases.

And ladies and gentlemen, I believe that WordPress 3.0 is such a release.

Multisite Functionality Built In
If you’ve been a user of WordPress for any period of time, you may want to check out all the cool additions that are now in 3.0. For me, the biggest feature has GOT TO BE Multisite Functionality or WordPress Mu integration. If you’re not familiar with WordPress Mu, it allows you to run multiple sites off of one WordPress installation. But because it was always treated as a bit of a seperate product, there was an evident lack of consistency between the two products from a usability and functionality point of view. Now to be fair, I don’t know for sure that that has changed, but everything I’ve seen so far leads me to believe it has.



Why I Need WordPress Mu or WordPress Multi-Site
If you don’t know why this is so cool, you probably have not tried to use WordPress Mu and/or have never had a collection of sites powered on WordPress. In my case, I have done both. I had one site that is no longer up called Learn Stuff Online which was basically an About.com before About.com was what it is now. It was supposed to generate tons of AdSense revenue but it was a lot harder to manage than I thought it would be. I had multiple “subjects” on multiple subdomains (hometheater.lso.com, internet.lso.com, etc) and always updating html files to update content on the site became old quick. So one day I had an epiphony to try this whole WordPress Mu thing and I got it KIND OF working. To be honest, it took a lot of work and never felt all the way there as I had to do a lot of fudging on the functionality side to get things working the way I thought they ought to.



Fast forward a couple years, and now I have a collection of my own MFA sites that are powered by WordPress. And more to the point, they are all powered by their own separate WordPress installations. So when I need to create a new site, update the WordPress base or update the slew of plugins on these sites – It’s a huge pain. Now to be honest I don’t think that’s why I hardly update content on those sites, but I think it definitely has kept me at arms reach from doing anything really impactfull with them.

Multisite in WordPress 3.0 is Awesome
But now with WordPress 3.0, I can run all of these sites from a single WordPress installation. That’s right, I’m not just talking about subdomains or directories on a single domain (which you can do too), I’m talking about powering multiple TLDs with a single WordPress 3.0 installation. It took me a lot of figuring out to do it, but with a bit of research and a LOT of work, I did it – And I’ll show you how to do the same. Oh, and before we begin let me say that I host with LunarPages and I have a dedicated server. I’ll show you exactly what I’ve done and I think if you’re in a similar (or even not) a similar situation you should be able to do the same.

Steps to Install WordPress 3.0 Multisite

  1. Download and Install WordPress 3.0.
  2. Download and MANUALLY install the Trunk Version of the Domain Mapping Tool.
  3. Create new WordPress site.
  4. Map TLD to new WordPress site.
  5. Test new WordPress site.

Download and Install WordPress 3.0
So first, go to WordPress.org, download version 3.0 and install it on a domain on your server. Once you’re done and you can ensure that it’s working – go to the next step.

Download and MANUALLY Install the Trunk Version of the Domain Mapping Tool
This part of the tutorial is what I really gleamed from Otto’s post sited below and linked here: http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/. The domain mapping tool is what’s going to make sure that when someone hits one of your TLDs, that it goes to the appropriate place for your single WordPress installation to serve its particular content. To get the files, download them from here: http://plugins.svn.wordpress.org/wordpress-mu-domain-mapping/trunk/, and then follow steps 1-3 on Otto’s site to MANUALLY INSTALL the Domain Mapping Tool.

Create New WordPress Site
At this point, you should have the Domain Mapping Tool rockin’ and rollin so in your Dashboard go to “Super Admin->Sites” and fill out the bottom blanks under “Add Site”. So for instance, you can enter “test” for Site Address, “Test” for Site Title and an appropriate e-mail for Admin Email. Once you’re editing this new site, change the “Domain” blank to the exact address of your TLD (i.e, example.com). For “Path”, enter “/”. Under Site options, make sure Siteurl is the domain name “http://example.com”, under Home enter “http://example.com” and for Fileupload Url enter “http://example.com/files”. Then scroll all the way down and click the “Update Options” button.

Map new TLD to WordPress Site
Now at this point, your WordPress install should be setup to serve files and content for your new site. And even though we’ve pointed everything correctly in the Domain Mapping Tool, we haven’t actually setup your TLD to point to this WordPress location. For me, this was hands down the hardest part of the install as I couldn’t figure out how to get the server part of this whole thing working. What started me on the good path was Matt Dunlap’s post on the subject here: http://mattdunlap.org/website-development/wordpress/how-to-create-a-network-of-top-level-domains-with-wordpress-3-0.html where he directs you to editing your httpd.conf file. I did this and I believe I got it to work, but I really didn’t like editing my conf file directly. So instead, I went into my WHM and parked my new TLD on top of the domain I installed WordPress on. After that I was IN baby!

Test Final WordPress Site and Tweak if Necessary
So at this point if you’ve setup everything correctly and you’re money like me, you should be able to see your new site when visiting your new TLD. If not, you obviously need to find out what’s wrong. For me, it’s usually in the individual site settings under “Super Admin->Sites”. There’s a little checkbox labeled “Update siteurl and home as well”. This whole section just doesn’t update as I thought it would so I ended up going back in and editing this information again.

NOTE : This was a REALLY long post and I will probably come back and edit it when I get the chance to make it much more helpful.

Also, it wouldn’t be nice of me to not credit the various pages I found that helped me out installing WordPress Multisite on my own server:

Steve Jobs Hates Flash and I Don't Blame Him

Not sure what circles you travel in, but those I find MYself in are all abuzz about Steve Jobs’ alleged comments about Flash.

You might be able to say that it all started at the grand reveal of Apple’s long awaited iPad a week or two ago when during his live demo, Steve Jobs went to a website that had Flash content and everyone saw a “plugin needed” icon where the Flash was supposed to be.

I don’t believe Jobs really said anything about it then (you can double check by watching the conference here), but it looks like he didn’t have to ’cause he had already said plenty on the subject before hand.

Steve Jobs Hates Flash
Now I had NO idea that Adobe and Mac were so standoffish, but if you believe this Engadget article (and who doesn’t like Engadget), according to a report in Wired, Jobs was quoted as saying “Apple does not support Flash because it is so buggy. Whenever a Mac crashes more often than not it’s because of Flash. No one will be using Flash. The world is moving to HTML5.”


DAMN GINA!

I’ve read a smattering of things about HTML5, but a quick search on the topic seems that it isn’t fully integrated in popular current browsers and I’m just not sure that its APIs are going to give developers everything you can get from Flash which I think (as of this writing) is at version 10. But be that as it may…

Flash is FAR From Perfect
You may not know this about me Joe Rogan, but I have a LOT of experience in Flash and AIR. And I’m not talking about just cheesy animations either. So let me tell you, one of the more frustrating professional experiences of my life (outside of installing Bugzilla) has been trying to get rid of Flash memory leaks due to its a$$ backwards way of trash collection. So when my friend brought this whole conversation to my doorstep today in a gChat conversation, I think he was FLOORED to hear that I don’t blame Steve Jobs for not wanting to include Flash in his shiznazz!

Apple’s Image WORKS
First things first, I’m not the biggest fan of Apple. I had somebody at my last employ who was THE Apple fanboy. His day started, ended and was filled with Apple.com. He had the iPhone, his trusted MacBook, and day after day tried to get everyone on board with his beloved brand. As I see it, he is Apple’s favourite kind of customer – Likes technology, loves to “look cool”, and doesn’t want to take the time to learn anything computer related. NOT THAT I’M FAULTING HIM. It’s kind of like the 360 debate vs the PS3. PS3 is slick, great at displaying media, overpriced (imo) while the 360 doesn’t look AS cool, has a TON of great games, but doesn’t always work as expected. I mean, how DARE customers expect their computers to work!


I’ve been able to buy a large monitor and hard drive for a long time Apple.
Don’t insult my intelligence!

Look – I build PCs for fun. The idea of Apple framing new monitors and HD as new amazing enhancements for their iMac makes me laugh. I’m saying to myself, “Um… I’ve been able to go on NewEgg and TigerDirect for eons and pick out EXACTLY what size stuff I want. BUT the fact remains that PCs seem to be much more unstable/unreliable than Macs. It’s the tradeoff for being allowed to do whatever the hell we want to them and one that I (being a computer nerd) happily embrace but one that a lot of people would be willing to give up for something that they “don’t have to worry about”.

I Don’t Blame Steve Jobs
And here’s the thing – The whole “don’t have to worry” thing is a LARGE part of Apple’s image. If you think it’s not – You’re an L7 WEENIE. So if Steve Jobs doesn’t want to introduce Flash into his carefully crafted technology which emphasizes reliability and stability – I DON’T BLAME HIM. Furthermore, I kinda agree with him on Adobe. I was learning about trash collection in my HIGH SCHOOL Computer Science classes so if Flash is still struggling dealing with those kinds of issues after 10 major revisions of their product… I don’t even know…

…Though I’m still not paying $1000 for a Macbook, Macbook Pro or Macbook Air.
…Nor am I paying $150 for an MP3 player.

Bugzilla Install Was Torture

Saying that installing Bugzilla was painful would be the understatement of the year. From what I’ve been able to piece together through this nightmare, it probably took me 9 hours to get the whole thing done – 3 hours on 3 separate days. And if it wasn’t for @mkanat suggesting that I give it another try, I probably would’ve walked away a LONG TIME ago.

I mean, I believe that everyone who works on large computer projects like myself should have some kind of issue tracker setup and while I’ve been using Mantis very happily – It doesn’t look very attractive (which is important when opening this up to clients and associates). So I began searching for something that it looked a bit better which is when I found Bugzilla. *shaking head*

First Things First
If you’re thinking about installing this on your server, know that it’s not for the feint of heart. There are A LOT of “moving parts” with this thing (Perl, CGI, db stuff) and many of them are things that I don’t have intimate experience with. Aside from that, the install guide that comes up Bugzilla is very vanilla in that seemingly ALL the issues that came up for me were not addressed in the guide either in notes next to the instructions or in the troubleshooting section. Even Google searches weren’t yielding me the help I really needed. @mkanat suggested that I use the Bugzilla newsgroup which I tried, but look – I’ve never used a newsgroup before and at 11:30pm at night well into hour 7 or something… I just wanted to get this done, not learn yet another thing.

So hey, I finally got things going last night so I wanted to put something out there that might help others who are going through the same pain. This isn’t an install guide but just the problems that I had that I didn’t see answered anywhere else. Oh and keep in mind that I don’t fancy myself a Unix Administrator either so if I get things wrong or sound stupid – It IS what it IS.

Getting Started
First you’ll need to probably shell into your server using the username for the website you’re installing it into. That’s to say, even if you think you can only or SHOULD shell in as “root”, you should instead shell in as the group/owner of the website where you’re installing Bugzilla… This will probably fix problems for you later. After you download the Bugzailla tar file and untar it, you have to run this script called checksetup.pl. (You run it by typing “./checksetup.pl” at the command line. When you first run it, you’ll be told about all the Perl modules you need to have installed to get things going. It will also say that to install all the modules, do “./install_modules.pl –all”. When I did that, everything went fine until it prompted me for “pg_config” which is when the first big headache started.

Installing the Modules – Oh and “pg_config” or “pg_path” is the Devil
I found out later that the “pg_config” prompt was for a PostgreSQL module. Here’s the thing, I have MySQL. You can think that you can just skip this by pressing [enter] but when you do, the script quits out and then I was getting an error when re-running it saying “Can’t locate Constant.pm in @INC” blah blah blah. At this point, I couldn’t go forward in my installation. The only way I found to deal with this was re-installing Perl (if you use CPanel, you can follow the instructions to do so here: >http://docs.cpanel.net/twiki/bin/view/11_24/AllFAQ/PerlFAQ#How_do_I_upgrade_Perl After doing this 2 or three times, I think I stumbled onto something through Google searches saying that you may NOT want to install ALL the modules. This was a big turning point. Instead, (after I was able to run checksetup.pl again), I ONLY installed the modules that were required (I think there was about 3). After that, I got past this HUGE hiccup. And again – Why this information isn’t included as a note in the install guide is beyond me.



And Then There Was the Group Owner Permission Problems
After all this, I finally got to the point where I could try and run things again (./checksetup.pl and the like) and I was still getting problems. Turns out now that I had group/owner permission problems… Remember before when I said you should make sure to shell in using the group/owner account of the website where you’re installing this? Well see, I’m using something that I found out is called SuExec… From what I understand, it makes individual websites on your server run scripts by that website’s group name… If you let them run as “nobody” or “root”, it’s a big security thang. So anyway, when I installed all of this Bugzilla stuff as “root”, my owner and group permissions for all these files were all over the place (which is obviously bad). Using the commands “chown” and “chgrp”, I ended up fixed things and I made sure to update the “localconfig” file with the right group name.

At about this time in the process, you can run “testserver.pl” to try and see what’s wrong and even though things were a little broken, it was saying that the group name on the “localconfig” file was different than the name being used by the webserver. Even though it says “this MAY not be a problem”, when nothing is working you tend to second guess yourself so obviously I spent hours changing my Apache httpd.conf file, restarting Apache and then changing Bugzilla’s “localconfig” file and hoping it all worked. Bleh. Let me sum up things for you if you’re a bit confused:


I’ve been looking at this screen a lot lately.

Let’s say that I’m on my Linux box running Apache with Cpanel installed. I’m going to install Bugzilla onto hockeyrules.com – A domain that I own (for conversation’s sake anyway). When I FTP or or login to the CPanel for this domain, I know my username is “hockey”. Chances are, this is what SuExec is using for your group name when running scripts. So this is what you’re going to use in your “localconfig” file’s $webservergroup variable. Got it?

403 Forbidden My A$$
At this point, “checksetup.pl” was lookin’ good but I still was having problems with “testserver.pl” saying that it couldn’t retrieve some PNG file or something. When I checked out the site through my browser, I saw that I was getting a 403 Forbidden error. I mean seriously, could this thing just work!?!? After a little while searching and a little while investigating, I found out that my Bugzilla directory that was supposed to be serving files didn’t have the right permissions. What tripped a flag was when I saw that “Other” didn’t have read permissions which is when I think I chmodded it to 755 to get it to serve…

And that my friends is when it FINALLY worked.

So now I have a working version of Mantis AND a working version of Bugzilla. Oh, and I tried to get into Bugzilla a little while earlier today, but I found myself bamboozled. There’s a lot in there and it’s going to take a while to suss out I think. And don’t worry – I still plan on comparing the two so check back in a little while and you may see a FANtastic (or mediocre) review!

Facebook Development Sucks

Sometimes when you have a burgeoning web design company, you find yourself doings things you wouldn’t normally want to do. This weekend was such an occasion as I completed my first soup to nuts Facebook application for a local radio show.

Now let me be straight – Helping a radio show I like (with all things web) is something that I would do happily, especially when I met one of the hosts last year during a crazy ice storm where I found myself stranded and he couldn’t’ve been nicer. But I swear… If I knew what I did now, regarding how much work it would take to get this App off the ground… I don’t even know. I think it took me about 2 days work of straight programming to get this done and it was some of the most frustrating work I’ve done in quite some time.

I Have Developing for Facebook
Like most of the things I work on intensely, my wife gets to see all the peaks and valleys of the journey. Well this was no difference, and after two days of burying my head in my hands and occasionally pounding my fists on my desk, my wife asked “What’s wrong?” Now usually this question would drive me up a wall but she’s getting to be really good at finding the right times to ask these questions, so I answered her in words that she would understand…

  • Facebook’s developer documentation sucks
  • There doesn’t seem to be clear instructions on how to setup your dev environment
  • The tutorials don’t help that much and seem to use nothing but depreciated functions

Now maybe I’m way off on the above but look, I think of myself as a developer. And I’d like to think that over the past two days of furious work that if the above were NOT the case, I would know it by now. So I could go on and on and let this Facebook rage consume me talking about all the problems I had and what I did to try and fix them… But instead I will tell you about what irked me the most…

Facebook Has Crappy Documentation
Over the weekend I would run into the same code snippets from the same PHP tutorial using Profile.setFBML. (You’d think I’d run into other tutorials but there seems to be only one PHP tutorial people can find for Facebook). Anyway, when trying to figure out why this Profile.setFBML wasn’t performing as expected, I pulled up the following on Facebook’s Wiki:



So this is great. Not only will this method be depreciated, but it will happen oh… RIGHT ABOUT NOW. Unfortunately we don’t know if it HAS been depreciated or NOT, so I guess we gotta just roll the dice if we’re going to use it and hope that the depreciation hammer hasn’t fallen. Oh, and if you follow that next line about “application tabs” you know, if you wanted to program for the future, there’s basically no functional information in there either and instead points us again to the Developer Roadmap. If you go THERE, you will see the following:



And if you click “Detail” you get this: “Going forward (in the short term) application tabs will be the only way applications can integrate into profiles and Facebook Pages.” Soooooooo, application tabs are coming SOMETIME in early 2010 (but nobody knows when) and it will be the only way to integrate your apps into the profile, BUT there’s nowhere to find information on how to do it… *GROAN*

Again, this was an exceedingly frustrating weekend, but I got the App done, the programming is awful and sorely needs to be cleaned up but a Win is a Win. Screw you Facebook.

WordPress Archive Dropdown

One of the things I’ve been meaning to do for a while was clean up my sidebars. They were WAY long and that was mostly because my categories and archive sections were being completely listed out. I mean, you blog for any amount of time and these things are bound to happen. So I had two things I could do. I could either:

  • Stop displaying this stuff entirely or
  • Find a new way to display them.

For a second, I thought about putting this stuff into the footer somehow but after I spent all the time making my kicka$$ new one, I said I would just make dropdowns out of this content. For the category dropdown, that was easy enough to do after I found this page on WordPress. The archive dropdown was a bit harder because I couldn’t find code on WordPress that worked exactly like the category dropdown did. That is, the code I found on WordPress would go to the archive section immediately after selecting it from the dropdown instead of after hitting a submit button. So just in case any of you out there need this, here’s the code I came up with:

[sourcecode language=’html’]





[/sourcecode]

Sorry it looks so ugly but at the moment I don’t have time to play with this tool to make things look perfect and bring the font down. In any case, you should be able to just copy the code, clean it up and put it in wherever you need it. Hope this helps!

Missing Images in RSS Feeds

Let me start by saing, I absolutely hate it when something computer related is not working for me.

In preparation for a future post, I was messing around with RSS feeds. It was during this time that I discovered that my images were not showing up in my RSS feeds. Now this isn’t really a big problem, but hey…I want my feed to have some pizazz! After all, I use images in my post to capture reader’s attention, so I why shouldn’t I do the same in my RSS feed? Continue reading “Missing Images in RSS Feeds”

Beauty is in the Eye of the Beholder

My Mother-In-Law is a nice person, don’t get me wrong. But she has this horrible habit of e-mailing me with stuff I could care less about. You and I typically call this stuff SPAM. She hasn’t started e-mailing me Viagra offers yet, but plenty of chain e-mails, horrible jokes and even worse riddles. To alleviate this problem, I gave her another one of my e-mail addresses that a lot of junk e-mail already goes to so at least I wouldn’t immediately give her e-mails any importance. Well anyway, she sent me one the other day and it started with “I’ve been trying not to send you any junk, but I think that you will like this clock.” And included was this link : http://home.tiscali.nl/annejan/swf/timeline.swf.

Basically it’s a clock made in flash that displays the seconds, minutes, hours, days, months and years…it the most boring way possible. I mean, it basically presents everything my digital watch does, but in an even less attractive way. Why in the world did she think I would like this clock? And it being done in Flash, (with all of the cool things Flash is capable of), just makes this worse.

It was then I remembered about an ACTUALLY cool clock a friend of mine, Marieke did in school. Not only is it beautiful, but is has constellations in it too, and has a cool day to night graphic. SOOOO MUCH BETTER. You can check out a picture below, and check it out in action here.

Security and Adobe Flash (Cross Domain XML Madness)

So yesterday at the ol-l-l-l-l-l-l-l-l J.O.B., I was trying to get a little Flash app I made to read data from XML output on a particular server. That server is one that the company I work for owns, so I just knew that it would work fine. After I completed the apps, I tested them on my local and they worked like clockwork…They read the data, displayed the results, just like I planned on. Then I uploaded everything to one of my personal servers just to check that they would work online. And of course, NADA.

And I’m not talking about “nada pequito” or however it’s spelled. I’m talking about “NADA TODOS”. (If that isn’t the best butchering of the Spanish language, I just don’t know what is).

So I of course rechecked everything, uploaded the Flash files again, republished the Flash files in different versions, and tried again to no avail. I rewrote the HTML page that was using the Flash files, changing and editing all the different parameters used to pass values to the Flash. I just did everything I could think of.

I then proceeded to bang my head on my cubicle desk for the next 3 or 4 hours.

After my head went numb, I did what every good programmer would do…I went to Wendy’s for an hour. And while at Wendy’s I had an epiphany. I had faintly remembered seeing something called “crossdomain.xml” in another FLA file sometime before. I don’t why that thought suddenly popped up, but I felt pretty confident that my answers lied within this mysterious file.

So when I got back, the first thing I did was read up on this file, and sure enough that’s what the problem was. Check out this excerpt from the adobe website…

” For example, a Flash movie loaded from http://www.yourserver.com/flashmovie.swf can access data residing at http://www.yourserver.com/data.txt. The text file is located within the same domain as the SWF.

However, an attempt to load data from http://www.NotMyServer.com/data.txt will fail and no error messages are displayed. The load action will cause a warning dialog to appear.”

D’oheth. This is exactly what I was trying to do. I had put the Flash file on my personal server, but was trying to read data off the company server! So after I made a crossdomain.xml file and got it on the company server, everything worked out. It’s so funny that as a programmer, everything can seem so simple until suddenly nothing works, and then as quickly as the problem surfaced, it can be resolved in about the same time frame despite all the hours in the middle of seemingly unending attempts at any and all possible fixes. Ha ha. (Needless to say, after I got this working, I got the hell outta work).