This project is about writing a HTTP server, your own version of Nginx, Apache or Lighttpd.
Webserv is a group project at 42 which requires us to build a HTTP server using I/O Multiplexing built on top of a event loop.
In the mandatory part, we start the server by reading a configuration file that can be based on Nginx, containing information like hostname(ip/port), servername, index file, directory listing, URL redirect, location(vhost path) and some other settings. It is forbidden to use fork to create new non-CGI processes or spawn threads (threads are not available in C++98).
For the I/O Multiplexing, ie informing the Kernel that we want to be notified if there is a change in a previously specified list of file descriptors; we can use select, poll, epoll or kqueue. All socket reads or writes must pass through poll() or equivalent, ensuring high server availability, respecting the event loop.
HTTP requests are read, parsed, processed and sent to a CGI if configured in the configuration file and finally a HTTP response is returned to the client with headers, body and correct HTTP status code.
For the bonus we have to support cookies and handle multiple CGI.
- Network & system administration
- Unix
- Rigor
- Object-oriented programming
Follow the steps below
# Clone the project and access the folder
git clone https://github.com/Scaramovistk/WebServ.git && cd WebServ/
# Run make so you can build the program and install dependencies
make && make dep
# Run the application with a config file
./webserv example_config
# Access the default website using the URL below
http://localhost:2000
# Clean output objects with
make fclean
# Well done!
Made by:
Yannick Jorus 👋
Gabriel Scaramal 👋