Code Monkey home page Code Monkey logo

ft-webserv's Introduction

ft webserv

Description

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.

Installation

Requirements

  • C++ compiler
  • Make
  • Python 3.8
  • Python3-dev

Build

To build the project, run make in the root directory of the project.

Run

To run the project, run ./webserv and pass it a configuration file as an argument.

example: ./webserv default.conf

Configuration

The configuration file is a simple text file that contains the configuration for the server.

Syntax

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.

Blocks

server

The server block is the root block of the configuration file. It contains the configuration for the server.

Arguments
  • host - The host to listen on. Defaults to localhost.
  • port - The port to listen on. Defaults to 80.
  • error_page - The path to the error page. Defaults to error.html.
  • server_name - The server name. Defaults to localhost.
  • root - The root directory. Defaults to ./.
  • index - The index file. Defaults to index.html.
  • client_max_body_size - The maximum size of the request body.
  • autoindex - Whether to enable autoindex. Defaults to off.
  • cgi - Whether to enable cgi. Defaults to off.
  • cgi_folder - The folder of the single cgi script.

location

The location block contains the configuration for a location.

Arguments
  • 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.

Contributors

Anderson Porto avatar
Anderson Porto
Davi Moreira avatar
Davi Moreira
Flavio Bonini Campos  avatar
Flavio Bonini Campos

ft-webserv's People

Contributors

andersonhsporto avatar daviprograme avatar gitflaviobc avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.