Use my PC as a web Server

szlynas

Beta member
Messages
2
Hi I am using ubuntu. I have a created a website using php. i have used xmpp to host the site.

i am in a local network (my ip is like 192.168.0.1) and i am wondering how i can make my site visible from anywhere, i mean outside the local network.


Please help
Thank you
 
Hi I am using ubuntu. I have a created a website using php. i have used xmpp to host the site.

i am in a local network (my ip is like 192.168.0.1) and i am wondering how i can make my site visible from anywhere, i mean outside the local network.


Please help
Thank you

In order to do that you need to forward port 80 through your router. I can't give you exact steps because each router is different, but you want to look for port forwarding or something of that nature. Then what you do is you assign port 80 + the 192.168.0.1 IP of your system and hit apply/okay. This will pipe port 80 traffic to your box internally.

Next you will need to know your static IP. Let's say your static IP is 170.100.200.4. If you put that IP into your web browser it'll route to your system within your LAN.

If you want, you can also set up DDNS. DDNS basically ties a domain name to your external IP address and updates itself automatically in the event your ISP changes your IP. That way if your IP changes from 170.100.200.4 to 180.100.200.10, the DDNS client will do that for you. That way you could have a DDNS domain name of like thisismyserver.ddns.org, and it'll route to your router, at which point your router will pipe into your system because you have the port forwarded.

In short:

Port forwarding = a requirement. Without this, you cannot route to your system internally.
External IP = a requirement IF you don't use DDNS.
DDNS = a requirement IF you want a more hassle free setup since your ISP can (and likely will) change your IP address automatically in the background at some point.
 
There are a some problem with doing this though;

Firstly port forwarding is punching a hole in your routers firewall to allow external connections through, if someone was to compromise the system hosting your website at home, they could use this system as a hub to the other systems on your local network. When it comes to your home network and all of the computers on it that store sensitive and personal information, I would reccomend that you steer well clear of punching holes in the firewall that is there to protect you.

Also, please don't take this the wrong way, but judging by the fact that you are unfamiliar with how to even make the site accessible externally, I am assuming you will be unfamiliar with the configuration of firewalls and various other security mechanisms that need to be appropriately configured before even considering opening a server to the public.

Also, I'm not sure how fast your internet connection is, but you'll find that most residential internet connections are pretty slow, at least when compared to the datacenters that most websites are hosted in. Users of your self-hosted website might come to find your site very slow, and speed is something that is important on the web. Not only because users tend to leave a website if it doesn't load within the first few seconds, but also because search engines such as Google now take into account a websites speed when choosing a rank in the search engines.

Not only that but if your website does prove popular then all the bandwith that is being used to serve the clients of your website will no longer be available for your general web browsing and downloads. If your site is really popular then you're probably going to be very frustrated with the slow connection.

And last but not least many ISP's have strict rules against hosting servers from your home network connection. I'd strongly recommend checking up on these rules before doing this.

If it helps you can get some pretty cheap shared hosting packages now that are not too bad. If you really need to you can get some free ones. Admittedly they are not the best, but they will serve the purpose and prevent the negatives of hosting it from home.

Hope this helps
 
Last edited:
Anything 192.168.x.x is an internal IP. You'll want to forward port 80 on your router (if your ISP lets you), to your internal IP. Then you can access the site from anywhere by using your external IP (google What's my IP and you'll see what it is).

Then you can set up a DNS server to use an actual name to point to your in home server. rather than typing in your IP every time.
 
Back
Top Bottom