Webserv is a small and effective web server created in C++. It gives a strong base for hosting web applications and delivering fixed content. Because it is easy to use and works well, Webserv can be used for many different purposes.
HTTP/1.1 Support
: Webserv supports the HTTP/1.1 protocol, allowing seamless communication with clients.Static Content
: Serve static files such as HTML, CSS, JavaScript, images, and more, making it easy to host static websites.Dynamic Content
: Handle dynamic content by supporting common scripting languages such as PHP, Python, and Perl.Virtual Hosting
: Configure and host multiple websites using virtual hosting, allowing you to serve multiple domains from a single server.Request Routing
: Define custom request routes to handle different URLs and paths based on your application's specific needs.
For more information on Webserv's features, see the Webserv Wiki.
To get started with Webserv, follow these steps:
- Clone the Repository: Clone the Webserv repository from GitHub:
git clone https://github.com/oaizab/Webserv.git
- Build the Server: Navigate to the project directory and build the server in release mode using make:
cd Webserv
make RELEASE=1
-
Configuration: Customize the server's configuration by modifying the webserv.conf or creating a brand new config file. Configure the server's ports, virtual hosts, and any other settings according to your requirements. For more information on configuring the server, see the Configuration File Wiki
-
Start the Server: Launch the server by running the built executable, you can use the default config file (config/webserv.conf) or specify a custom config file:
./webserv # Uses the default config file (config/webserv.conf)
./webserv /path/to/your/config-file.conf # Uses a custom config file
- Access the Server: You can now access the server by opening a web browser and navigating to
https://localhost:port
, where port is the configured port number in the configuration file (Assuming the web server is configured to listen on localhost).
Here's a quick example of a simple configuration file that serves static content:
server {
listen 8080;
server_name localhost;
location / {
root /path/to/your/static/files;
}
}
If you have any questions, suggestions, or feedback, feel free to reach out to the project team.