I created a WordPress site for a client who needed to support both English and Español versions of their content, which involved using a plugin called MultilingualPress that creates relationships between sites for each language.

I developed the site locally on my server, and then after they created some content, migrated it to their hosting service.

Continue reading

wordpress-logo-notext-rgbI was setting up a temporary WordPress site for a client as a placeholder for their business. All they wanted was their logo, a link to an existing product page, and a message about the site being under construction.

Since they were going to have some design ready shortly, I set them up with a WordPress site, and found a simple theme (Decode by Scott Smith) that their logo would work with.

The owner then told me she wanted to see the site running with SSL (aka HTTPS), so I grabbed a certificate and installed it.

Continue reading

Screen Shot 2013-06-08 at 10.35.06 AMIf you read my previous post (WordPress Recovery), you know I’ve been writing some code to recover my old posts. It occurred to me I could take a small segment of what I’ve been doing with that code to demonstrate my approach to TDD.

Since I’m a hacker from way back, and also because I was in semi-panic mode about losing the content, I didn’t approach this task with testing in mind. Now that doesn’t always result in bad code: I’ve been doing this long enough that I can usually think through a fairly good model and code something that isn’t one long method full of inline code.

In this case however, once I had started coding, I realized again that this was an opportunity to practice coding the “right” way. I had already begun with a Maven project, and generated unit tests as I went through the process of starting to build the code, so I had at least some good functioning unit tests.

Continue reading

Well, I have the basics of my blog recovered now, so almost all of my posts going back several years are once again available.

In my last post titled Lesson Re-learned: Backups !, I admitted that I had committed the cardinal sin of making changes to my web site without doing a backup first (walking the tightrope without a net).

Luckily for me I had installed the WP Super Cache plugin, so all of my content actually still existed as static files, and being a bit of a hacker, I was able to throw together some code to effectively recover my posts.

Continue reading

Homer Simpson
Homer Simpson (Photo credit: Wikipedia)

I just shot my blog in the foot, or more accurately, I didn’t follow IT 101 and back things up before making a change.

I had moved my site to be completely WordPress based a while ago, and as a result I had a bit of a convoluted setup on my server.

When I first set up my WordPress blog it was as a sub-domain of accuweaver.com, and was housed at http://wordpress.accuweaver.com/ (also aliased to http://blog.accuweaver.com/). The http://www.accuweaver.com/ site just static pages that hadn’t changed for years.

So when I finally got my blog set up to host the few static pages I had, I just changed the directory on my server to have a symbolic link to the directory where wordpress.accuweaver.com had it’s content:

  1. Removed the directory httpdocs from /var/www/vhosts/accuweaver.com
  2. Added a link in that folder to /var/www/vhosts/accuweaver.com/subdomains/wordpress/httpdocs.

This actually worked really well, since the content was only in one place, and all I had to do was change the host name in WordPress. Continue reading

