5

I understand that this is very commonly asked question. I too found tons of related thread but trying their solution didnt work for me. So i decided to ask it again.

Problem I would like to host my website from my laptop (on temporary basis. Once hosted from local machine i will switch to AWS free tier). But I am not able to do so.

What i have tried ?

My domain name: seaglegroup.co.in My ip addr: 116.202.34.38

  1. Mapped the IP of the domain to my IP address. To confirm same, now when I do ping seaglegroup.co.in, I get

    PING seaglegroup.co.in (116.202.34.38) 56(84) bytes of data.
    From 10.228.1.25 icmp_seq=1 Time to live exceeded
    
  2. Now I changed the /etc/hosts file added following entries.

    127.0.0.1   localhost
    127.0.0.1   116.202.34.38
    127.0.0.1   seaglegroup.co.in
    
  3. Now I ran my node.js application which return HTML page.

  4. Now when I type www.seaglegroup.co.in in browser, I am not getting anything.

Also when I run http://116.202.34.38:8080/ in browser, page doesn't load as request is not coming to Node.js program.

Just to eliminate Node.js issue, I ran localhost:8080 in browser and my web page loaded as expected.

I am not able to figure out where the issue is.

  1. I just saw output of sudo ufw status

    Status: inactive
    
  2. I enabled the port by sudo ufw enable

  3. Check the status again: sudo ufw status

    Status: active
    To                         Action      From
    --                         ------      ----
    80/tcp                     ALLOW       Anywhere
    80/tcp (v6)                ALLOW       Anywhere (v6)
    
  4. Restart my Node.js server, but still same problem persist.

EDIT2

My question doesnt look duplicate of linked question as

  1. Linked question is about LAmp server whereas i have Node.js involved.
  2. I am facing issue in some very specific area and linked question seems broader.
  3. Solution to linked question doesnot resolve my problem.
  • 3
    Your ping failed: "From 10.228.1.25 icmp_seq=1 Time to live exceeded". 127.0.0.1 116.202.34.38 - you can't map in IP to localhost that way. You mapped seaglegroup.co.in, not www.seaglegroup.co.in. – muru Sep 27 '15 at 5:37
  • 4
  • @muru But in DNS section of GoDaddy, i setting @ (A host) to my ip address. Do i need to put www.seaglegroup.co.in instead of @ in A host section. As i followed an unofficial tutorial, it was mentioned that @ points to current domain. – Gaurav Gupta Sep 27 '15 at 6:20
  • @muru Can you share the correct entry for /etc/hosts – Gaurav Gupta Sep 27 '15 at 6:56
  • You need a puplic IP for hosting your domain to your LOCALHOST. We have setup our domain to our IP See Host Your Site On Localhost for more details – jigarshahindia Aug 14 '16 at 4:45
6

There are two things here you are doing/trying to do.

1) Hosting on local machine (your laptop) for only your laptop with domain.

2) Hosting on local machine (your laptop) for everyone else (internet) with domain.

Choose the single appropriate solution

For first case:

Edit/Add in the /etc/hosts file to

127.0.0.1   seaglegroup.co.in

remove the

127.0.0.1   116.202.34.38

In the browser you will have to put something like

http://seaglegroup.co.in:8080

For second case:

If you want the internet to see your website you will have to port forward in the router settings. Find your local IP address of your laptop something like 192.168.number.number

Make the local laptop IP address permanent in the router (DHCP Reservation)

http://blog.dlink.com/mastering-static-ip-addresses-2/

http://kb.netgear.com/app/answers/detail/a_id/25722/~/how-do-i-reserve-an-ip-address-on-my-netgear-router%3F

Add port forward in your router to your local laptop IP (192.168.number.number)

Internal port - 8080

External port - 8080

IP address - Local laptop IP (192.168.number.number)

wikihow.com/Set-Up-Port-Forwarding-on-a-Router

portforward.com/english/routers/port_forwarding/routerindex.htm

Google "what is my ip". This is your internet IP Address.

Add DNS in GoDaddy @ pointing to your Internet IP Address

Your Internet IP might not be static and might change each time. So you will have to update the DNS every time.

Give some time for the DNS changes to propogate then in the browser you will have to put something like

http://seaglegroup.co.in:8080
| improve this answer | |
  • I still can't host my website. – John Strood Apr 23 '16 at 17:21
0

Normally ISP's don't like you hosting websites locally. But that said, I think you need to have your public IP forwarded to your local 192.168.X.X:8080 Configure that in your router.

Before you do that, make sure you can ping your public IP from an external source...maybe your smartphone?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.