Host website without public IP

7,812

Solution 1

As you don't have a fixed or dynamic public address that you have control over, you'll need your ISP to port forward from the public address to your router. And then from your router again to your web server.

If your public address (search on-line for "what's my IP?") on the other side of your ISP's router is not static (as in it periodically changes), then you will have a further problem as your public address will keep adjusting. But this could be rectified with a dynamic DNS service.

I'd firstly talk to your ISP. Explain that you want to expose a web service on the Internet from your home server.

An alternative could be to use a reverse SSH tunnel. You connect to a server on the Internet from your web server and set up a reverse tunnel. All web requests to the remote server are then mapped back to your web server through the tunnel. There are many howtos for this available on-line.

Or you could place your files elsewhere on the Internet with web hosting. And periodically publish. This may be more secure than putting your home server on-line.

Solution 2

Your ISP gave you a static local IP address, which you could have done yourself. Unless you have no internet connection, you always have a public IP, but that IP is dynamic, meaning it changes periodically. What you want to do is set up a port forward. Most routers are capable of port forwarding, so this shouldn't be a problem for you. I can't give further advice than checking your router's web setup, as you haven't provided the actual model. If your router does have port forwarding, you need to forward ports 80 and 443 to the local IP address of your server.

Next, you'll want to set up a No-IP account and set up the DUC (dynamic update client). This will assign a sub-domain address to your public IP. The DUC is needed so the address you register with No-IP can keep referring to your public IP, even when it changes.

Once you have port forwarding and No-IP set up, you can now set your domain to point to the No-IP address. You should be able to do this using a masked redirect, or DNS.

You may have a problem though. Most ISPs don't want you running a home web server, and they usually block incoming connections on port 80. If this is the case, you'll need to set the server to run on some other port than 80. Good luck.

Solution 3

If you only have a static local IP then you can use a service and an application to have a roaming website.

Basically you install an app that will notify dyn what your IP has change to and they change the hostname they have given you. http://dyn.com/dns/

Not sure if this will work with your current registar, but you can move your domain to them and it works perfectly.

Also lots of utilities exist in the repos that will help with the service provider

apt-cache search dyndns

Solution 4

From what I read in your description, I don't think you can do it with your current setup unless your 'ISP' will do some port forwarding for you.

The IP address you have is an internal address, as already mentioned by a few answers. Your internet connection is behind a router/firewall that you most likely have no access to. I have a feeling that with your ISP, what you want is not possible. :(

Share:
7,812

Related videos on Youtube

ashubuntu
Author by

ashubuntu

Make an aim first to automatically get started ...

Updated on September 18, 2022

Comments

  • ashubuntu
    ashubuntu over 1 year

    I have installed LAMP stack. I have an internet connection. My ISP has given me a static IP, but it is not public. I have a TP-LINK router. I have a registered domain. Now, I want to host my own domain in my desktop that can be accessible from the outside world.

    Edit:

    Below are the posted router configurations. When I registered the domain, I was asked whether I merely wanted the domain registered, or also wanted their web-hosting service, and I only agreed to register the domain only.

    About the WAN status in the following image, when I clicked the Detect button, it detected WAN Connection Type as Dynamic IP. So I selected Dynamic IP from the drop-down list and changed the DNS Servers to 8.8.8.8 and 8.8.4.4 then saved the settings and rebooted the router, but I cannot browse the web this way. So, then I changed the settings as given in the image below as before and was able to browse again. How to configure the settings below, so that when I type my domain name from any device connected to the internet, I get the website that is being served from my /var/www/html/ folder. How to configure Apache or whatever. Please ask me any questions you need to help. I badly need my own server running although I shall use it for personal use. Thanks in advance.

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    • TheWanderer
      TheWanderer over 8 years
      You have to have some sort of public IP. If your ISP gave you a static IP and you know it's only local (not sure how that even works), then you have a dynamic public address. I'll write an answer assuming your public address is dynamic, showing how to make your domain direct to your public IP.
    • andy256
      andy256 over 8 years
      Your domain registrar needs to know your static IP address.
    • ashubuntu
      ashubuntu over 8 years
      ISP-given ip 192.168.40.186
    • TheWanderer
      TheWanderer over 8 years
      That isn't an address your ISP gave you. That should have come pre-configured on the router.
    • andy256
      andy256 over 8 years
    • Progrock
      Progrock over 8 years
      I wonder if there is confusion here between public (WAN) address and private (LAN) addresses. @ashubuntu, could you log into your router and check your WAN IP? Or rather confirm that it is the same as the 192.168 one listed above.
    • Progrock
      Progrock over 8 years
      @cremefraiche, it may be atypical but it is possible for an ISP to issue a private address.
    • cremefraiche
      cremefraiche over 8 years
      @Progrock I've never heard of this, but until I can research it I will have to take your word for it. Do you have references on this?
    • AzkerM
      AzkerM over 8 years
      @cremefraiche... It is always possible with a private IP address. I worked in Telecom and I use to provision GPON with private IPs to the end-user. Quite tricky to explain the topology.
  • TheWanderer
    TheWanderer over 8 years
    @Progrock no, they state that they have a static IP, but no public address. In the comments, they say the IP their ISP gave them is 192.168.40.x. That's an internal address. If this person doesn't even know they have a public IP address, I'm going yo say they have a dynamic address.
  • TheWanderer
    TheWanderer over 8 years
    @Progrock read my comment above.
  • TheWanderer
    TheWanderer over 8 years
    @Progrock I believe that their ISP is one of the ones that also set up the internal network, so when the OP asked for a static address they got a static internal address.
  • Kalle Richter
    Kalle Richter over 8 years
    Why build it? Ubuntu offers ddclient and possibly others from repositories.
  • thomasrutter
    thomasrutter over 8 years
    Also note: you don't need to have your domain registered through dyn to use their services; you would just need to set the nameservers correctly at your current registrar.
  • G Trawo
    G Trawo over 8 years
    I agree with Progrock. I have no idea how to do a reverse SSH tunnel, but I agree to utilize a external web hosting solution.