Setting up a personal home web server

More and more people are making their online presence felt by blogging. Many people have  made article writing as a extra source of income.  If you are an expert on certain domain you can share your knowledge by writing useful guides on your personal website. This article shows you how to setup a hhtp webserver on the home PC and access it using a name (e.g http://joe.webhop.com) instead of using an IP address (e.g http://11.56.38.134).

In order to start blogging you no longer have to be an expert on HTML or other web programming technologies. With the freely available open source software you can easily create beautiful websites, and host them on a personal web server running on your home PC.  You can also share your site with the world over the Internet. In this article I am going to show you how to host a web server at home.

While hosting a website from home can not be a permanent solution but it will get you started. It will also let you test the waters first before you dive into creating a niche website. Once you have a good website you can transfer it to a domain hosting server.

Why Do I need a Personal Web Server

In addition to creating niche blog, there are many uses of hosting a personal home web server at home which renders web pages across machines in the connected home.

  • Hosting a mini site with image galleries. Useful to see your pictures on any device with a web browser.
  • Privately share pictures with friends without having to upload pictures on the Internet.
  • Create family , personal web pages or blogs and share privately with friends.

How to setup personal web server

A web server can be hosted on a windows or Linux machine. There several software packages for web server. Some of them are free. Most popular among them is Apache webserver which is open source. It’s also a good idea to add MySQL and PHP for for a fairly complete web hosting package.

Apache,MySQL and PHP packages can be downloaded and individuality. But it’s best to download and install a package which bundles all three in a matching bundle. One of such packages is wamp server for windows. Wamp stands for Windows Apache, MySQL and PHP. There’s a package for Linux known as lamp server.

Download wamp server here. Install using downloaded exe file.  Choose c:\wamp as the installation directory. Installtion process will create C\wamp\www directory which is the root directory for your website. Test your web server by entering “http://localhost” on the browser. You will see the default webpage created by wamp. Delete contents of www directory,create a file index.html and copy paste the following html code. Refresh your browser to see your new page.

<html>

<head>

<title>My first html page</title>

</head>

<body>

<p>My first html page is hosted on my personal web server.

</body>

</html>

How to access home web server from the Internet

Now you have your personal Apache,PHP and MySQL webserver, you may want to access it from anywhere over the net. You need to know IP address of the machine running the web server. Within your home network you can access your webserver using host machine IP address (e.g. http://192.168.1.109).  In order to access your website from Internet you have to use the public IP address assigned by the ISP.

If you have a router connected to cable or dsl modem, you can obtain the public IP address from it. If you try access you web server using this IP address you may be presented with nothing or your router admin page (if outside access is permitted in the router configuration).

To access the webserver from Internet public IP address the router needs to forward the http request to your web server machine. This can be done forwarding the port 80 on the router to the web-server machine IP address. Most routers support port forwarding but you have to configure it.

First assign a private static address to the webserver. Assuming that router IP address is 192.168.1.1, then assign webserver something like 192.168.1.10,mask 255.255.255.0,gateway 192.168.1.1,dns 192.168.1.1 to the webserver machine. This is done from Control Panel->Network Connections->Local Area Connection->Properties->Internet Protocol->Properties.

internet-protocol-properties-assign-static-ip-address

internet-protocol-properties-assign-static-ip-address

Configure the router to forward port 80 to IP address 192.168.1.10.  Can can now access your website using routers public side IP address.

router-port-forward

How to access home web server using name instead of an IP address.

Most people do not get static IP address for ISP. It’s assigned dynamically through DHCP. So this IP address changes from time. It’s also difficult to remember the IP address.

Its possible to give home webserver a name access it using this name. Dynamic DNS is a free service and is supported by many home routers. Dynamic DNS maps your IP address to a named address. For example you can access your webserver using name like http://joe.webhop.com instead of  using http://10.45.x.y. Dynamic DNS maps the name  “joe.webhop.com” to IP adress 10.45.x.y.

dynamic-dns-configuration

In order to maintain mapping of name to the current router IP address, router notifies the Dynamic DNS host whenever there is a change in the IP address.

To setup Dynamic DNS check the Dynamic DNS service that is supported by your router. You need to sign up for free dynamic dns account. http://DynDNS.com is a popular free Dynamic DNS provider and is widely supported by home routers. You will be offered to select name and domain. For example you can select joe.webhop.com.Enter Dynamic DNS service user name ,password and host name joe in your router Setup->DDNS page. Save the settings and enjoy your web address http://joe.webhop.com.

Be Sociable, Share!

20 Responses to “Setting up a personal home web server”

  1. I have been thinking about this idea for a long time. I wondered if there are any on the market for sale yet. If one has their own personal server then they would not have to pay the greedy ISP’s that are charging a fortune for the use of their equipment on line whether it is by satelite or cable. After all, all one needs is a link to the internet with certain features built in. Now if the main ISP’s and server owner have this system, what is to stop someone else scaling one down to a personal mini size for each individual? Has it been done yet? This way we could all have one and after the initial cost, access to the internet would be FREE.

  2. as ive read your blog i was thinking. if this works i dont have to pay for hosting. am i right? but what about the domain??? how can i see my site online like http://www.example.com? do i still need do buy a domain name? please give me some tips. i want to have my own personal web server. thanks

  3. You don’t really have to have a domain name to start a webserver or website from your home computer. You can signg up with free Dynamic DNS services like dyndns.com and get a domain name like youname.dyndns.org. If you really want it to work with you own domain name like http://www.mydomain.com but it may not be free.

    The way it works is your home router contacts the dns service like dyndns.com whenever you IP address is changed by your ISP. Dyndns forwards the request to the new IP address. For http://www.mydomain.com to work you either need a static IP address from your ISP or pay for premium cutsom DNS services.

    [WORDPRESS HASHCASH] The poster sent us ‘0 which is not a hashcash value.

  4. Extremely Great .. Working like a dream .. thanks

  5. nice tutorial, thanks.

  6. Yes you can purchase domain name with companies like namecheap.com, godaddy.com etc. Be careful with the goddy’s up sell and complicated interface. You don’t really have to buy the hosting. Web hosting you can do it from you machine. You can ask your ISP for static IP address. Once that is set you can forward the NDS requests to this IP address.

    [WORDPRESS HASHCASH] The poster sent us ‘0 which is not a hashcash value.

  7. another free DNS provider is FREEDNS.afraid.ord\

    i use it to partk a domain Josh the owner is helpful as well

  8. Hi,

    Is it possible to host the web site without setting up port forwarding on the router ?
    I’m using a data card for accessing the internet. It has the same IP and default gateway.
    Kindly advice.

    Thanks..

  9. If you don’t have a router, you do not need port forwarding.

    [WORDPRESS HASHCASH] The poster sent us ‘0 which is not a hashcash value.

  10. can i publish my web pages with noip host name with dynamic ip address

  11. hi
    i create network between 2 pc with wireless modem
    can i share wamp without router?

  12. Can i add two domains to one wamp

  13. thanks for the informative writing..can I do this without having a router, I am using a broadband internet connection which don’t have any router..

  14. I installed LAMP on my fedora… I designed a website.. How to publish that website using LAMP?

  15. Sir,
    If l make webserver on my net work where I host It?, it will be host on des servers it’s mean a dns server like as 2000 windows server or 2003 server. What is the main Server? That control all webserver where I host my website
    Please details system and send my email
    Thanks
    AMIT GUPTA
    phone 9007387761.
    I wont host all system network under your control

  16. I need help on how to set up my computer to connect to internet using my share hosting server. Thanks

  17. Shivrajan Singh on February 9th, 2015 at 12:37 pm

    hello admin…I have broadband connection and when i browse my default gateway it is redirect to login page provided by my company not to the router page..also when I browse my public Ip address it is also redirect to the login page…what should I do to host website from my computer.

  18. iwant fix my phone it dont want to download whatsapp

  19. I am trying to make my PC as server and I didn’t have a router to configure.. I use a WiFi dongle as a source of internet for my server PC. When I tried to access my server from another PC with corresponding domain name it says “server may be slow or down”.

  20. Does this mean I need a dedicated PC just for my website? I am willing to do so but I was wondering if I would still be able to use my PC. Also on my IP the router already has a gateway there; how would I still have my domain/server?

Leave a Reply