This project presents a custom-built web server written in C++. It's a lightweight and efficient server capable of handling HTTP requests and executing CGI scripts, specifically designed for PHP support. The server handles GET, POST, and DELETE methods and operates in a non-blocking manner using the select() system call. It supports multiple clients and servers concurrently, making it suitable for a range of web applications.
HTTP Methods: Supports GET, POST, and DELETE methods. Concurrent Connections: Uses select() for non-blocking, simultaneous handling of multiple clients and servers. CGI Support: Includes a handler for PHP, allowing the execution of PHP scripts. Default Files: Comes with a set of default HTML, CSS, and PHP files to demonstrate the server's capabilities.
Ensure you have a C++ compiler and make tool installed on your system. The server is built and tested on [specify OS and compiler version, if applicable].
- Clone the repository:
git clone git@github.com:maxstocklin/webserv.git- Compile the server:
make- Running the Server:
To start the server, use the following command:
./webserv [path_to_config_file]- Access the Web Server:
After starting the server with the default config file, you can access the default web pages provided. Point your web browser to http://localhost:[port] where [port] is the port number specified in your config file.
For example, to run the server with the default configuration:
./webserv confs/default.confYou can then access: http://localhost:80 or http://localhost:88 on your web browser
The server configuration can be modified using the config files located in confs/. The default configuration file is default.conf. You can create your custom config file following the same format.
Webserv is a 42 project.
