Webber Logo

Webber Web Server

This is the documentation for our Go-powered web server.

Webber is a modern, high-performance Go web server inspired by Nginx, with support for static file hosting (optimized for Vue.js, React, Angular, and other SPA builds), reverse proxying, WebSocket, rate limiting, gzip compression, in-memory caching, HTTP/2, and TLS.

Features

Getting Started

This section will guide you through the initial setup and configuration of your Webber web server.

1. Installation

curl -sSL https://webber-docs.vercel.app/install.sh | sudo bash

The provided install script automates the setup process, performing the following actions:

2. Configuration

Customize your Webber Web Server by editing the /etc/webber/config.json file. Here's a detailed breakdown of the configurable parameters:

{
  "port": "443",              // The port on which the server will listen (e.g., "80" for HTTP, "443" for HTTPS).
  "static_dir": "/var/www/webber", // The directory from which static files (like index.html, JS, CSS, images) will be served.
  "rate_limit_rps": 10.0,     // The maximum number of requests per second allowed per client IP address.
  "rate_limit_burst": 20,     // The maximum burst capacity for the rate limiter, allowing temporary spikes in requests.
  "cache_ttl_seconds": 300,   // The time-to-live (TTL) for static file cache entries, in seconds.
  "certFile": "cert.pem",     // Path to your TLS certificate file (automatically generated by install.sh if not present).
  "keyFile": "key.pem",       // Path to your TLS key file (automatically generated by install.sh if not present).
  "debug": false              // Set to true for more verbose logging, false for production environments.
}

3. Deploy an SPA (Vue.js, React, Angular)

Vue.js

1. Build your Vue.js project:

npm run build

2. Copy the contents of the dist/ folder to /var/www/webber:

sudo cp -r dist/* /var/www/webber/
sudo chown -R webber:webber /var/www/webber
sudo chmod -R 755 /var/www/webber

3. Restart Webber to apply changes:

sudo systemctl restart webber

4. Visit https://localhost/ to see your Vue app in action.

React

1. Build your React project:

npm run build

2. Copy the contents of the build/ folder to /var/www/webber:

sudo cp -r build/* /var/www/webber/
sudo chown -R webber:webber /var/www/webber
sudo chmod -R 755 /var/www/webber

3. Restart Webber to apply changes:

sudo systemctl restart webber

4. Visit https://localhost/ to see your React app in action.

Angular

1. Build your Angular project:

ng build --prod

2. Copy the contents of the dist/<project-name>/ folder to /var/www/webber:

sudo cp -r dist/<project-name>/* /var/www/webber/
sudo chown -R webber:webber /var/www/webber
sudo chmod -R 755 /var/www/webber

3. Restart Webber to apply changes:

sudo systemctl restart webber

4. Visit https://localhost/ to see your Angular app in action.

Default Welcome Page

The current index.html you are viewing serves as a comprehensive demonstration of Webber's features and configuration options. To deploy your own single-page application, simply replace this file with your SPA's build output as detailed in the deployment instructions above.

Static File MIME Types

Webber automatically provides correct MIME types for all common static assets, including CSS, JavaScript, fonts, SVG, and more. This ensures seamless compatibility and optimal performance for modern frontend builds.

TLS Certificates

The install.sh script conveniently generates self-signed certificates for immediate use if no custom certificates are provided. For production environments, it is highly recommended to replace the default certificates located at /etc/webber/cert.pem and /etc/webber/key.pem with your own trusted TLS certificates.

Service Management

Manage the Webber service using standard systemd commands:

sudo systemctl status webber    # Check the status of the Webber service
sudo systemctl restart webber   # Restart the Webber service to apply configuration changes
sudo journalctl -u webber       # View the logs for the Webber service

Contributing

Contributions, bug reports, and feature requests are highly welcome!
Please feel free to open a Pull Request (PR) or submit an issue on the GitHub repository.

Built in Eswatini with ❤️ by ElectronSz.

GitHub Repo: https://github.com/ElectronSz/webber | Version: v1.0.3

This documentation is generated automatically from the Webber source code and is subject to change with each release.