- 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)
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.
- currently we only support one
server
:- it can be specified with the keyword
server {...}
- the server allows following parameters:
server_names
specifies server-addressesports
specifies ports to listen toroot
specifies the root folder of the serverindex
specifies the default file of the servererror_pages
specifies the pages rendered depending on the error code returnedaccept_files
_manages the access right to upload filescgi_path
specifies path to the cgicgi_extension
specifies extenstion of the cgiclient_max_body_size
_specifies the size payload sent by the clientlocation
can be specified further (after declaration only!):directory_listing
lists the files/folders of the locationupload
determine specific folder to store files uploaded in the locationdefault_file
specifies the default file of the locationmethods
[GET / POST / DELETE] specifies the methods allowed of the location
- it can be specified with the keyword
- 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