1. Make sure your port 8000 is open
Nano /etc/sysconfig/iptables
Copy any of the rules (ctrl +K is cut, ctrl+U is paste) and swap the port for 8000, save and close
Service iptables restart
2. Go to the folder you want to share
cd /to/any/folder/you/want
3. Fire up the server
python –m SimpleHTTPServer
or
python -m http.server
4. Go to http://yourip:8000
Further information:
This will act as a regular apache server, if on that folder is a index.html file, it will be displayed, otherwise a list of the files on that folder will be shown.
To stop the server just press ctrl + C
To send the process to the background add a & symbol at the very end of any of the python commands
Otherwise press ctrl + Z and then type bg and enter
To stop the process when the above has been done just type:
Ps aux | grep python
Look for the first group of 4 or 5 digits and then type
Kill #####
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed