Skip to content

VLN37/webserv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webserv

This project is about writing a HTTP server, similar to Nginx, Apache or Lighttpd.

What is Webserv?

Webserv is a group project at 42 which requires us to build a HTTP server using I/O Multiplexing built on top of an event loop.

In the mandatory part, we start the server by reading a configuration file loosely based on Nginx configuration options, allowing customization of features such as, hostname(ip/port), servername, index file, directory listing, URL redirect, location(vhost path), among other settings. It is forbidden to use fork to create new non-CGI processes or spawn threads (threads are not available in C++98).

Using I/O Multiplexing the Kernel informs the server of any incoming and outgoing data availability in monitored file descriptors; we can use select, poll, epoll or kqueue. Prior to reading or writing in a socket it is strictly required that the server goews through poll() or equivalent, ensuring high server availability, respecting the event loop.

HTTP requests are read, parsed, processed and sent to a CGI, which can be customized 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, session management and handle multiple CGI.

Availability

alt text

Badge

Skills

  • Network & system administration
  • Unix
  • Rigor
  • Object-oriented programming

My grade

Getting started

Follow the steps below

# Clone the project and access the folder
git clone https://github.com/VLN37/webserv && cd webserv/

# Run make so you can build the program and install dependencies
# the dep directive asks for sudo permissions in order to install php-cgi
make && make dep

# Run the application with the provided configuration file
./webserv default.conf

# Access the default website using the URL below
http://localhost:3490

# Clean output objects with
make fclean

# Well done!

Updating

The project is regularly updated with bug fixes and code optimization.

📝 License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.


Made by: João Rodriguez 👋 See my github
Paulo Santana 👋 See my linkedin
Welton Leite 👋 See my linkedin

About

Inspired in nginx

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published