This project is part of the 42 Lisboa curriculum and involves developing an HTTP server in C++ from scratch to serve static files. The server is capable of hosting a fully static website, supports HTTP/1.1, and handles GET, POST, and DELETE methods. Additionally, it can execute CGI scripts in any language installed on the server host.
For more information about WebServ, see the project subject.
To define how your website will be served such as routes, methods, and other options you need to create a configuration file where you can specify all the necessary rules. The configuration file uses YAML syntax for easy readability and flexibility.
For a full list of configuration requirements, click HERE.
This project is designed to work on Linux.
git clone [email protected]:dspereira/42Cursus-webserv.git webserv && cd webserv
make
You can place your configuration file, website source files, and CGI scripts anywhere, but for better organization, we recommend using the following folders:
conf.d
: Configuration fileswww
: Website source filescgi-bin
: CGI scripts
In your configuration file, ensure you specify the correct paths for the chosen folders.
./webserv path-to-your-config-file
GET / HTTP/1.1
Host: localhost:8080
User-Agent: insomnia/2023.5.8
Accept: */*
HTTP/1.1 200 OK
Server: webserv/1.0
Date: Wed, 27 Sep 2023 21:28:10 GMT
Content-Type: text/html
Content-Length: 0
Connection: keep-alive
This project is licensed under the MIT License.