Skip to content

williamollio/webserv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webserv

Subject PDF

How does it work?

Setup

  • compile with make
  • run with webserv without any options
  • pick a browser of your choice and visit the server's website by entering the address specified in the *.conf file (standard is localhost)
  • have fun! (changes on the configuration file will only be applied after a server restart)

Configuration

The server can be configured with a configuration-file. This file is either specified at the startup or will be autogenerated by the server if not specified.

Config-File

  • currently we only support one server:
    • it can be specified with the keyword server {...}
    • the server allows following parameters:
      • server_names specifies server-addresses
      • ports specifies ports to listen to
      • root specifies the root folder of the server
      • index specifies the default file of the server
      • error_pagesspecifies the pages rendered depending on the error code returned
      • accept_files_manages the access right to upload files
      • cgi_pathspecifies path to the cgi
      • cgi_extension specifies extenstion of the cgi
      • client_max_body_size _specifies the size payload sent by the client
      • location can be specified further (after declaration only!):
        • directory_listing lists the files/folders of the location
        • upload determine specific folder to store files uploaded in the location
        • default_filespecifies the default file of the location
        • methods [GET / POST / DELETE] specifies the methods allowed of the location
  • comment with # comment to be ignored by the parser
  • a option is legal when formatted like: <option> : <input> , <input2> ; or <option> { <input> , <input2> }
  • mixing {} and : ; will result in a parser error
  • whitespaces and newline are handled the same
  • missing any delimiter results in undefined behaviour

About

HTTP server using TCP sockets written in C++98

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •