HTTP2 Apache2 Webseite: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(→Reload) |
|||
(18 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 2: | Zeile 2: | ||
*a2enmod ssl | *a2enmod ssl | ||
=Cert und Key Dateien plazieren= | =Cert und Key Dateien plazieren= | ||
− | * | + | *COMMONNAME="xinux.de" |
+ | *cp /home/xinux/cert/*.{key,crt} /etc/apache2 | ||
*ls /etc/apache2/*.{key,crt} | *ls /etc/apache2/*.{key,crt} | ||
/etc/apache2/ca.crt | /etc/apache2/ca.crt | ||
Zeile 9: | Zeile 10: | ||
=Conf erstellen= | =Conf erstellen= | ||
− | |||
− | |||
*cd /etc/apache2/sites-available | *cd /etc/apache2/sites-available | ||
− | *cat<<HERE>$ | + | *cat<<HERE>$COMMONNAME.conf |
<pre> | <pre> | ||
− | <VirtualHost | + | <IfModule mod_ssl.c> |
− | + | <VirtualHost _default_:443> | |
− | + | ServerName $COMMONNAME | |
− | + | ServerAdmin webmaster@localhost | |
− | + | DocumentRoot /var/www/html/$COMMONNAME | |
− | + | ErrorLog \${APACHE_LOG_DIR}/$COMMONNAME-error.log | |
− | </VirtualHost> | + | CustomLog \${APACHE_LOG_DIR}/$COMMONNAME-access.log combined |
+ | SSLEngine on | ||
+ | SSLCertificateFile /etc/apache2/$COMMONNAME.crt | ||
+ | SSLCertificateKeyFile /etc/apache2/$COMMONNAME.key | ||
+ | SSLCACertificateFile /etc/apache2/ca.crt | ||
+ | <FilesMatch "\.(cgi|shtml|phtml|php)$"> | ||
+ | SSLOptions +StdEnvVars | ||
+ | </FilesMatch> | ||
+ | <Directory /usr/lib/cgi-bin> | ||
+ | SSLOptions +StdEnvVars | ||
+ | </Directory> | ||
+ | </VirtualHost> | ||
+ | </IfModule> | ||
HERE | HERE | ||
</pre> | </pre> | ||
+ | |||
+ | =Verzeichnis anlegen= | ||
+ | *mkdir /var/www/html/$COMMONNAME | ||
+ | *cp /var/www/html/index.html /var/www/html/$COMMONNAME | ||
+ | |||
=Aktivieren= | =Aktivieren= | ||
− | *a2ensite $ | + | *a2ensite $COMMONNAME |
+ | |||
=Reload= | =Reload= | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
*systemctl restart apache2 | *systemctl restart apache2 |
Aktuelle Version vom 18. Oktober 2023, 12:07 Uhr
Diverse Module aktivieren
- a2enmod ssl
Cert und Key Dateien plazieren
- COMMONNAME="xinux.de"
- cp /home/xinux/cert/*.{key,crt} /etc/apache2
- ls /etc/apache2/*.{key,crt}
/etc/apache2/ca.crt /etc/apache2/www.xinux.de.crt /etc/apache2/www.xinux.de.key
Conf erstellen
- cd /etc/apache2/sites-available
- cat<<HERE>$COMMONNAME.conf
<IfModule mod_ssl.c> <VirtualHost _default_:443> ServerName $COMMONNAME ServerAdmin webmaster@localhost DocumentRoot /var/www/html/$COMMONNAME ErrorLog \${APACHE_LOG_DIR}/$COMMONNAME-error.log CustomLog \${APACHE_LOG_DIR}/$COMMONNAME-access.log combined SSLEngine on SSLCertificateFile /etc/apache2/$COMMONNAME.crt SSLCertificateKeyFile /etc/apache2/$COMMONNAME.key SSLCACertificateFile /etc/apache2/ca.crt <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> </VirtualHost> </IfModule> HERE
Verzeichnis anlegen
- mkdir /var/www/html/$COMMONNAME
- cp /var/www/html/index.html /var/www/html/$COMMONNAME
Aktivieren
- a2ensite $COMMONNAME
Reload
- systemctl restart apache2