PDA

View Full Version : Create a simple python webserver



Void
03-07-2015, 12:12 PM
the server must have python installed to see if its there use this command :



whereis python

---------------------------
result :

/usr/bin/python3.4m /usr/bin/python /usr/bin/python2.7 /usr/bin/python3.4 /etc/python /etc/python2.7 /etc/python3.4 /usr/lib/python2.7 /usr/lib/python3.4 /usr/bin/X11/python3.4m /usr/bin/X11/python /usr/bin/X11/python2.7 /usr/bin/X11/python3.4 /usr/local/lib/python2.7 /usr/local/lib/python3.4 /usr/include/python2.7 /usr/share/python /usr/share/man/man1/python.1.g



if u get the result like the one above ur good to go ..

the go to the directory that u want to access by browser :



$ cd /home/user/public_html
$ python -m SimpleHTTPServer

view it with browser :



http://IP-OR-DOMAIN:8000

fowosere
01-26-2017, 06:12 PM
what types of modules can we use the server to load

piticu81
02-17-2017, 04:44 AM
tanks man for this

lincecum
05-13-2017, 06:16 PM
easy and fast to do! ty

WarnerBross
01-16-2018, 06:52 AM
Interesting, thank you for this information...