{% extends "base.html" %} {% import "_macros.html" as m with context %} {% block title %}Web server{% endblock %} {% block content %}

Web server

The front server answers on ports 80 and 443 and serves this panel. Switching rewrites every site config, tests it and rolls back if the new server does not start.

{% for s in w.servers %}

{{ s.label }}

{{ s.description }}

{% if s.installed %}Version {{ s.version or "unknown" }}{% else %}Installed on switch{% endif %} {% if s.active %} In use {% else %}
{{ m.csrf_field() }}
{% endif %}
{% endfor %}

Apache backend

Lets sites use .htaccess while the front server stays fast. Pick "PHP via Apache" on a site to use it.

{% if w.apache_backend %}On{% else %}Off{% endif %}
{% if w.servers|selectattr("active")|map(attribute="key")|first == "apache" %}

Apache is the front server, so every PHP site already reads .htaccess.

{% else %}
{{ m.csrf_field() }} {% if w.apache_backend %}

{{ w.php_apache_sites }} site{{ "" if w.php_apache_sites == 1 else "s" }} use{{ "s" if w.php_apache_sites == 1 else "" }} it.

{% else %} {% endif %}
{% endif %}

PHP versions

Sites choose their version. Extra versions come from the Sury (Debian) or Ondřej (Ubuntu) repository.

{% for v in me.php_versions %}PHP {{ v }} {% else %}No PHP installed.{% endfor %}

{{ m.csrf_field() }}
{% if jobs %}

Recent changes

{% for j in jobs %} {% endfor %}
TaskStartedResult
{{ {'webserver': 'Switch web server', 'apache-backend': 'Apache backend', 'php': 'Install ' ~ j.target|replace('php', 'PHP ')}[j.kind] }} {{ j.created|ago }} {% if j.status == "running" %}Running{% elif j.status == "done" %}Done {% if j.result.to %} {{ j.result.from }} to {{ j.result.to }}{% endif %} {% else %}Failed{{ j.result.error }}{% endif %}
{% endif %} {% endblock %}