Project developed by onapoli- & pmira-pe students from 42.
webserv aims to teach how web servers work. So this project is like an Nginx made from zero using C++98 with no external libraries and targetting UNIX operating systems. It implements HTTP/1.1 protocol and CGI/1.1 interface.
- UNIX environment (https://en.wikipedia.org/wiki/Unix)
- GNU Make (https://www.gnu.org/software/make/)
-
For default configuration. Inside the repository directory run:
make && make startThis will automatically compile the project into
webservexecutable and execute it with a config file that is based ontests/example_config.json. A directorytests/www/is generated containing the root directory for the web server and the website content. -
For alternative default configuration. Inside the repository directory run:
makeThen run:
./webservThis will run the server using
default.json, located at.default/directory, as the server configuration file, and having.defaultdirectory as the server's root. -
For custom configuration. Create a custom config file in
jsonformat (check outtests/example_config.jsonfor reference). Inside the repository directory run:makeThen run:
./webserv path_to_your_custom_config.json
Once the server is running, open a web browser, go to http://configuredhost:configuredport and visit the different configured routes (locations).
These config files have strict rules. Check tests/example_config.json to have an idea of the available options, and feel free to modify it.
-
To stop the server. In the terminal where the server is running press:
Ctrl + C -
To clean the repository folder removing
webservexecutable, object files (.o),tests/wwwdirectory and generated config file. Inside the repository directory run:make fclean