= neuen V-Host erstellen 1. DNS einrichten: den DNS-Namen für den neuen Host auf die IP-Adresse (oder als CNAME auf den Hostnamen) des Apache-Servers (`laubfrosch.p21.net`, `172.16.0.2`) zeigen lassen 1. auf Laubfrosch anmelden, `root` werden 1. im Verzeichnis `/var/www` a. für eine Web-Service: \\ ein neues Verzeichnis mit dem Hostnamen anlegen: `mkdir twiki.mtronig.de` a. für einen Nicht-Web-Server (z.B. IMAP, murmur, ...): \\ einen Sym-Link auf `localhost` anlegen: `mkdir ln -s localhost murmur.vpn21.net` 1. SSL Verzeichnis erstellen a. mit eigenem SSL-Cert oder als zentrale Stelle für ein Sammel-Cert: \\ ein Unterverzeichnis `ssl` anlegen: `mkdir -p twiki.mtronig.de/ssl` a. zu einem Sammel-Cert hinzufügen: \\ einen Symlink auf das `ssl` Verzeichnis des Sammel-Cert-Halters legen: `ln -s ../usvn/ssl twiki.mtronig.de/ssl` a. für einen Nicht-Web-Server (z.B. IMAP, murmur, ...) ist das im `localhost` geregelt. Im `ssl` Verzeichnis (Link oder physisch) werden folgende Dateien für die nachfolgende Konfigruation benötigt und müssen durch getssl.sh erstellt werden: * `ca-bundle.pem` * `server.crt` * `server.key_decrypted` 1. im Host-Verzeichnis die Web-Daten unterbringen, für einen Forwarder auf einen anderen Web-Service via `http` oder `https` kommen keine Daten hier hinein. \\ Die Web-Daten hier sollten dem `apache` User gehören: `chown -R apache:apache twiki.mtronig.de`. \\ Eine einfache Datei für den Start oder für Wartungsarbeiten liegt als Anhang dieser Wiki-Seite bei. 1. im Konfigurations-Verzeichnis `/etc/apache2/vhosts.d` eine neue Host-Konfiguration erstellen nach dem Namensmuster `nn-hostname.mit.domaine.tld.conf`. Jeder V-Host bekommt eine eigene Nummer, die vor `99` und auch vor `78` einsortiert wird, normalerweise aufsteigend ab `21` die nächste freie Nummer. Die Konfigurationsdatei richtet sich nach den Eigenschaften des Web-Service, soll aber auf jeden Fall die Teile der SSL-Konfiguration enthalten: {{{ ### Section 3: Virtual Hosts # # VirtualHost: If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # Use name-based virtual hosting. # #NameVirtualHost *:80 # # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for requests without a known # server name. # ServerName wrp.vpn21.net RedirectMatch permanent "^(/(?!.well-known/acme-challenge?).*)" https://wrp.vpn21.net$1 ServerName wrp.vpn21.net # SSLProxyEngine On # RequestHeader set Front-End-Https "On" RequestHeader edit Destination https://wrp.vpn21.net/ http://172.18.2.3:8080/ ProxyRequests Off ProxyPass /.well-known ! ProxyPass / http://172.18.2.3:8080/ ProxyPassReverse / http://172.18.2.3:8080/ SSLEngine on ## Server Certificate: # Point SSLCertificateFile at a PEM encoded certificate. If the certificate # is encrypted, then you will be prompted for a pass phrase. Note that a # kill -HUP will prompt again. Keep in mind that if you have both an RSA # and a DSA certificate you can configure both in parallel (to also allow # the use of DSA ciphers, etc.) SSLCertificateFile /var/www/wrp.vpn21.net/ssl/server.crt ## Server Private Key: # If the key is not combined with the certificate, use this directive to # point at the key file. Keep in mind that if you've both a RSA and a DSA # private key you can configure both in parallel (to also allow the use of # DSA ciphers, etc.) SSLCertificateKeyFile /var/www/wrp.vpn21.net/ssl/server.key_decrypted ## Server Certificate Chain: # Point SSLCertificateChainFile at a file containing the concatenation of # PEM encoded CA certificates which form the certificate chain for the # server certificate. Alternatively the referenced file can be the same as # SSLCertificateFile when the CA certificates are directly appended to the # server certificate for convinience. SSLCertificateChainFile /var/www/wrp.vpn21.net/ssl/ca-bundle.pem Header always add Strict-Transport-Security "max-age=15768000" }}} 1. weiter mit der [[ApacheGetsslNeuesCert|Einrichtung]] von `getssl`