ztbrown / Porter

A work-in-progress web server written in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

status badge

Porter

Porter is a simple web server written in C. This web server runs on GNU/Linux.

What is it?

This web server is far from complete. The plan is to modularize GoHttp, write tests, add features and eventually produce a small library that can be included in future projects.

What are its capabilities?

It currently supports GET so you can use it to receive any files that correspond with the mime types in mime.types.

Prerequisites

  • gcc
  • Make
  • c99
  • Docker

How do I run it?

  1. Download the source
  2. Compile the source using make
  3. Run from root directory with ./main
  4. Run the tests with make check

Command line arguments

You can start the web server with the following command line arguments:

-p port number
-d run as daemon
-l log file

What about configuration?

You can open httpd.conf and change the following:

wwwroot /home/frw/public_html/
port 7000

Credit

This project was originally forked from GoHttp, a really great resource. I also spent a lot of time reading Beej's Guide to Network Programming.

From fekberg: "If it weren't for the course in Advance UNIX Programming that I took at Blekinge Institute of Technology I would never have written this. It all originated from a question on StackOverflow from 2009 where I asked for information on how to write a simple web server in C."

About

A work-in-progress web server written in C


Languages

Language:C 92.7%Language:Makefile 6.4%Language:C++ 0.6%Language:Shell 0.4%Language:ApacheConf 0.1%