A simple multi-client webserver written in C
10K+
This small multi-client webserver is written as an assignment submission. It can handle many concurrent connections and implements a basic subset of the HTTP/1.1 standard according to RFC 2616
Start by editing the configuration file, modifying servers as required. For SSL, ensure the certificate paths are correct. All paths are relative to the webserver binary.
Ensure the config is readable from the working directory when the server starts. The certificates will be read upon the first connection to the server, so make sure to test it! (Caused by issue #4)
Specify the config on the command line with the -c flag: webserver -d -c <config-file> (Adding -d for optional daemon mode, if not specified in the config)
The following libraries are required for this program to build and run:
file or file-dev typically.pcre, libpcre or pcre-dev typically.openssl or openssl-dev typically.All of the above should be available in your package manager as <package> or <package>-dev.
It can be built and run with the following command:
make all run
The simplest way to run this program is via Docker. You can download run the pre-built image from DockerHub (frebib/c-webserver) by omitting the docker build step; Docker will pull the image from the repository instead.
Build the container and run it with the following commands:
docker build -t frebib/c-webserver .
docker run -d --name webserver -p 8088:8088 frebib/c-webserver
To view the output, view the logs:
docker logs -f webserver
Content type
Image
Digest
Size
8 MB
Last updated
over 9 years ago
docker pull frebib/c-webserver