Gernot Walzl

Apache

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

Installation

The official Debian repository contains Apache and PHP:
apt-get install apache2 php libapache2-mod-php

Domain

When you own a domain (e.g. example.net), you can specify the zone of that domain.
For a web server, the following entries are relevant:

@    IN  A      192.0.2.1       ; 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"

CAA

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

Web Site

A web server can serve many web sites.
Each web site is configured as virtual host on the server:
/etc/apache2/sites-available/example.net.conf

<VirtualHost *:80>
    ServerName example.net
    ServerAlias www.example.net
    ServerAdmin webmaster@example.net
    DocumentRoot /var/www/example.net
    <Directory /var/www/example.net/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

When the configuration file of the site is available, the site needs to be enabled:
a2ensite example.net

SSL/TLS Certificate

Install certbot to get a SSL/TLS certificate from Let's Encrypt:
apt-get install certbot python-certbot-apache

Create and install the certificate:
certbot --apache -d example.net -d www.example.net

PHP

Install additional modules:
apt-get install php-gd php-mbstring

External Links

CONTENT.html 2020-05-08 2.5 KB