Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access SimpleHTTPServer from outside Network

Apache server can be set up and accessed from ouside Network in the following way: http://lifehacker.com/124212/geek-to-live--how-to-set-up-a-personal-home-web-server I want to achieve similar functionality with python SimpleHTTPServer. How is this possible?

like image 971
Raghuram Vadapalli Avatar asked May 18 '15 14:05

Raghuram Vadapalli


People also ask

How do I access a home server from an outside network?

What is the best way to access a home server from an outside network? Depends what you want to do. But you will need either a fixed IP address or dynamic dns client to connect to your home server. Then you can access it using SSH or remote desktop. You could install a ftp or webserver on your home server and access it through that.

How do I run Python -m simplehttpserver on my router?

Note that python -m SimpleHTTPServer works only with python 2. With python 3, you should use: python -m http.server Step 2: Edit your router's configuration to forward port 8000 to the computer on which you ran the python command. Step 3: Determine your home network's IP address, for example, 203.0.113.47

How to use simplehttpserver as a file sharing method?

You also can use SimpleHTTPServer as a file sharing method. You just have to enable the module within the location of your shareable files are located. I will show you several demonstrations in this article by using various options. 1. Check whether python is installed in your server or not, by issuing below command.

How do I access a server with my IP address?

You’ll need to forward a port to the server machine. Then you can access the server with your public IP address and the port number. Usually through whatever type of interface the server is hosting. E.G. a web browser defaults to port 80 but something like Dropbox uses some for their interface such as 17500.


1 Answers

Step 1: Run this command "python -m SimpleHTTPServer". Note that python -m SimpleHTTPServer works only with python 2. With python 3, you should use: python -m http.server

Step 2: Edit your router's configuration to forward port 8000 to the computer on which you ran the python command.

Step 3: Determine your home network's IP address, for example, 203.0.113.47

One convenient way to determine your home network's IP address is to consult any of the what-is-my-ip websites, for example https://www.whatismyip.com/.

Step 4: From outside your network, visit (for example) http://203.0.113.47:8000/

like image 181
Robᵩ Avatar answered Sep 21 '22 18:09

Robᵩ