Although it was largely unfinished, the approach outlined in C10m would be interesting to see implemented here (via the intel user-space driver).
Nweb: a tiny, safe web server (static pages only)
31–40 of 63 posts
Re: Nweb: a tiny, safe web server (static pages only)
#32today i learned: there's still AIX. Huh, really?
Re: Nweb: a tiny, safe web server (static pages only)
#33Earlier quoted context omitted.
This is hardly in the category of "lightweight and secure", but for impromptu stuff, this Ruby+Rack one-liner serves directory listings and static files from the current directory: ruby -e 'require "rack"; include Rack; \ Server.start :app => Directory.new(".", \ Static.new(nil, :urls => ["/"], :root => "."))'
python -m SimpleHTTPServer
ruby -run -ehttpd .
Here's a handy snippet for bashrc: function S {
ruby -run -ehttpd . -p${1-8080} # default to port 8080 unless given as parameter
}Re: Nweb: a tiny, safe web server (static pages only)
#34Earlier quoted context omitted.
python -m SimpleHTTPServer
although that server is very horrible
Re: Nweb: a tiny, safe web server (static pages only)
#35I am always on the look out for a small, lightweight and secure web server for impromptu file sharing. Right now I use publicfile from djb.[^1] My only complaint is that there is no debian package for publicfile so I have to build my own package. I would love to find an equivalent (ftp not necessary) daemon that is included in debian. Is anyone aware of a something in debian repos that I am overlooking? [^1]: http://…
DJB appears to have changed the license to public domain, but at some point in the past there was a license that prohibited distribution of binaries from modified source. There's still the request that the paths not be changed to comply with the FHS.
DJB has strong opinions about the construction and distribution of software. So do quite a lot of debian people. These views are incompatible.
Re: Nweb: a tiny, safe web server (static pages only)
#36I am always on the look out for a small, lightweight and secure web server for impromptu file sharing. Right now I use publicfile from djb.[^1] My only complaint is that there is no debian package for publicfile so I have to build my own package. I would love to find an equivalent (ftp not necessary) daemon that is included in debian. Is anyone aware of a something in debian repos that I am overlooking? [^1]: http://…
This is hardly in the category of "lightweight and secure", but for impromptu stuff, this Ruby+Rack one-liner serves directory listings and static files from the current directory: ruby -e 'require "rack"; include Rack; \ Server.start :app => Directory.new(".", \ Static.new(nil, :urls => ["/"], :root => "."))'
#!/bin/bash
unlink /Library/WebServer/Documents
ln -s "$(pwd)" /Library/WebServer/Documents
echo "http://localhost/ mounted on $(pwd)"
Of course, it's only "lightweight" in as far as you already have Apache installed and running.Re: Nweb: a tiny, safe web server (static pages only)
#37Earlier quoted context omitted.
although that server is very horrible
Works fine for some tests, but it's single threaded. If you need concurrency: twistd -no web --path=.
Python is nearly always installed, and that depends on nothing but the standard library. You can stick an alias in your dotfiles (I have, it's called "serve-this") and not have to worry about having twisted¹ getting to wherever your dotfiles get put. (I distribute my dotfiles over git/github, so it's really easy to move them around. More work to get Twisted.)
¹Or Ruby… or Go…
Re: Nweb: a tiny, safe web server (static pages only)
#38I want to learn a bit about web servers and I think that study the source code of a functional one may worth more than try to build something from scratch at first glance. Since I'm seeing too many comments on the security issues of this particular project, can you guys recommend something more reliable? Thanks in advance. Edit: I "know" C and C++ and would like to remain in one of these languages, if it's not asking…
Having said this, have a look at Wt and Poco
Re: Nweb: a tiny, safe web server (static pages only)
#39Adding to what everyone else has said, this also "how not" to write socket code; for instance, the assumption that you can read a whole HTTP request "in one go" with a single large read call is false. Also, casting function calls to (void) is nonsensical. You can perhaps forgive the sprintf() call because, AIX. (Believe it or not, there was a time when snprintf was a portability problem). You can't forgive the log()…
> Also, casting function calls to (void) is nonsensical. Does extremely pedantic C require the results of function calls to be used? I know the correct way to mark a variable as unused is to cast it to void, but I'm not sure if you're supposed to do that for function return values as well.
(void)create_widget(&widget);
It's clear that `create_widget` returns some value -- it's probably an error code that tells us whether the widget creation was successful. The source code here says "I know this function returns an important value, but I'm going to disregard it here". This could be useful for debugging if you find that, for example, an error condition is being handled improperly (e.g. "oh, we're obviously throwing out the return value of this function, which we shouldn't be doing"). This function call is much less informative: create_widget(&widget);Re: Nweb: a tiny, safe web server (static pages only)
#40I am always on the look out for a small, lightweight and secure web server for impromptu file sharing. Right now I use publicfile from djb.[^1] My only complaint is that there is no debian package for publicfile so I have to build my own package. I would love to find an equivalent (ftp not necessary) daemon that is included in debian. Is anyone aware of a something in debian repos that I am overlooking? [^1]: http://…
http://smarden.org/pape/Debian/unofficial/why.html DJB appears to have changed the license to public domain, but at some point in the past there was a license that prohibited distribution of binaries from modified source. There's still the request that the paths not be changed to comply with the FHS. DJB has strong opinions about the construction and distribution of software. So do quite a lot of debian people. These…
I think the reason is low demand largely due to the fact that gnome-desktop depends on gnome-user-share (AKA: apache).