Skip to content

Web hosting

Architecture

Docker-based shared hosting:

Traefik (SSL) → hosting-webserver (nginx) → hosting-php84 (FPM via TCP:9000)
                                           → hosting-sftp (Port 2222)
  • SSLterminated on Traefik (nginx only internal port 80)
  • PHP-FPMvia TCPhosting-php84:9000(not Unix Socket)
  • Traefik-Routenare generated by the Platform API (/etc/xynap/traefik/conf.d/hosting-routes.yml)

Sites

Create a Site

POST /api/v1/hosting/sites
{
  "customer_id": 1,
  "domain": "example.com",
  "php_version": "8.4"
}

List Site

GET /api/v1/hosting/sites?customer_id=1

Site suspend / activate

POST /api/v1/hosting/sites/{id}/suspend
POST /api/v1/hosting/sites/{id}/unsuspend

Databases

# Datenbanken einer Site
GET /api/v1/hosting/sites/{id}/databases

# Datenbank erstellen
POST /api/v1/hosting/sites/{id}/databases
{"name": "wp_main", "password": "auto-generated"}

# Datenbank loeschen
DELETE /api/v1/hosting/databases/{id}

File system

Customer data are below:

/var/lib/xynap/customers/{customer_id}/{domain}/
  ├── htdocs/          # DocumentRoot
  ├── logs/            # Access + Error Logs
  └── tmp/             # PHP Temp

vHost generation

The Platform API generates nginx-vHosts via Jinja2-Templates:

  • Template:app/modules/hosting/templates/vhost.conf.j2
  • Output:/etc/xynap/hosting/vhosts/{domain}.conf

FPM pool content:

  • Template:app/modules/hosting/templates/fpm-pool.conf.j2
  • Output:/etc/xynap/hosting/php-fpm/{domain}.conf