Http Webserver in C for linux

- A basic web server written in C, uses threads instead of fork hence takes very few resources.
- Displays 404 error if a page is not found.
- Server displays the client's ip address and the path of the page requested.


- Compile the program with the -lpthread parameter.
  gcc -lpthread httpwebserver.c

- After compiling run the program with port number as the parameter.
  ./a.out 3000 (you can enter any free port number)

- Open your web browser and enter "" (without the quotes) where xyz is the port
  number you entered, in the address bar. The index.htm page will load.

- You will have to change the path of the default webpage. It depends on where you store the
  code file and the 'index.htm' page.

- To shutdown the server press Ctrl + C

System Requirements

- Linux
- Gcc

Download http webserver

Copyright 2002 - 07 Sumedh K