1

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

9
  • 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. Nov 30, 2015 at 23:44
  • Your domain registrar needs to know your static IP address.
    – andy256
    Nov 30, 2015 at 23:45
  • ISP-given ip 192.168.40.186
    – ashubuntu
    Nov 30, 2015 at 23:46
  • 1
    That isn't an address your ISP gave you. That should have come pre-configured on the router. Nov 30, 2015 at 23:47
  • That's a private network address.
    – andy256
    Dec 1, 2015 at 0:38

5 Answers 5

5

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.

1
  • 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.
    – G Trawo
    Dec 3, 2015 at 19:20
1

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
1
  • 1
    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. Dec 1, 2015 at 3:51
1

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.

3
  • 1
    @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. Dec 1, 2015 at 0:38
  • @Progrock read my comment above. Dec 1, 2015 at 0:39
  • 1
    @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. Dec 1, 2015 at 0:44
1

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. :(

0

I suggest you to build a DDNS (Dynamic Domain Name Server),which can easily to solve this problem.

For example, you can try to config a ddclient.

1
  • 1
    Why build it? Ubuntu offers ddclient and possibly others from repositories. Dec 1, 2015 at 3:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .