WordPress webdesign and development in Houston Texas

WordPress Performance Server

Using this setup you will have the ability to host a large high performance WordPress Multisite installation or numerous single installs

WordPress Performance Server - Debian “squeeze” with Nginx, APC and PHP from the Dotdeb repos


This is a step by step guide on how to set up your own unmanaged server or vps to run as a WordPress Performance server environment.  Using this setup you will have the ability to host a large WordPress Multisite set up or numerous single installs.  This guide assumes you have a basic understanding of using SSH via the Mac Terminal app or Putty for Windows and requires an unmanaged dedicated server or VPS hosting account with either the 32 or 64 bit Debian kernal available.

In my last guide I touted a Nginx reverse proxy cache with WordPress and Apache as the ultimate WordPress performance stack but since then I have found that there is really no reason to use Apache unless you have a specific need for it.  Nginx has matured and works great with the WordPress rewrite engine and even W3 Total Cache now includes Nginx rewrite rules for page cache, minify and browser caching.

Choosing a web host with Debian “squeeze” images available

Debian 6 aka “squeeze” is considered the grandfather of Linux distors and Debian is known for relatively strict adherence to the Unix and free software philosophies.  Debian is also distributed with access to repositories containing thousands of software packages ready for installation and use.

Most of the large managed hosting companies don’t give you the option of choosing your Linux distro so your going to need to find one that does.  The reason for this is that it’s much easier for a hosting company to provide support using cPanel or Parallels Virtuozzo VPS virtualization.  Virtuozzo allows them to squeeze many more VPSs on a box and control the resources and your limited to guess what - Cent OS.

Your going to need a provider that offers Xen virtualization.  Xen is a powerful open source virtualization platform that supports a wide range of guest operating systems including Linux - Debian, Ubuntu, Free BSD, Cent OS, Fedora and more.  When you set up your account have your provider load the Debian 6 aka “squeeze” image on your VPS or install it on your dedicated server.  If you have over 2GB memory go for the 64 bit version.

I use Softlayer (formally The Planet) for my dedicated server because of the state of the art data centers and major broadband backbone it’s connected to.  It also has a very powerful back end portal and allows you to connect to your box over a private VPN.  Linode, Slicehost, and VPS.net  are also very good choices.  I would stay away from Media Temple and Rackspace as I’ve had problems with both and they’ve had well documented  security vulnerabilities in the past.

Next Page: Connecting to your server the first time.

Pages: 1 2 3 4 5 6

15 Responses »

  1. just checking one thing: the w3 total cache rewrite rules are only needed if using disk cache, right?

    • Yes you really only need the W3 rules for disc cache. They just add a finer level of control for the browser cache rules. I just updated the server file to show a full example of the W3 Rules using disk enhanced page cache and disk minify.

  2. Hi,

    Great post, thanks a lot for the information. From the title I got the impression, you were going into the details of multiple wp installs with one ngnix or via multiple xen installs.

    Do you have any best practices about this? Or even some up to date ressources?

    Thanks again for the great post.

  3. I’ve got a noob question about SSH keys. If I’ve installed the SSH key on the server it means that I can only login to it from my computer right? What if I don’t have my computer with me and have an emergency and need to SSH into the server?

    • Using SSH keys you will only be able to login if your computer contains a private key that matches a public key installed on the server. I prefer the added added security they provide but if you often need to access your server away from your computer then maybe a really strong password would be better for you.

      If your using password authentication you can change the ssh port to prevent a majority of the brute force attempts. Also some VPS and dedicated server hosts have a java console you can use to access your server without having to use your ssh keys.

  4. Just a note that “you are” is shortened to “you’re”, not “your”.

    Otherwise, thanks for the great write up!

  5. Hey Guys:

    Awesome tutorial — my first foray into nginx w/ wordpress.

    A couple things I got snagged on in the tutorial & the fixes:

    > When installing everything the first ‘php5-mysql’ should be ‘mysql-server’ instead since there is already a php5-mysql package a little later in the command

    > There’s a missing closing ‘}’ at the end of the file in the sites conf

    > Upon trying to install wordpress I got “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.” Fixed this by editing the php.ini inside the php-fpm dir.
    >> I un-commented ‘extention=mysql.so’ as well as uncommenting ‘extention_dir = “./”‘ and changing ‘./’ to /usr/lib/php5/20090626+lfs and all was well.

    Thanks again guys! Loving nginx so far!

  6. Hi

    Great guide thank you, I have one question about file ownerships/permissions.

    Presumably everything in my site’s public folder needs to be owned by www-data and in the www-data group?

    If so, how can I then upload and/or edit files when logged in as a non-root user? Do I just need to add my user to the www-data group?

    Any advice much appreciated, I find this bit quite confusing!

  7. Any recommendations for creating init scripts to ensure all the services start automatically after a reboot?

  8. -location ~ \.php {
    +location ~ \.php$ {

    -location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
    +location ~* \.(ico|css|js|gif|jpe?g|png)$ {

    -rewrite ^.*/files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
    +rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;

  9. Hi,

    Thanks for your tutorial, I finally get my wordpress working on LEMP stack.

    However, if any of your reader need the easy way to install wordpress, you can use https://github.com/buchin/WordPress-On-Lemper
    Which is based on this tutorial.

    It assumes you’ve installed nginx, php-fpm, and mysql, and need multipe WordPress installed on multiple domains.

Trackbacks

  1. Adding Git to your WordPress development workflow

Leave a Response