Kuninoto / 42_webserv

A Web Server written from scratch in C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webserv (42Porto - 42Cursus) CPP Logo 

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

Grade: 100/100

Demonstration:

Overview

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

Disclaimer: Only tested on 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

3- Navigate to lvl_5_webserv and run make

cd 42_webserv/lvl_5_webserv
make

4- make clean so that you don't keep those object files that you won't need anymore

make clean

5- Run webserv

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

6- Open Firefox and search for localhost:8080

Subject (v20.4): webserv en_subject

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) | nnuno-ca@student.42porto.com

About

A Web Server written from scratch in C++

License:GNU General Public License v3.0


Languages

Language:JavaScript 74.7%Language:HTML 10.6%Language:CSS 7.4%Language:C++ 6.9%Language:Makefile 0.2%Language:Python 0.2%