This project is a web server. It is able to handle HTTP requests and responses, and is able to serve static files. It is also able to handle python and binary cgi scripts.
- C++ compiler
- Make
- Python 3.8
- Python3-dev
To build the project, run make in the root directory of the project.
To run the project, run ./webserv and pass it a configuration file as an argument.
example: ./webserv default.conf
The configuration file is a simple text file that contains the configuration for the server.
The configuration file is inspired by the nginx configuration file syntax. Each block starts with a line containing the name of the block, followed by a colon, and then a list of arguments. The arguments are separated by spaces. The block ends when a new block starts.
The server block is the root block of the configuration file. It contains the configuration for the server.
host- The host to listen on. Defaults tolocalhost.port- The port to listen on. Defaults to80.error_page- The path to the error page. Defaults toerror.html.server_name- The server name. Defaults tolocalhost.root- The root directory. Defaults to./.index- The index file. Defaults toindex.html.client_max_body_size- The maximum size of the request body.autoindex- Whether to enable autoindex. Defaults tooff.cgi- Whether to enable cgi. Defaults tooff.cgi_folder- The folder of the single cgi script.
The location block contains the configuration for a location.
path- The path of the location.root- The root directory. Defaults to the root directory of the server.limit_except- The methods that are allowed for this location.cgi_lock- flag to indicate if the route is a cgi route.
|
Anderson Porto |
Davi Moreira |
Flavio Bonini Campos |