Pergunta

I am using Ubuntu and have Apache server installed. I have a small php project that I want to demo to someone. I thought I could make it available over the internet, but I am not sur ehow to go about it. Can someone please list out the things I need to do ( and if possible, why do I need to do that?)

The answers on the web are not really well structured and when I look at the comments sections, it says that the process never really worked for most of the people.

Thanks.

Foi útil?

Solução

Normally you would need to setup your router to allow access into your intranet. This can be done by forwarding a port. Usually you cant use port 80 on a home network connection and you need to use a different port to accomplish this.

Forward Port 8080 -> 80 on 192.168.0.15

Which means that when I goto 64.56.23.12:8080 through my web browser it will talk to my router, the router will then flip that port to 80 to the IP I designated.

Any changes to the config file will need a restart to fully reinstate.

... Now without any idea what your config file is, what internet company you have nor what your router model is I cant help you any further.

Basic Guide to Forwarding Ports -> How to Geek - Forwarding Ports


When you input an IP address in a web browser what happens on the back end is the web browser will append port 80 on the end of the IP address (unless you specify a port). So if your WAN IP address is 64.64.54.54 and you try to access it the browser will add the following to the end 64.64.54.54:80. The problem occurs is while this message to find this server finally reaches your ISP it comes through their (router, firewall) that basically says "Nope, We Dont Allow Home Servers. This Port is Known for HTTP traffic.". What happens next can vary but essential its the same end result. You dont see your server.

To get around this you need to do whats called port forwarding. We tell our home router that I am expecting traffic on port 8080 and I want all traffic that arrives through port 8080 to goto this LAN IP address on this port. You can either change the port to forward to port 80 or stay the same to 8080.

Unfortunately ISP's dont like to give out unique IP addresses and even more so like to provision what is called NAT (Network Address Translation). So that 64.64.54.54 might change day to day, month to month or once a year. The other issue is NAT, your LAN IP address is under NAT (192.168.x.x). You can think of NAT as an Apartment Complex, everyone has the same address but different apartment numbers. With out the apartment number no one would have any idea where to deliver your pizza.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top