Saturday, June 13, 2009

Home Server Project - Configuring Apache

Apache configuration is otherwise pretty straightforward. You can choose to build from source or via the packages.

The services will be installed by default and Apache will serve you its default page as soon as the service is started.

Tricky part is to get the pages served over internet for the FQDN - www.kiranghag.com

My ISP assigns me dynamic IP. Luckily the router supports DynDNS. So I setup DynDNS client and let it update DynDNS records every time it got up new IP.
My existing domain - www.kiranghag.com, has been registered using Yahoo! Small Business. I added a CNAME record so that the beta webserver name - atom.kiranghag.com points to my DynDNS alias.

On the server, the hostname and DNS suffix has been setup for its internet domain - kiranghag.com. After that edited the apache configuration files and add ServerName directive for correct domain. The server also needs to be given static IP on home LAN.

The router firewall needs to be updated so that port 80 is forwarded to the webserver's internal IP and port 80.

Now I am able to connect to atom.kiranghag.com from outside!!!

PS: This breaks sometimes though. I guess this happens when the router is restarted and IP changes before DNS servers on Internet flush their cache. This can be solved by restarting apache and network services on the home server first. Turn off router for a minute and power it back on. That should take care of it.