Created
October 17, 2013 21:34
-
-
Save justinriggio/7032587 to your computer and use it in GitHub Desktop.
python simple http server info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open up a terminal and type: | |
$ cd /home/somedir | |
$ python -m SimpleHTTPServer | |
That's it! Now your http server will start in port 8000. You will get the message: | |
Serving HTTP on 0.0.0.0 port 8000 ... | |
Now open a browser and type the following address: | |
http://192.168.1.2:8000 | |
You can also access it via: | |
http://127.0.0.1:8000 | |
If the directory has a file named index.html, that file will be served as the initial file. If there is no index.html, then the files in the directory will be listed. | |
If you wish to change the port that's used start the program via: | |
$ python -m SimpleHTTPServer 8080 | |
link: http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment