Apache is free and open-source web server.<br />
It powers most web sites on the internet.

The official Debian repository contains Apache and PHP:
<pre><code class="language-bash">apt install apache2 php libapache2-mod-php</code></pre>

When you own a domain (e.g. example.net), you can specify the zone of that domain.<br />
For a web server, the following entries are relevant:
<pre class="file"><code class="language-dns">@    IN  A       ; IPv4 address for example.net
@    IN  AAAA   2001:db8:10::1  ; IPv6 address for example.net
www  IN  CNAME  @               ; www.example.net is an alias for example.net
@    IN  CAA    0 issue "letsencrypt.org"

The Certification Authority Authorization (CAA) defines the Certificate Authority (CA)<br />
that is allowed to issue certificates for the domain.

<h3>Web Site</h3>
A web server can serve many web sites.<br />
Each web site is configured as virtual host on the server:

<dl class="file">
<dt><code class="filename">/etc/apache2/sites-available/example.net.conf</code></dt>
<pre class="file"><code class="language-apache">&lt;VirtualHost *:80&gt;
    ServerName example.net
    ServerAlias www.example.net
    ServerAdmin webmaster@example.net
    DocumentRoot /var/www/example.net
    &lt;Directory /var/www/example.net/&gt;
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log vhost_combined

When the configuration file of the site is available, the site needs to be enabled:
<pre><code class="language-bash">a2ensite example.net</code></pre>

<h3>SSL/TLS Certificate</h3>
Install <code>certbot</code> to get a SSL/TLS certificate from Let's Encrypt:
<pre><code class="language-bash">apt install certbot python3-certbot-apache</code></pre>
Create and install the certificate (add all subdomains you might need):
<pre><code class="language-bash">certbot --apache -d example.net -d www.example.net -d mail.example.net</code></pre>

Most sites written in PHP (e.g. WordPress, phpMyAdmin, Matomo, ...)<br />
require the following modules, which are part of php-defaults, to be installed:
<pre><code class="language-bash">apt install php-curl php-gd php-intl php-mbstring php-mysql php-xml php-zip</code></pre>
Additional modules provide better image quality for media uploads:
<pre><code class="language-bash">apt install php-imagick</code></pre>

<h3>External Links</h3>
<li><a href="https://apache.org/" target="_blank">
<li><a href="https://letsencrypt.org/" target="_blank">
<li><a href="https://certbot.eff.org/" target="_blank">
<li><a href="https://packages.debian.org/source/bullseye/php-defaults" target="_blank">
<li><a href="https://en.wikipedia.org/wiki/Zone_file" target="_blank">