Skip to content
This repository was archived by the owner on Nov 9, 2025. It is now read-only.

RGBToaster299/MyTinyWebServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MyTinyWebServer

Status License

MTWS is a small but useful web server for small projects.
(Not intended for real web hosting — for that, I recommend Nginx.)


Caution

You can get the newest Version here

How to Compile

A compiled version is already included.
However, if you've made changes and want to compile it yourself, follow these steps.

(If you don't want to compile it, just download the mtws.cpp file and place it in your root web folder. Then skip to Step 3.)

1. Setup

Make sure you have the GNU C++ Compiler installed.

Debian/Ubuntu-based:

sudo apt install g++

Arch-Based:

sudo pacman -S gcc

Fedora/RHEL/CentOS:

sudo dnf install gcc-c++

openSUSE:

sudo zypper install gcc-c++

Windows:

  • Install MSYS2
  • Then run: pacman -S mingw-w64-x86_64-gcc

macOS:

  • Install Xcode Command Line Tools:
xcode-select --install

2. Compiling

Clone the repository:

git clone https://github.com/RGBToaster299/MyTinyWebServer.git

Navigate into the new folder:

cd MyTinyWebServer/

Compile the project:

g++ -std=c++17 -o mlws mlws.cpp -ldl

You should now have a compiled binary named mlws.


3. Running the Server

  1. Put the mlws binary into your web folder
    (this folder will be used as the root directory for your website).
  2. Open your terminal (if not already open).
  3. Run the server:
./mlws -p 8080

The server should now be running.

Stopping the Server

Type stop into the console.


Plugins?

Yes, plugin support is planned for MTWS.
However, I'm currently focusing on improving the stability of the core project.


Explorer

MTWS includes a built-in file explorer.
It is shown when the current directory doesn't contain an index.html (or any .html) file.


Port 80 Issues

Port 80 may not work on some systems — this is likely due to:

  • Permission issues (requires root/admin on many OSes)
  • Another process already using the port

This is a known issue, and I'm working on resolving it.
If you manage to fix it, feel free to contribute via pull request or commit!


Supported Platforms

MTWS runns as expected on Linux. Untested on Windows or MacOS.


License

This project is licensed under the
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
See license.txt for full legal terms or visit the official license page.

About

MTWS is a small but useful web server for small projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages