In great collaboration with Valentin, Abir, Dragos and Trung :)
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.
Install Python and Perl on your device (CGI)
- Python
sudo apt-get install python sudo apt-get install python-pip
- Perl
sudo apt-get install perl sudo apt-get install libcgi-pm-perl
-
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.
- Clone the repository:
git clone https://github.com/mariekart42/WEBSERVE.git
- Navigate to the project folder:
cd WEBSERVE
- Compile the project:
make all
- Run the game with a config file (keep it empty to use default config file):
./webserve (config.conf)
In the nginx like configuration File, you can change the Server Settings depending on your needs.
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
- Timeout - time the server will wait for a client to complete a certain operation
- 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
- Port - communication endpoint that identifies a specific process or service on a host in a networked environment
- 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
- Methods - lets you allow to only use specific HTTP Methods (we support POST, GET and DELETE)