Skip to content

Kuninoto/42_webserv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webserv (42Porto - 42Cursus)

Project done in collaboration with:
Rodrigo Ramos
João Arsénio

Grade: 100/100

Demonstration

Description

42_Webserv is a web server written from scratch in C++ (C++98), capable of handling multiple clients simultaneously.

Disclaimer: Only tested with Firefox

Features

  • NGINX-like configuration file
  • Handling of the GET, POST and DELETE HTTP request methods
  • File upload
  • Python CGI support

Installing and running the project

1- Installing webserv dependencies:

sudo apt-get install c++ make  

2- Clone this repository:

git clone https://github.com/Kuninoto/42_webserv webserv

3- Navigate to the project's folder, compile and wipe the artefact object files:

cd webserv && make && make clean

3- Run webserv

./webserv <config_file>
or
./webserv
which is the same as:
./webserv config/default.conf

4- Open Firefox and search for localhost:8080

Makefile available targets

make or make all - compiles webserv
make clean - wipes all object files
make fclean - deletes webserv and all object files
make re - fclean + all

Useful links

What is HTTP?
Definition
HTTP Crash Course & Exploration

Understanding HTTP
HTTP Request Methods:
Overview
GET
POST
DELETE

HTTP Docs
HTTP Header Fields

What is a Web Server?
Definition
Concepts and Examples
How to build a simple HTTP server from scratch

Sockets
Definition
What exactly is a Socket?

I/O Multiplexing
Socket programming with select(), poll() and epoll() in Linux poll() man page

NGINX
Definition
Understanding NGINX configuration file

CGI
Common Gateway Interface (CGI)
Python CGI Programming

General
Blocking vs. Non-blocking I/O
URL vs. URI


Made by Nuno Carvalho (Kuninoto) | [email protected]