On Thu, Nov 8, 2012 at 3:40 AM, Electron wrote: > > Howdy, > I got a vserver running Ubuntu. > > I'd like to write a tiny web server for it.. but I only have experience i= n > doing it > on Windows. > > Could anyone possibly guide me on how to install gcc (?) and a > minimalistic hello world > program for Linux to interface with TPC/IP sockets? > > Cheers, > Mario > Two ways to go about it as follows: A) If you need to get a job done, and you need a very small (low CPU, memory) and very high performance open source HTTP server, look no further than Nginx http://nginx.org It's quickly becoming the most popular HTTP server. Supports WSGI, FCGI, etc. Lots of modules and plugins and it's designed well and extremely fast. B) If this is for educational purposes, the *right* way to do it is to use an asynchronous socket and single process model (which can scale to as many process as there are CPUs) and using IO event callbacks. In addition, on Linux, use epoll() which is the current *correct* way to do it. There are two very good libraries for this: libev (better than libevent), and boost c++ libraries (very high quality, peer reviewed, open source standard libraries for c++). Last month, I wrote a very simple hello world echo sever using the boost c++ libraries. Here's the source code: https://github.com/veegee/asio_server_test_1 Just download/git pull, and type `make`. Requires boost libraries and libyaml. You can get rid of the libyaml requirement by hardcoding the port number into main.c/main.h instead of using libyaml to read a configuration file. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .