Skip to content

Webserv is a HTTP server implementation as part of the 42 school curriculum. This project focuses on building a robust web server capable of handling multiple client connections, serving static and dynamic content, and managing various HTTP requests. It is developed in C++98 and aims to provide a fundamental understanding of web server architecture

mariekart42/WEBSERVE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WEBSERVE

yeeee

In great collaboration with Valentin, Abir, Dragos and Trung :)

WEBSERVE - 42 Project

Webserv is a web server implementation project for the 42 school curriculum.
This project aims to create a basic HTTP server capable of handling multiple client
connections and serving static and dynamic content over HTTP.

Table of Contents

Requirements

Install Python and Perl on your device (CGI)

  1. Python
    sudo apt-get install python
    sudo apt-get install python-pip
  2. Perl
    sudo apt-get install perl
    sudo apt-get install libcgi-pm-perl

Key Feautures

  • Asynchronous I/O:   Handles multiple client connections concurrently without blocking.

  • Configurable:   Supports configuration files to customize server behavior.

  • Static & Dynamic Content:   Serves static files and processes dynamic content using server-side scripting.

  • HTTP Protocol:   Implements basic HTTP methods like GET, POST, DELETE.

  • Scalable:   Designed for scalability and optimal performance.



Getting Started

  1. Clone the repository:
    git clone https://github.com/mariekart42/WEBSERVE.git
    
  2. Navigate to the project folder:
    cd WEBSERVE
    
  3. Compile the project:
    make all
    
  4. Run the game with a config file (keep it empty to use default config file):
    ./webserve (config.conf)



Configuration

In the nginx like configuration File, you can change the Server Settings depending on your needs.

sample config sample config

We support:

  • Global Settings:
    • Timeout - time the server will wait for a client to complete a certain operation
    • Max_clients - determines how many clients can be served at the same time
    • Body_size - specifies the maximum size of the client request body
    • Max_events - maximum number of connections each worker process can handle
    • Backlog - maximum length of the queue of pending connections
    • Backlog - maximum length of the queue of pending connections

  • Server Settings:
    • Port - communication endpoint that identifies a specific process or service on a host in a networked environment
    • Host - specifies the host or domain names associated with this server block
    • Body_size - same as in Global Settings, but specific for initialized server
    • Error_Page - allows user to change default error pages to custom-made error pages

  • Location Settings:
    • Methods - lets you allow to only use specific HTTP Methods (we support POST, GET and DELETE)
    • Autoindex - lets you enable or disable directory listing (listing of folders and subfolders)
    • Index - specify the default file the Server should look for when a client accesses a directory
    • Redirect - redirect the current path to the path specified after redirect



Screenshots

index page directory indexing

About

Webserv is a HTTP server implementation as part of the 42 school curriculum. This project focuses on building a robust web server capable of handling multiple client connections, serving static and dynamic content, and managing various HTTP requests. It is developed in C++98 and aims to provide a fundamental understanding of web server architecture

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •