Webseite spiegeln mit Zertifikat: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 8: | Zeile 8: | ||
;Signiert | ;Signiert | ||
*openssl x509 -req -days 1460 -in $FQDN.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out $FQDN.crt -extfile <(echo "subjectAltName=DNS:$FQDN") | *openssl x509 -req -days 1460 -in $FQDN.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out $FQDN.crt -extfile <(echo "subjectAltName=DNS:$FQDN") | ||
| + | =Zertifikate an die richtige Stelle bringen= | ||
| + | ;Zertifikat der Zertifizierungsstelle zu den Stammzertifikaten der OS hinzufügen. | ||
| + | *sudo cp ca.crt /usr/local/share/ca-certificates | ||
| + | *sudo update-ca-certificates | ||
| + | *Zertifikat und Key des Webservers an die richtige Stelle bringen. | ||
| + | *sudo cp xinux.de.crt xinux.de.key /etc/apache2 | ||
| + | =Apache einrichten= | ||
| + | ;SSL aktivieren | ||
| + | *a2enmod ssl | ||
| + | ;Konfiguration | ||
| + | *cat /etc/apache2/sites-enabled/000-default.conf | ||
| + | <pre> | ||
| + | <IfModule mod_ssl.c> | ||
| + | <VirtualHost *:443> | ||
| + | ServerAdmin webmaster@localhost | ||
| + | DocumentRoot /var/www/html | ||
| + | SSLEngine on | ||
| + | SSLCertificateFile /etc/apache2/xinux.de.crt | ||
| + | SSLCertificateKeyFile /etc/apache2/xinux.de.key | ||
| + | ErrorLog ${APACHE_LOG_DIR}/error.log | ||
| + | CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
| + | </VirtualHost> | ||
| + | </IfModule> | ||
| + | </pre> | ||
Version vom 10. Februar 2026, 07:18 Uhr
Wie wollen Letsencrypt nachbauen
- openssl req -new -x509 -newkey rsa:4096 -nodes -keyout ca.key -out ca.crt -days 3650 -subj "/CN=R12 /O=Let's Encrypt /C=US"
Wir wollen ein Xinux Zertifikat erstellen
- Variable gesetzt
- FQDN=xinux.de
- Request erstellt
- openssl req -new -newkey rsa:4096 -nodes -keyout $FQDN.key -out $FQDN.csr -subj "/CN=$FQDN"
- Signiert
- openssl x509 -req -days 1460 -in $FQDN.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out $FQDN.crt -extfile <(echo "subjectAltName=DNS:$FQDN")
Zertifikate an die richtige Stelle bringen
- Zertifikat der Zertifizierungsstelle zu den Stammzertifikaten der OS hinzufügen.
- sudo cp ca.crt /usr/local/share/ca-certificates
- sudo update-ca-certificates
- Zertifikat und Key des Webservers an die richtige Stelle bringen.
- sudo cp xinux.de.crt xinux.de.key /etc/apache2
Apache einrichten
- SSL aktivieren
- a2enmod ssl
- Konfiguration
- cat /etc/apache2/sites-enabled/000-default.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/apache2/xinux.de.crt
SSLCertificateKeyFile /etc/apache2/xinux.de.key
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
</IfModule>