python -m SimpleHTTPServer
python -m SimpleHTTPServer 1337
Serving HTTP on 0.0.0.0 port 1337 ...
#!/usr/bin/env python# -*- coding: utf-8 -*-#Simplemente corre el servidorimport sys, baseHTTPServer, simpleHTTPServerservidor = baseHTTPServer.HTTPServerhandler = simpleHTTPRequestHandlerp_version = "HTTP/1.1"if sys.argv[1]: if sys.argv[1] == "-h": print "Uso:" print "cd Directorio" print "./script.py puerto" else: puerto = int(sys.argv[1])else: puerto = 8000 direccion = ("127.0.0.1", puerto)handler.protocol_version = p_versionhttp = servidor(direccion, handler)http.serve_forever()
quim@GAZPACHO$ cd /home/quim/phpHTTP
php -S 127.0.0.1:1337
PHP 5.4.4-14+deb7u7 Development Server started at Thu Mar 27 19:13:58 2014Listening on 127.0.0.1:1337Document root is /home/quim/phpHTTPPress Ctrl-C to quit.