jump to navigation

Howto: Setup wordpress blog on a home server? November 26, 2007

Posted by Mayank in home server, Wordpress.
Tags: , , , , ,
14 comments

I’ve been wanting to do this for a long time and this flu I got over the weekend gave me that chance ! :-).

This blog (powered by wordpress 🙂 ) is hosted from my home pc. While most of the setup was a breeze with instructions readily available I faced problems in setting up the port forwarding (NAT) on my ISP provided router/modem. I’ll brief you through the process while paying special attention to the networking setup where I didn’t find much help..

1. Get the wordpress tar.gz from http://www.wordpress.com

2. Setup LAMP, WAMP, MAMP or any other xAMP ! 🙂 …

AMP is short for Apache MySQL PHP. The first character is chosen based on the OS one choses, viz. Linux Windows MAC, etc

3. Now go through the famous 5 minute wordpress installation, and believe me that is really a 5 minute install.

One word of caution, on one of the configuration pages you might be tempted to change the “WordPress Address (URL)”, “Blog Address (URL)”, **don’ do that** just yet. You’ll get locked out of your setup and would be needed to get into the MySQL database to fix it. However, later I also found a PHP script which can help you bail out of this situation.

4. Nows the part where you don’t find much help. For your site to be accessible from the external world, your home server needs to be seen on the internet. Typically most modern routers have firewalls built into them which keep your internal network secure (typically your home pcs behind the router).

In order to make your wordpress blog available on the internet, you should begin by opening a port on the router and asking the router to forward all requests received on this port to your home server. This is usually available as a setting called port fowarding or NAT.

Since I set this up on my airtel broadband connection, I’ll give some specifics about that to help other airtel broadband users. I got a Beetel 220BXI modem/router with my broadband connection. The configuration page of the router is generally available at http://192.168.1.1. If you are unsure of your routers ip address you could also go to http://whatismyip.com from your pc and use http://<ipaddress shown on whatismyip.com> The default access credentials for the router are admin/password.

Router – Login Screen

The advanced settings of this router are not directly accessible. Once logged in, type the following url in your browser – http://192.168.1.1/main.html.

Router – Home Page

This should take you to the advanced settings page where you can complete the NAT setup.

Router – Advanced Settings Page

Router – NAT Settings Main Page

Router – Setting up NAT

Router – NAT Settings completed!

5. Once you’re done with the NAT setup, your wordpress blog hosted on your home server should be visible outside. You can use this link to find out if your port is open now … https://www.grc.com/x/portprobe=80.

6. To allow user friendly url based access to your site, you can first get a Dynamic DNS.

7. If you don’t have a static ip address then read ahead. Map the dynamic dns account to the external ip address of your router (the one you got from whatismyip.com). You might want to setup a ddns client which will keep dyndns.org updated with your ip address everytime your ip address changes.

8. Finally, you can register a domain name (I used enom via google apps as it provided whois privacy for free) and point it to your static ip address if you have one or the dynamic dns name (the one you created in the last step).

9. We’re left with one final thingy .. since your home pc usually does not have a dns name it can become a problem to enable access to the blog to the external world as well as the world on your side of the router. So you can edit /etc/hosts and add and entry which looks something like this:

192.168.1.5 http://www.geekzguru.net geekzguru.dyndns.org

10. edit httpd.conf and add “ServerName geekzguru.dyndns.org”

11. restart networking and apache.

Your blog should now be easily accessible both internally and externally :-).

Happy blogging!

Advertisements