webserv is a HTTP/1.1 server written in C++98. It must be conditionnal compliant with RFC 7230 to 7235.
# Compile the sources
make
# Run the server
./webserv [options] [config_file]
-h, --help
: Display help text-t, --test
: Test the config file, dump it and exit-l, --log [LEVEL]
: Set the log level (between 0 and 2)-u, --uri
: Keep location uri on rooting (similar to nginx)
$ ./webserv -h
Usage: webserv [options] [config_file]
Options:
-h, --help : this help text
-l, --log [LEVEL] : set log level (between 0 and 2)
-t, --test : test config and exit
-u, --uri : keep location uri on rooting (similar to nginx)
sets a number of workers thread
sets configuration depending on the given uri.
bind the given address to the port. if no address is given, binds 0.0.0.0. if no port is given, binds 80.
sets names of a virtual server.
sets the directory for requests.
restrict a route to a user.
defines the URI that will be shown for the specified errors.
defines a directory to upload file.
enables or disables the directory listing output.
defines files that will be used as an index.
defines a CGI binary that will be executed for the given extension.
defines a folder where to search CGI binaries.
workers 4;
server {
listen 80;
root www;
error_page 404 /my_errors/404.html;
location / {
index index.html;
}
location /data {
cgi .php php-cgi;
}
location = /autoindex/ {
root www/data;
autoindex on;
}
location /my_errors {
root www/errors;
}
}
- webserv_tester by @acoudert
- webserv_tester by @fredrikalindh
- 42 tester :)