🐺🌐 WolfServe

High-Performance PHP Web Server

Overview

WolfServe is a high-performance web server written in Rust that serves PHP applications via FastCGI with native SSL/TLS support and Apache configuration compatibility. It's a drop-in replacement for Apache2 β€” just point it at your existing Apache vhost configs and go.

Β© 2026 Wolf Software Systems Ltd β€” GitHub Repository

⚑

Blazing Fast

Built on Axum & Tokio for maximum async performance. Handles thousands of concurrent connections.

🐘

PHP Support

Execute PHP files via FastCGI (php-fpm or php-cgi). Full PHP 7.4+ compatibility.

πŸ”

SSL/TLS

Native HTTPS support with SNI for multiple domains on a single IP. Let's Encrypt ready.

πŸ“‹

Apache Compatible

Reads existing Apache vhost configurations directly. No config rewrite needed.

πŸ“

Static Files

Serves static assets efficiently with proper MIME types and caching headers.

πŸ”§

PHP FFI Bridge

Call Rust functions directly from PHP via libwolflib.so using FFI.

πŸ“Š

Admin Dashboard

Built-in web dashboard on port 5000 for real-time monitoring, stats, and request logging.

πŸ–₯️

Cross-Platform

Debian/Ubuntu, Fedora/RHEL, Arch Linux, openSUSE β€” all supported out of the box.

Requirements

  • Linux with systemd
  • Rust 1.70+ (for building from source)
  • PHP 7.4+ with php-fpm

Quick Start

Option 1: Install from Source

bash
# Clone the repository
git clone https://github.com/wolfsoftwaresystemsltd/wolfserve.git
cd wolfserve

# Run the installer (requires root)
sudo ./install.sh

# Start the server
./run.sh

Option 2: Install Precompiled Binaries

bash
# Download the release package
tar -xzf wolfserve-x86_64-YYYYMMDD.tar.gz
cd wolfserve-x86_64-YYYYMMDD

# Run the installer (requires root)
sudo ./install_precompiled.sh

Option 3: Install as a Service

bash
# Build and install as systemd service
sudo ./install_service.sh

# The server will start automatically
systemctl status wolfserve

Configuration

Edit wolfserve.toml:

toml
[server]
host = "0.0.0.0"
port = 3000

[php]
fpm_address = "127.0.0.1:9993"
session_save_path = "/var/lib/php/sessions"

[apache]
# Load existing Apache vhost configs
# Debian/Ubuntu: "/etc/apache2"
# Fedora/RHEL:   "/etc/httpd"
config_dir = "/etc/apache2"

Admin Dashboard

WolfServe includes a built-in admin dashboard at http://your-server:5000/ for monitoring and statistics.

Features

  • Real-time statistics: Total requests, response codes (2xx/3xx/4xx/5xx), avg response time, requests/sec
  • Request logging: Last 50 requests with method, path, status, duration, client IP, and host
  • Uptime tracking: Server uptime displayed in days, hours, minutes, seconds
  • Auto-refresh: Dashboard updates every 5 seconds
  • Secure authentication: Session-based login with bcrypt password hashing

Default Credentials

Field Value
Username admin
Password admin
⚠️ Important: Change the default password immediately after first login! Credentials are stored in wolfserve_admin.dat using bcrypt hashing.

Multi-Server PHP Sessions

WolfServe supports shared PHP sessions across multiple servers, enabling seamless load balancing without sticky sessions.

Configuration

Set session_save_path in wolfserve.toml to a shared network location:

toml
[php]
fpm_address = "127.0.0.1:9993"
session_save_path = "/mnt/shared/wolfserve/sessions"

How It Works

  1. User logs in on Server A β†’ session file created at /mnt/shared/wolfserve/sessions/sess_abc123
  2. Next request routed to Server B β†’ reads the same session file from shared storage
  3. User stays logged in seamlessly across all servers

Requirements

  • All servers must mount the same shared storage (NFS, GlusterFS, Ceph, etc.)
  • Clocks should be synchronized (NTP) for consistent session expiry
  • The installer automatically sets correct permissions (chmod 1733 with sticky bit)

Interactive Installation

bash
sudo ./install_service.sh

πŸ“ Configuration Options (press Enter to accept defaults)
Server bind address [0.0.0.0]:
Server port [3000]:
PHP-FPM port [9993]:
PHP session save path [/var/lib/php/sessions]: /mnt/shared/wolfserve/sessions
Apache config directory [/etc/apache2]:

Non-Interactive Installation

Use environment variables for automated deployments:

bash
sudo WOLFSERVE_SESSION_PATH="/mnt/shared/wolfserve/sessions" \
     WOLFSERVE_PORT="3000" \
     ./install_service.sh -y
Environment Variable Default Description
WOLFSERVE_HOST 0.0.0.0 Bind address
WOLFSERVE_PORT 3000 HTTP port
WOLFSERVE_FPM_PORT 9993 PHP-FPM port
WOLFSERVE_SESSION_PATH /var/lib/php/sessions Session storage path
WOLFSERVE_APACHE_DIR /etc/apache2 Apache config directory

PHP FFI Integration

WolfServe includes libwolflib.so, a Rust library that can be called directly from PHP using FFI:

php
<?php
$ffi = FFI::cdef("
    int wolf_add(int a, int b);
    char* wolf_greet(const char* name);
    void wolf_free_string(char* s);
", "/opt/wolfserve/libwolflib.so");

// Call Rust from PHP!
$result = $ffi->wolf_add(10, 32);     // Returns 42
$greeting = $ffi->wolf_greet("World");
echo FFI::string($greeting);          // "Hello, World from Rust!"
$ffi->wolf_free_string($greeting);

Migration from Apache

Switching from Apache to WolfServe:

bash
# Debian/Ubuntu
sudo systemctl stop apache2 && sudo systemctl disable apache2

# Fedora/RHEL
sudo systemctl stop httpd && sudo systemctl disable httpd

# Install & start WolfServe
sudo ./install_service.sh
sudo systemctl enable wolfserve

WolfServe reads your existing Apache vhost configurations from /etc/apache2/ (or /etc/httpd/ on RHEL) β€” no config changes needed.

Service Management

bash
# Start / stop / restart
sudo systemctl start wolfserve
sudo systemctl stop wolfserve
sudo systemctl restart wolfserve

# Enable on boot
sudo systemctl enable wolfserve

# Check status
sudo systemctl status wolfserve

# View logs
sudo journalctl -u wolfserve -f

Project Structure

text
wolfserve/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs              # Main server code
β”‚   β”œβ”€β”€ apache.rs            # Apache config parser
β”‚   └── admin.rs             # Admin dashboard & authentication
β”œβ”€β”€ wolflib/                 # Rust library for PHP FFI
β”‚   └── src/lib.rs
β”œβ”€β”€ public/                  # Web root directory
β”‚   β”œβ”€β”€ index.php
β”‚   └── rust.php             # PHP FFI example
β”œβ”€β”€ install.sh               # Source installation script
β”œβ”€β”€ install_service.sh       # Systemd service installer
β”œβ”€β”€ install_precompiled.sh   # Precompiled binary installer
└── wolfserve.toml           # Server configuration