5W site logo 5W - мой домашний сайт-блог с картинками, кино и плюшками.

admin-run-http-server-into-directory.txt

Каждая из приведенных ниже команд будет запускать сервер на http://localhost:8000. Просто положите в закладки и пользуйтесь!
Команды для различного окружения:
Python 2.x
command shell

python -m SimpleHTTPServer 8000

Python 3.x
command shell

python -m http.server 8000

Twisted (Python)
command shell

twistd -n web -p 8000 --path .

или
command shell

python -c 'from twisted.web.server import Site; from twisted.web.static import File; from twisted.internet import reactor; reactor.listenTCP(8000, Site(File("."))); reactor.run()'

зависит от Twisted.
Ruby
command shell

ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => Dir.pwd).start'

Ruby 1.9.2+
command shell

ruby -run -ehttpd . -p8000

adsf (Ruby)
command shell

gem install adsf # install dependency
adsf -p 8000

Sinatra (Ruby)
command shell

gem install sinatra # install dependency
ruby -rsinatra -e'set :public_folder, "."; set :port, 8000'

Perl
command shell

cpan HTTP::Server::Brick # install dependency
perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mount("/"=>{path=>"."}); $s->start'

Plack (Perl)
command shell

cpan Plack # install dependency
plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root=>".");' -p 8000

Mojolicious (Perl)
command shell

cpan Mojolicious::Lite # install dependency
perl -MMojolicious::Lite -MCwd -e 'app->static->paths->[0]=getcwd; app->start' daemon -l http://*:8000

http-server (Node.js)
command shell

npm install -g http-server # install dependency
http-server -p 8000

node-static (Node.js)
command shell

npm install -g node-static # install dependency
static -p 8000

PHP (>= 5.4)
command shell

php -S 127.0.0.1:8000

Erlang
command shell

$ erl -s inets -eval 'inets:start(httpd,[{server_name,"NAME"},{document_root, "."},{server_root, "."},{port, 8000},{mime_types,[{"html","text/html"},{"htm","text/html"},{"js","text/javascript"},{"css","text/css"},{"gif","image/gif"},{"jpg","image/jpeg"},{"jpeg","image/jpeg"},{"png","image/png"}]}]).'

busybox httpd
command shell

busybox httpd -f -p 8000

webfs
command shell

webfsd -F -p 8000

зависит от webfs
IIS Express
command shell

C:> "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:C:\MyWeb /port:8000 Depends on IIS Express.

/path должен быть абсолютным