We'd like to help you with your project.

We're based in St. Louis, MO, and we specialize in Drupal/web development (website, module and theme development) and mobile app development.

We also provide some awesome, inexpensive web services like Hosted Apache Solr Search and Server/Website Uptime Monitoring.

Like us on Facebook or follow us on Twitter.

Midwestern Mac, LLC

Below, you can read through the latest blog posts from Midwestern Mac, LLC. We blog about Macs, Drupal, web development, app development for the Mac and the iPhone, and whatever else suits our fancy!

Checklist for Setting up a CentOS 6 LAMP Server

I have to set up a new LAMP server for different clients here and there, but not with enough frequency to warrant using a particular scripted solution or 'stack' from a particular hosting company. Plus, I like to have a portable solution that is flexible to the needs (and constraints) of a client's website.

Note on hosting providers: For hosting, I've used a very wide variety of hosts. I typically use and recommend Hot Drupal VPSes or Linode VPSes [affiliate link] running CentOS for a good LAMP server. Shared servers are only good for nonessential or low-traffic sites, but they are a bit cheaper and easier to use for simpler needs!

So, here's a typical step-by-step process for how I set up a CentOS 6 (similar process for CentOS 5) server for LAMP (Linux, Apache, MySQL, and PHP), often for low-to-moderate Drupal sites (one or many):

Adapting Your iOS App to work with iPhone 5/iOS 6

iPhone 5 Specs and DimensionsFor the non-Retina to Retina changes, most developers simply needed to add a bunch of @2x graphics, and maybe change a few little things here and there. Most parts of an app Just Worked™ on the higher resolution display, as long as the app used native controls and views, and didn't have a ton of custom interface elements.

However, with the iPhone 5, there are some other things that are changing a bit more radically—there's a bit of extra height (or width, in landscape), and iOS 6 is introducing a new way of handling device rotation and display changes.

Since most of the apps I manage are relatively simple, and only contain a few UIScrollViews, UITableViews, and UIViews, I only have to perform a few quick changes to my apps to get them ready for iOS 6 and the iPhone 5:

Facebook OAuthException when posting to Wall for a Page

I integrate Facebook posting with a few different websites and services, so I've gotten to know Facebook's Open Graph and API pretty well over the past few years. A lot of sites I work with automatically post new stories straight to a Facebook Page's wall, and have a format with a message and an attached link. All of these parameters are well documented in Facebook's API under Post.

However, lately I've been getting the following error message whenever a site uses the first method below to send a post with a link attached:

{
  "message" : "An unknown error has occurred.",
  "type" : "OAuthException",
  "code" : 1
}

I tried using the Open Graph Explorer, the official Facebook SDK for PHP, and other methods to see if there was any other way to get around that exception, but nothing I did turned out any different response.

Here's how I sent a typical request with just a link (just using plain-vanilla PHP with cURL):

Hum or Buzz with a Logitech USB Headset

Logitech USB HeadsetProblem: I've heard from a lot of people about hum or background 'buzz' in recordings and Skype conversations when using a USB headset (like the one I have, the Logitech USB Headset H350). Almost every time I hear someone having this trouble, they're having the problem while using the headset with a laptop.

Solution: about 99% of the time, the problem is fixed by simply plugging the laptop into a grounded (3-prong) outlet.

On a Mac, if you're using the Apple power adapter without the extra power cable (with a 3-prong plug instead of the 2-prong plug), you may get a buzzing sound. On a PC, different adapters work differently, but hopefully you have a power adapter with a 3-prong plug.

APC Caching to Dramatically Reduce MySQL traffic

One Drupal site I manage has seen MySQL data throughput numbers rising constantly for the past year or so, and the site's page generation times have become progressively slower. After profiling the code with XHProf and monitoring query times on a staging server using Devel's query log, I found that there were a few queries that were running on pretty much every page load, grabbing data from cache tables with 5-10 MB in certain rows.

The two main culprits were cache_views and cache_field. These two tables alone contained more than 16MB of data, which was queried on almost every page request. There's an issue on drupal.org (_field_info_collate_fields() memory usage) to address the poor performance of field info caching for sites with more than a few fields, but I haven't found anything about better views caching strategies.

Knowing that these two tables, along with the system cache table, were queried on almost every page request, I decided I needed a way to cache the data so MySQL didn't have to spend so much time passing the cached data back to Drupal. Can you guess, in the following graph, when I started caching these things?

MySQL Throughput graph - munin

Pages

Subscribe to Midwestern Mac, LLC