This is a simple unix web-server designed to help me learn more about the how web servers and clients work.
- accepts GET, POST and HEAD requests
- can process simple php files
- is multi-threaded (the php processing is concurrent)
- gcc installed on the machine (Here is a guide)
- root privileges
Open a terminal in the desired directory on installation and proceed with the following commands:
git clone https://github.com/VladSteopoaie/Web-Server
cd Web-Server/webserver
make # should have gcc installed for this one
sudo mkdir -p /etc/webserver/http/home
sudo mv src/preprocess.php /etc/webserverYou can now move the web files into /etc/webserver/http/home and start the server with the command:
bin/webserverIf you want to make the programm grobally accessible follow this command:
sudo mv bin/webserver /usr/binNow you can type:
webserverIf you want to change some configurations of the web-server (root directory, port, number of threads):
sudo nano /etc/webserver/webserver.confAnd here is an example of configuration file:
root=/desired/path/to/the/web/files
port=8080
threads=8
Enjory playing and breaking it!