Screen Shot 2013-02-25 at 9.16.20 AMI volunteer and provide technical support for a few non-profits, one of which is the Project Management Institute San Francisco Bay Area Chapter (http://www.pmi-sfbac.org) where I serve as the VP of Operations and CGO.

One of the moves I made in my first year with them was to migrate our event calendar to Eventbrite and Meetup. One of the gaps I found with Eventbrite is that it doesn’t have a way to provide a feed of events that can be used to update an external calendar, so I embarked on a little programming effort to create one.

Most calendar programs allow you to pull external events using the iCalendar (ics) format, and Eventbrite actually has a pretty decent API to allow you to pull the events, so I decided to write a simple PHP script to allow me generate an iCalendar feed.

Screen Shot 2013-02-25 at 8.47.53 AMThis started as a simple one-off for PMI-SFBAC, but has turned into an open source project at https://code.google.com/p/eventbrite-ics/

Looking at the code, you can see it’s pretty basic, just a few PHP classes, some unit tests, Netbeans project and data.

Once the code was working, I used the iCalendar validator at http://severinghaus.org/projects/icv/ to make sure the results are good, and (at least for PMI-SFBAC) they are.

Eventually this results in a URL that I used as a feed into the All-in-One Calendar from Time.ly which lets me show events on my site’s calendar along with any other iCalendar feeds I choose to add.

Screen Shot 2013-02-25 at 8.59.20 AMTo configure the All-in-One calendar, I just go to the Events in the WordPress admin panel, and add the feed.

After I add the feed I click the “Refresh” button to make sure the events show up on my calendar immediately. The events then get updated on a periodic basis (daily by default), and should keep you up to date.

Screen Shot 2013-02-25 at 9.06.58 AMAnother use I put this feed to is to add the Eventbrite calendar to my Google Calendar.  I have a calendar feed from Meetup, and several of my friends so that I can quickly see what is going on that day.

The same basic idea for Google Calendar: you go to your Google Calendar, click the drop down on “Other Calendars” and choose “Add by URL”.

This gives you a nice view of events so that when you are scheduling things you can see what’s coming up that you might be interested in.

For those of you poor souls still using Outlook, the same feed can be used there as well see: http://office.microsoft.com/en-us/outlook-help/view-and-subscribe-to-internet-calendars-HA010167325.aspx

 

 

Enhanced by Zemanta

I got an email from my friend Athens who had just relaunched her web site at http://www.athenskconsulting.com/ but was now having problems with email.

The first thing I did was to run over to the MX Toolbox site to see what was going on with her servers. A quick look and saw that her mail servers were pointing to mail.athenskconsulting.com, which resolved back to her WordPress blog.

Before she pointed everything to her WordPress site, everything had been working. Unfortunately, the directions at http://en.support.wordpress.com/domains/map-existing-domain/ had given her some unfortunate information, that really weren’t accurate for what she was trying to do.

Her DNS and email were previously hosted at GoDaddy (along with her old web site), and all she was really trying to do was to get her company URL to point at the blog site that she’d set up on WordPress. The instructions I mentioned before give a way to accomplish that, by repointing the domain DNS servers to be the ones that WordPress provides.

The unfortunate thing about that approach is that in order for this transition to happen smoothly, you have to transfer all of your DNS records into the WordPress settings so that things like your mail server will continue to work (following the instructions at http://en.support.wordpress.com/domains/custom-dns/

Now this might be OK if you are a geek and know what MX and CName records should look like, but typing in a DNS file in the format that WordPress expects it is much more difficult than using the GoDaddy DNS control panel (which helps prevent you from making mistakes).

I got on the phone with her, and the first thing I had her do was to switch her DNS servers back to GoDaddy. This is done by going to the Domain Manager page in GoDaddy and looking for the section that says “Name Servers”.

Screen Shot 2013-01-30 at 4.10.04 PM
Clicking on the link that says “Set Nameservers” brings up a dialog that allows you to set the DNS (which had been set to the WordPress servers per the instructions mentioned previously):

Screen Shot 2013-01-30 at 4.10.23 PM

This of course fixed the mail problem (along with other URL’s), but broke her web site again (which I expected it would).

We then clicked the “Launch” link on the same Domain Manager page by looking for the section that says “DNS Manager”:

Screen Shot 2013-01-30 at 4.05.29 PM

This brings up the actual DNS zone editor that I talked about previously. Now the first thing you should do is to back up the zone records by using the import/export button on the DNS manager:

Screen Shot 2013-01-30 at 4.17.11 PM

This gives you the basic information that you might have needed if were you going to follow the instructions on the WordPress site. It creates a text version of the information of the DNS Zone records in a standard format.

But unless you really need to move off GoDaddy for some reason, you don’t want to do that. Instead, you just need to set up a wildcard CNAME record for the WordPress blog, and make sure to remove any old A records that might be pointing to the wrong place.

So for Athens, we needed to delete all of her “A” records (since she no longer has a physical server), and add a CName that looked like:

wildcard

And once DNS propogated, she was up and running again at http://www.athenskconsulting.com/

A quick trip back to the MX Toolbox site to check and her mail servers are now pointing back to GoDaddy again:

Screen Shot 2013-01-30 at 4.46.18 PM

Clicking the link that says “ns lookup” shows that the domain is now using the GoDaddy DNS servers again:

Screen Shot 2013-01-30 at 4.46.26 PM

The one other thing I do to make sure things are working is a DNS propogation check (http://www.whatsmydns.net/), which shows which servers will resolve the host and which don’t.
Screen Shot 2013-01-30 at 4.55.21 PM

All the little green checkmarks mean everything is happy all around the world, and now everybody is resolving her site properly.

So in summary: if somebody tells you to change your DNS servers, think first and see if an alias will work better …

Enhanced by Zemanta
Related Articles
dnsguide

I’m doing some work on a project that is using PHP, and have been working on setting up some continuous integration build scripts to make sure that we have a shot at catching errors before they make their way to production.

Recently some unit tests were added for the “forgot password” code, which uses the mcryp

t libraries which are not installed by default on Mac OSX, so I was seeing this error:


So some quick Google searches, and I found a couple of blogs with “how to” install the library (links at the end of this post), and proceeded to get this done.

First step was to download the mcrypt from SourceForge at http://sourceforge.net/project/showfiles.php?group_id=87941

Once I had the file, I opened a command prompt and ran:

Next I ran configure, setting the appropriate flags for my envirionment (note – I didn’t do this for the other configures, probably would have been a good idea):

This sets up the make file, so you can run the next two commands:

Next to make the PHP library, I needed the PHP source files, so I went out and grabbed PHP 5.3.15 (since that’s the version I have when I run php -version) by going to http://us3.php.net/get/php-5.3.15.tar.bz2/from/a/mirror. Note that you can simply change the version number in that URL to get the version you need.

Once I had that I did the following:

This of course gave me an error about autoconf not being installed:

From there I installed autoconf by doing the following:

Then back to the php mcrypt folder and reran the phpize step to and finish building:

Finally an edit to the php.ini file which was simply to add the extension:

And of course a quick restart of Apache and the extension shows up and I can run my unit tests successfully.

Related posts:

http://www.coolestguyplanettech.com/how-to-install-mcrypt-for-php-on-mac-osx-lion-10-7-development-server/

http://michaelgracie.com/2011/07/21/plugging-mcrypt-into-php-on-mac-os-x-lion-10-7/

Enhanced by Zemanta