Table of Contents
Apache
This page describes how the Apache daemon on antiguru.de was configured. The web server has to serve several virtual hosts on different domains on http and https. Administration should be as simple as possible while it should provide a restricted environment.
Modules
- PHP: PHP support is required for this Wiki.
- mod_macro: Macros for virtual hosts (http/https) and other useful elements.
- mod_rewrite: Redirect URLs.
Directory Layout
Macros/Virtual Hosts
Do not edit these directly. Use the config maintenance via bitbucket/git. See Configuration Management
Pull the files to your local machine and there, make changes, test, then commit them, push them to bitbucket and pull them to the vhost.
Virtual hosts are listed in /etc/apache2/sites-available/hosts.it (Change to this directory before executing the commands mentioned below!) This is a list of virtual hosts.
Enable the site using a2ensite, or create the symlink manually.
The heavier lifting is in vhosts.ih, where the conf files for the vhosts are built. To build, use the supplied hosts.cmd, which takes care of spurious output. You need REXX to do this. vhosts.ih contains common rules for all the virtual hosts, review this file to change them.
When you add virtual hosts, you also have to update the DNS with entries for them.
After that, wait some time, then, request TLS certificates:
certbot certonly -c letsencrypt.ini --apache
Test certbot:
certbot certonly -c letsencrypt.ini --apache --test-cert --dry-run
If apache cannot serve the letsencrypt challenge, use
--standalone
and stop/start apache manually.