HTTP2 Apache2 Webseite: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Die Seite wurde neu angelegt: „=Diverse Module aktivieren= *a2enmod ssl =Cert und Key Dateien plazieren= *FQDN="www.xinux.de" *ls /etc/apache2/*.{key,crt} /etc/apache2/ca.crt /etc/apach…“) |
|||
| Zeile 9: | Zeile 9: | ||
=Conf erstellen= | =Conf erstellen= | ||
| + | =FQDN setzen= | ||
| + | *FQDN=www.xinux.de | ||
| + | *cd /etc/apache2/sites-available | ||
| + | *cat<<HERE>$FQDN.conf | ||
| + | <pre> | ||
| + | <VirtualHost *:80> | ||
| + | ServerName $FQDN | ||
| + | ServerAdmin webmaster@localhost | ||
| + | DocumentRoot /var/www/html/$FQDN | ||
| + | ErrorLog \${APACHE_LOG_DIR}/$FQDN-error.log | ||
| + | CustomLog \${APACHE_LOG_DIR}/$FQDN-access.log combined | ||
| + | </VirtualHost> | ||
| + | HERE | ||
| + | </pre> | ||
| + | =Aktivieren= | ||
| + | *a2ensite $FQDN | ||
| + | =Reload= | ||
| + | *systemctl reload apache2 | ||
| + | |||
*cd /etc/apache2/sites-available | *cd /etc/apache2/sites-available | ||
*cat orville.xinux.org.conf | *cat orville.xinux.org.conf | ||
Version vom 15. August 2021, 17:17 Uhr
Diverse Module aktivieren
- a2enmod ssl
Cert und Key Dateien plazieren
- FQDN="www.xinux.de"
- ls /etc/apache2/*.{key,crt}
/etc/apache2/ca.crt /etc/apache2/www.xinux.de.crt /etc/apache2/www.xinux.de.key
Conf erstellen
FQDN setzen
- FQDN=www.xinux.de
- cd /etc/apache2/sites-available
- cat<<HERE>$FQDN.conf
<VirtualHost *:80>
ServerName $FQDN
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/$FQDN
ErrorLog \${APACHE_LOG_DIR}/$FQDN-error.log
CustomLog \${APACHE_LOG_DIR}/$FQDN-access.log combined
</VirtualHost>
HERE
Aktivieren
- a2ensite $FQDN
Reload
- systemctl reload apache2
- cd /etc/apache2/sites-available
- cat orville.xinux.org.conf
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerName orville.xinux.org
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/orville.xinux.org.crt
SSLCertificateKeyFile /etc/apache2/orville.xinux.org.key
SSLCACertificateFile /etc/apache2/ca.crt
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>
Verlinken und neu starten
- cd /etc/apache2/sites-enabled
- ln -s ../sites-available/orville.xinux.org.conf .
- systemctl restart apache2