- 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-addressescgi_ext
specifies of the extenstion of the cgi'scgi_bin
maps extensions to binariescgi_methods
methods allowed on CGI requestscgi_root
specifies path in which requests are always directedport
specifies ports to listen toloc
predeclares the locationserror_pages
specifies the pages rendered depending on the error code returnedaccept_files
manages the access right to upload filesroot
specifies the root folder of the serverindex
specifies the default file of the serverupload
determine specific folder to store files uploaded by defaultclient_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 locationroot
specifies the root folder 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 locationredirect
specifies the path where requests should be redirected to
- 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
The config file can be changed in the Makefile or should be set as an argument.
PHP should be installed if you want to access the directory listing, indeed the path to it should be set up in directory_listing.php (default path : /usr/bin/php).