So you have a blog. Cool, but let’s face it, that’s just not very unique in the modern-day web world. Everyone blogs; heck even your Xbox 360 has its own self-updating blog!
One way to set yourself apart from the hordes, and steer clear of restrictive hosting providers, is to use your own gear to run your own blog. You not only earn more geek street-cred, but self-hosting your blog opens the door to limitless configuration options—whether you’re using Notepad to edit bare-bones HTML documents, or setting up the latest Wordpress plugins.
If you’ve never built your own server, or if you find the concept of an Apache installation terrifying, don’t sweat it. We’re going to help you shortcut the configuration headache, so you don’t have to emo-blog about it later.
1. Getting the Hardware Up-to-Speed
For the backbone of your blog, hardware doesn’t really matter as much as you might think. You can run a web server on an old-school CPU and a craptastic videocard; you can run it on a dual-core rig with SLI graphics. As long as you aren’t planning to use your web server as a gaming rig, you can spend as much or as little on hardware as your bank account permits.
Regardless of the hardware you use, you need to be aware of a few important setup issues. Remember, you’re going to be running a web server; when it’s offline, so is your blog. So while you’ll want to have Windows automatically update and install the latest patches on your box, be sure to set an ideal time. And don’t forget the time-zone issue. If you’re running a blog on the west coast, arbitrarily setting your computer to update at 3 a.m. because it “seems late” could render your blog inaccessible to the east coasters who like a little Web 2.0 with their morning lattes.
It’s important to keep your virus scanner up and running on your web server, but you’re better off scheduling a daily, midnight drive scan, as opposed to kicking on the real-time protection. What you trade away in security, you gain by maximizing your system resources—this is crucial if you’re using a lower-end rig to power your blog, especially if you feel like multitasking the computer as a file dump or video streamer.
2. Opening the Software End
Before you really start tinkering with your machine, you’re going to want to establish a functioning, nonrestricted connection between your server and the Internet. Typically, something’s blocking the path: a software firewall, a home router, or both.
While there are a number of software firewalls you can have on your machine, including the default Windows firewall, the port-opening procedure is similar for all. In Windows’ case, open the firewall control panel and click the Exceptions tab. Click “Add Port” and enter the following: HTTP (80), HTTPS (443), MYSQL (3306).
Now is a good time to get a static IP address for your machine. Without it, your router could reassign a different IP to your server, nullifying the entire point of port forwarding on the router. Click the Start button, then Run, and type in cmd. Hit Enter, which pulls up a command prompt in its own window. Type ipconfig /all, and look for the Local Area Connection section. Write down your IP address, Subnet Mask, Default Gateway, and all the IP addresses under “DNS servers.” Close the window and go to the Control Panel’s Network Connections menu. Right-click Local Area Connection and select Properties. Find the menu option for TCP/IP, select it, and click the Properties button.
You should now see a window that most likely has “Obtain an IP address automatically” selected. Click “Use the following…” for both sections, and begin entering the information you just wrote down. The only change should come in the IP address field, where you’ll want to pick an unlikely number far above your current IP—if the IP you wrote down is 192.168.0.1, for example, enter 192.168.0.250. Fire up your web browser to make sure you can still connect to the net, and you’re good to go.
3. Opening the Hardware Gate
Hardware routers come in all sorts of shapes, sizes, default administrative IPs, and port-forwarding configurations. You’ll want to consult your router’s manual as to the specific way to configure your device for port forwarding, but in general, it’s pretty similar to how you set up your software firewall.
You’ll have to enter a particular IP address into your browser to access your router’s configuration screen (usually it’s 192.168.0.1), and somewhere in there will be a menu for port forwarding. Type in the static IP address you just configured for your PC in the Windows network settings (our example was 192.168.0.2), and forward the TCP ports 80, 443, and 3306 to that IP.
Now that you’re done playing with IPs, you should hit up DynDNS and register for its free static DNS service. Download and run the site’s update client, and your DynDNS web address (e.g., example.is-a-chef.org) will always point to the IP address of your router, which will forward the traffic requests right to your web server.
4. The Server Runneth Over
After all that networking configuration, installing the server applications themselves is a piece of cake. In just three clicks of the default Next button, XAMPP will unload the big guns—Apache, MySQL, and PHP—onto your system. While it’s chugging along, go get a drink or something; on an average machine, the installation takes about five minutes or so. Be sure to install the XAMPP components as Windows services when prompted.
Once that’s done, pull up your web browser and point it to http://localhost. Select your language, and you’ll find yourself on the XAMPP main screen. Click Status, and if everything installed correctly, the top five components—at minimum—will be green-lit. Now click the Security link in the left-hand frame, and you’ll find that your XAMPP setup lacks any password-based security whatsoever. Click the link below the table, and you’ll be given the option to password-lock your MySQL root and XAMPP configuration. Double-click the tray icon, restart MySQL, and you’re set.
Head over to your /htdocs directory, and pull up “wp-config-sample.php” in Wordpad. Type in your MySQL username (root) and password, then save the file and rename it wp-config.php. Go back to http://localhost in your browser, where you’ll get a prompt to auto-install Wordpress. When it finishes, log into your new Wordpress installation and click the Options tab. Under Wordpress Address, type in the URL that you’ll use to access your blog, which is usually the same as your DynDNS Internet address. Most people will put the same info in the Blog Address field as well.
6. Getting Stylish
By now, Wordpress is basically good to go, but you don’t want a default-looking blog; you want a fancy blog. In that case, we recommend you grab K2 (getk2.com), a template that goes on top of your Wordpress installation and adds a bunch of advanced functionality. The easy part comes on the installation side; just unzip the K2 package to your /wp-content/themes/ directory. Point your browser to your Wordpress configuration page (wp-admin), click the Presentation tab, and select K2 as your current theme.
From there, you can hit up the K2 Options Panel to set the theme, or overall look of your blog, and manage the specifics of your blog’s header and sidebar modules. If you’re really adventurous, you can edit your site’s CSS templates directly. But one of the nice things about K2 is that it eliminates the need to get elbow-deep in code, especially when you want to install new K2-compatible plugins. With one quick download and a few clicks of the mouse, you can throw just about any added functionality you want into your blog.