StackAccel

≡ Menu

wordpress

Multi-Site WordPress Walkthrough

www.flickr.com/photos/brodiekarel/11382310205

This guide is intended to provide you with an A-Z walkthough of installing and configuring a multiple WordPress site environment, under a single Ubuntu instance, as well as getting your existing site(s) restored into the new environment.  This would typically be useful for folks who want to move their WordPress sites from one VPS or hosting provider to a another.  This guide may be particularly suited for users of DigitalOcean, as it really consolidates many of their excellent knowledge base and how-to articles, as well as provides solutions to some of the problems that you might run into throughout the process.  That having been said, it’s applicable to many environments.  Before you get started, make sure that you’re using something reliable to backup your WordPress sites.

Deploy a new VPS instance 

If you’re restoring from either a single-instance WordPress deployment (e.g. DigitalOcean 1-click WordPress on Ubuntu 12.x), and you want to move it to a different WordPress VPS instance (e.g. an Ubuntu 14.04 instance on DigitalOcean with WordPress configured in a multi-tenant configuration like so, you’ll first need to deploy and configure your new VPS instance.  Follow the “Initial Server Setup with Ubuntu 12.04” to get you started (its close enough to Ubuntu 14.04 to follow).  Which basically consists of:

  • Changing your root password
  • Creating a new user
  • Giving the new user root privileges via sudo (visudo)
  • Changing the default port that ssh runs on

DNS and LAMP Stack

Next, follow the “How to Set Up a Host Name with Digital Ocean” guide, which is a short primer on DNS.  And proceed to with the “How to Install Linux, Apaches, MySQL, PHP (LAMP) on Ubuntu” guide on digital Ocean.  Basically, what you’re doing here is getting your VPS instance deployed, active, and configured with a LAMP stack.  In short…

  • Install Apache
  • Install & Configure MySQL
  • Install PHP and verify that it’s working

Multiple WordPress Sites on a Single Ubuntu VPS

Finally, follow the “How To Set Up Multiple WordPress Sites on a Single Ubuntu VPS”.  This guide has everything you need to get your VPS instance configured to run multiple WordPress sites on a single Ubuntu instance.

  • Download WordPress
  • Create site databases and users in MySQL
  • Configure the site root directories in /var/www/FirstSite, /var/www/SecondSite, etc.
  • Use rsync (rsync –avP /source /var/www/FirstSite) to copy the directory hierarchy over to the site root directories.
  • Configure WordPress (/var/www/FirstSite/wp-config.php) this is where you link your MySQL databases and users that you created in step ii above to this /var/www/FirstSite (etc.) instance.

From here you’ll configure the Site Virtual Host Configuration

  • From /etc/apache2/sites-available – cp 000*.conf to FirstSite.conf
  • In here you’ll want to add ServerName FirstSite.com, ServerAlias www.firstsite.com (you can also use *.com, etc.), DocumentRoot /var/www/FirstSite
  • Install the PHP Module

Restore you WordPress site from Backup

At this point, you’re going to want to grab one of those WordPress backups that you’ve been doing, and copy it over to your new VPS instance.  If you’re uploading it from a Windows machine, WinSCP will do the trick.  Check this “Restoring Your Database From Backup” guide for more information.

    • Copy the backup archive to your home directory ~/restore
    • unTar/unzip it… tar -zxvf backup.tar.gz
    • Put the backed-up SQL back into your MySQL database that you created earlier (e.g. FirstDatabase).
    • Save a copy of your site root WordPress config file (e.g. cp /var/www/FirstSite/wp-config.php ~/working/wp-config.php) so that you don’t have to re-create it.
    • Next, you’re going to need to dump the restored WordPress files into the site root directory… this can be accomplished via rsync (rsync -avP /source /var/www/FirstSite).
    • Copy your good wp-config.php file which has the links to your MySQL database back over (e.g. cp ~/working/wp-config.php /bar/www/FirstSite/)
    • Restart Apache (sudo service apache2 restart).
    • Your site should now be working.

 Fixing Post Name Permalinks

  • Make sure mod_rewrite is enabled via… “a2enmod rewrite” has been run (then restart apache – service apache2 restart ).
  • Fix the AllowOverride all on every occurrence of allow override in /etc/apache2/apache2.conf .
  • To eliminate the informational warning (non-critical) message on restarting apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName, edit the /etc/apache2/apache2.conf file to such that the ServerName line has been added to read ServerName localhost.

Must Have WordPress Plugins for 2015

(This article is part of my WordPress Toolkit series)

Best plugin advice?

Keep it simple.

It’s not only good advice when it comes to plugins – it’s good advice for your site’s design too.  This probably goes doubly true for entrepreneurs and small businesses that aren’t in the web-design business.  Why?  Because it’s too easy to go overboard… adding features and functionality until your site becomes slow and distracting (or worse).  This isn’t to say that plugins are bad, or should be avoided, it’s just that you need to be selective about the types of plugins you use and have a clear objectives in mind when using them.  In this case, I’m talking about utility plugins… or plugins that provide you with basic and critical functionality that’s common to most WordPress.

… which is why this is a list of only 5 plugins.

 

Akismet

AkismetAkismet – this one probably almost goes without saying.  It pretty effectively handles comment spam (assuming you allow comments on your site).  It comes pre-installed with every WordPress installation, and just needs to be activated.  Is comment-spam a real problem?  Absolutely.  On popular web-sites the amount of spam comments is up to 85%!  Experience also suggests that it’s even higher for new sites (as in, 99.9%).  Akismet does a solid job at eliminating the vast majority of comment spam.  It also does an effective job at preventing false positives (e.g. legitimate comments flagged as spam).  While some users have criticized the false-positive detection,  by and large Akismet does an excellent job.  Configuration is fairly straight-forward, and there are plenty of Akismet how-to articles available should you need them.

BackupWordPress

BackupWordPress

 

BackupWordPress enables you to back-up your entire WordPress site (including all of your files, and your WordPress database) on a scheduled basis.   It does exactly the job you’d expect it to do.  Mainly, it keep your sites backed-up should something bad happen.  The free version does enable you to get scheduled backups emailed over to you, but your site will quickly grow beyond what email can accommodate.  The $99 bundle lets you direct your backup jobs somewhere convenient, like DropBox, GoogleDrive, Amazon S3, sFTP, etc. and is well worth the cost.

Contact Form 7ContactForm7

 

Contact Form 7 is one of the best contact form plugins for WordPress, which can be particularly useful if your theme doesn’t come with one (or if it’s clunky).  Highly customizable and doesn’t require you to do any coding to make it happen.  It also supports useful things like CAPTCHA, Akismet spam filtering, and more.

WP-DBManager

WP-DBManager

WP-DBManager enables you to keep your WordPress database in check.  You may not realize it yet, but one of the challenges that you’ll encounter as you build out content for you sites is that the number of revisions, drafts, and re-revisions start to add up.  Don’t believe me?  Even this short article took more than a few revisions!  One of the more important aspects of running a successful WordPress site is keeping your database healthy – WP-DBManager enables you to do just that.

WP Mail SMTP

WP-Mail-SMTP

 

Depending on your host, you may or may not need a tool to modify the configuration of wp_mail() such that you can use SMTP.  If you find yourself unable to generate email messages with your host, consider using WP Mail SMTP – configuration is fairly straightforward.

Other Advice

While you could probably spend years playing with the tens of thousands of plugins available, I refer you back to the advice offered at the beginning of this post.  Mainly – keep it simple!  At some point, you’ll probably find a need for some extra bit of functionality that WordPress doesn’t offer out of the box, and when you do… look at your theme first and see if it offers you what you’re looking for, and if you can’t accomplish that way, only then consider adding plugins.  When you check out WordPress Plugin Directory – the comprehensive inventory for all things WordPress plugin related, be sure to check the “Last Updated:” field, and the number of “Downloads” for whatever your interested in, as they’ll give you an idea as to the quality of the plugin your looking at, or at least of the size of the community.  Generally speaking, my suggestion is to stick to Plugins that have either been updated recently, have a high download count (or both), and whenever possible have been recommended to you by someone you trust.

There you have it… my list of 5 Must Have WordPress plugins for 2015.  While by no means an exhaustive list, it’s should be more than enough to keep you busy getting your basic site built-out.

Part 7, A Fast and Always-On Site

What if your site’s popularity skyrockets unexpectedly one day?  Maybe you get linked to from a popular industry blog, or your product gets featured on TV, or who knows what… Is your site ready to handle the surge in volume?  Or is there a chance new visitors might be greeted with something that resembles an “Unavailable” message?

Are you sure about that?

One of the most important reasons you have a web-site site is so that you can capitalize on incoming traffic.  If your site is sitting there unresponsive, or gasping just as a slew of new potential clients are checking you out for the first time, is that really the first impression you want to make?  Before you can say, “We really can’t afford having to Engineer high-availability into our site…”, what if having a fast site that’s always-on was feature you could flip-on like a switch?  No expensive server-farms, or round-robin fail-over configurations.  More importantly, what if you could cache copies of your web-site all over the world, pushing your content as close as possible to your visitors reducing or eliminating the pain of having a “slow-site”?  What if you could do all of this without changing your hosting provider, or making any significant changes to your web-site?  Would you do it?

Of course you would.

And you can, by adding a Content Delivery Network to your WordPress Toolkit.

Content Delivery Networks (CDN)

A CDN a a large distributed infrastructure deployed in multiple data centers around the world.  The objective is to serve content (e.g. text, graphics, video, etc.) to end-users fast, and with high-availability (e.g. without downtime).  CDN’s aren’t a new concept.  For example, Akamai Technologies, which was founded in 1998 is one of the largest and most well-known CDN providers with some very high-profile customers… including Adobe, AMD, NBC Sports, and Yahoo.  The customers use Akamai’s proprietary platform, cacheing out content to a network of over 100,000 servers around the world in order to maximize the performance and availability of their sites.  In the case of Akamai, their customers pay hundreds of millions of dollars to provide them with these services.  That’s the bad news.  The good news?  The types of services that used to be only available to the largest Fortune 500 customers, are now available to everyone for a reasonable cost.
Cloudflare-logo-horizontalEnter CloudFlare, founded in 2009.  While a much smaller company than Akamai,   CloudFlare’s CDN services are available to everyone at a relatively low cost, and can be bolted-on to virtually any existing web-site with a simple DNS change.  CloudFlare built their own CDN from the ground up, combining technologies like SSD drives and Anycast routing along with geo load balancing to make their service as fast and efficient.  By adding

CloudFlare services to your existing site, you no longer need to think of your web-site as an individual web server in a physical location – instead it exists as a globally distributed entity that sits physically close to your visitor – no matter where he/she is at.

NCDN_-_CDN

This means that your site not only is more responsive to your customers than ever before, but it’s also more resilient because it sites on CloudFlare’s content delivery network.  Should a single-server of theirs go down, the service will automatically heal as one of the dozens of other servers take over for the failed server.  CloudFlare also provides a number of other services aimed at further improving the responsiveness of your site, as well as improving the overall security of your site by reducing it’s exposure to targeted DDoS attacks, and eliminating your site’s static IP address as a choke-point (it also masks your static IP).

The Bottom Line

CloudFlare isn’t the only game in town.  Amazon’s Cloudfront, MaxCDN, KeyCDN, and other’s all compete in the content delivery network space, all can be added to your existing website, and offer varying cost/benefit models.  Based on my experience with the platforms, I tend to recommend either CloudFlare or CloudFront.

Part 6 – Responsive and Mobile

Do you remember a few years ago, when everything looked terrible on mobile devices and that was kind of just the accepted reality of things?  Obviously that’s no longer the case.  Today, web sites need to look great on both the desktop and mobile devices because most of your typical audience is just as likely to be checking out your site from their iPad, as they are from their desktop computer at the office. The ability of a site to display well across all types of devices is called responsive design.  Put differently, its web design that responds and optimizes site appearance and navigation so that the site looks good on whatever device it’s being displayed on… meaning, the site looks good on a computer, on a tablet, or a phone.  It doesn’t matter what you view it on, because the design responds to the environment that it’s being used on.

ResponsiveComparisonR2As an example, here’s a comparison of what this site looks like when viewed from iPhone vs. Chrome on a desktop.  The responsive design enables the content to display in a useful manner on a mobile device.  Put differently, responsive design is about creating a user-friendly site experience, making the site more appealing, and creating a great user-experience across many devices and screen sizes.  While you can build a responsive design yourself, or contract a company to do this for you, in most cases finding the right theme that’s already responsive is often the best approach.  In the prior article in this series, I mentioned several themes which were responsive and useful.

Is responsive really design for me?

The answer is almost certainly yes.  Here’s why… even if you expect that the vast majority of your site’s visitors will be coming in via a desktop web-browser, the reality today is that your site is going to rank better in terms of Search Engine Optimization (SEO) if you have a responsive design that works well with mobile devices.  In other words, Google loves responsive web design and your search results will rank higher automatically just by choosing a responsive theme.  If for no other reason, that’s why you should consider a responsive theme.  Beyond that, one of the added benefits of responsive design is less management effort.  In the majority of cases, one you have a responsive site, there’s no longer a reason to do both a mobile and desktop version of your site.  That means no separate content management tools, or sites to maintain, or having to worry about separate URLs, and building the authority and rank of each site independently.  Which makes sharing content on social media that much easier – both for you, and your audience.  All of that extra stuff (and cost) just goes away.

Okay, so say none of this is you… maybe you don’t think you really care about responsive design, and maybe you just think of your web-site as a “me too”, or “must have” – a placeholder for your business.  That’s fair… many companies, niche companies, and organizations that have very complex or products just have a site because they have to.  But even if all of that’s true of your business – why wouldn’t you want your site to look good on a tablet?  Why wouldn’t you want to automatically improve your page rank?  Why wouldn’t you want  want a new potential avenue for clients?  If you’re going to be making any investments in a site, choose a responsive theme.

Part 5, Theme Recommendations

By this point, you’ve followed the previous setup information and should be ready to begin working with a demo site.    Which means that you’ve chosen a CMS platform, registered a domain name, selected an appropriate web host, configured DNS, and are now either at the point of choosing a 1-click WordPress instance, or your web host has sent you a link to get started.  Fantastic!  Pick a username and password, and click “Install WordPress”.  Then click Log In.

You’ll be presented with the WordPress Dashboard.  From this console, you’ll be able to change everything about the look and feel of your site, create content, and so on.  Good thing too… because by default your site probably looks something similar to this…

WordPressSetup.4

 

Now, before you get started changing your themes, let me introduce you to one of the biggest challenges with working with WordPress today… separating the good, from the bad (and the ugly).  This isn’t a problem unique to WordPress, or themes, or plug-ins… it’s a problem shared by any platform that has hit critical mass.  As with Microsoft Windows, or Android… the problem usually isn’t finding a tool or an app for the job… the real problem is often finding a good tool for job.  Few places is this more true than when applied to themes.  There’s just so many out there, and if you’re getting started, it’s really hard to know what’s good or bad until you’ve invested quite a bit of time building some familiarity.  So, let me try and save you some time.  In general, you want something that’s being actively developed or maintained by an organization was some staying power… you don’t want the theme to disappear next week.  You probably also want something that’s easy to manage.  Because even if you, or some of your technical resources are doing the initial work, it’s likely that you’ll want to turn over maintenance to someone else – marketing, or HR, etc. and in that case, you’ll need a theme that’s not too terribly hard to work with.  Finally, you’ll want something that’s responsive and looks good on mobile  devices (more on this later).

WordPressSetup.3

Beginner: If you’re just starting out and want to get your feet wet without spending hours looking at “free” themes, check out Themify.me.  Themify.me has plenty of good options – as in, themes that look pretty good, are generally easy to work with, and tend to not break your WordPress install.  For your time, it might be worth picking up “The Master Club” offering ($139), as it offers a good value and saves you from having to wade through a lot of junk.  At the same time it gives enough different themes and options to understand what’s possible.

Intermediate: While not necessarily as easy to get started with, the Avada theme from Theme Fusion is a popular and powerful option. At the risk of overselling this, it’s the #1 selling theme on Themeforest, run on more than 85,000 web sites.  While that might sound overused, the reality is that because it’s highly customizable you probably won’t find lots of other sites with a similar look and feel.  It’s not quite as beginner friendly as Themify.me’s stable of quality themes, but Avada pretty looks good with only a modicum of configuration work, and probably isn’t going to disappear overnight.

Advanced: In addition to what standard themes, there are also theme frameworks.  Two of the more popular  commercial theme frameworks include the Genesis Framework, and Thesis.  Theme frameworks allow you to extend the capabilities of WordPress.  You can think of them as platforms that sit on-top of WordPress and enable you to add functionality (e.g. drag and drop site layouts, replace or eliminate plug-in functionality using small code snippets, etc.).  You still need to add a child theme to skin the theme framework and provide a ‘look-and-feel’, so for starters you may just want to stick to the themify.me or Avada route, if for no other reason than economics.  If you really want to go work with a theme framework, let me save you some research.  There are a lot of conflicting articles and opinions discussing Genesis and Thesis.  When it comes down to it, Genesis is probably going to be easier to work with than Thesis 2.  Thesis lost some of its momentum when they released Thesis 2.  When it was released, there was painfully little documentation, and so it was more than a bit confusing for new comers.  Today?  Most of those documentation problems and bugs have been fixed.  Personally, I like Thesis 2…so your mileage may vary .  Unless you have a child theme that you absolutely have to have, and you want to use a theme framework, Genesis is probably going to be the easier of the two to work with.

 

Visit Us On Twitter