{"id":22280,"date":"2025-01-28T13:49:28","date_gmt":"2025-01-28T12:49:28","guid":{"rendered":"https:\/\/contabo.com\/blog\/kb\/103000301786-wie-installiere-ich-ssl-zertifikate-auf-apache\/"},"modified":"2025-01-28T13:49:28","modified_gmt":"2025-01-28T12:49:28","slug":"103000301786-wie-installiere-ich-ssl-zertifikate-auf-apache","status":"publish","type":"kb","link":"https:\/\/contabo.com\/blog\/de\/kb\/103000301786-wie-installiere-ich-ssl-zertifikate-auf-apache\/","title":{"rendered":"Wie installiere ich SSL-Zertifikate auf Apache?"},"content":{"rendered":"<h4><strong>Wie installiere ich SSL auf Apache?<\/strong><\/h4>\n<ol>\n<li dir=\"ltr\">Zun&auml;chst m&uuml;ssen Sie Apache installieren, falls es noch nicht auf Ihrem Server installiert ist. Sie k&ouml;nnen Apache mit den folgenden Befehlen installieren:\n<ol>\n<li dir=\"ltr\">Aktualisieren Sie Ihre Paketliste mit diesem Befehl:\n<pre>sudo apt update<\/pre>\n<\/li>\n<li dir=\"ltr\">Installieren Sie Apache mit diesem Befehl:\n<pre>sudo apt install apache<\/pre>\n<\/li>\n<li dir=\"ltr\">&Uuml;berpr&uuml;fen Sie mit diesen Befehlen, ob Apache ausgef&uuml;hrt wird:\n<pre>sudo systemctl start apache \nsudo systemctl enable apache \nsudo systemctl status apache<\/pre>\n<p>&nbsp;<\/li>\n<\/ol>\n<\/li>\n<li>Installieren Sie anschlie&szlig;end das SSL-Modul f&uuml;r Apache mit diesen Befehlen:\n<pre>sudo a2enmod ssl \nsudo systemctl restart apache2<\/pre>\n<p><\/p>\n<\/li>\n<li>Jetzt m&uuml;ssen Sie die SSL-Zertifikate konfigurieren.\n<ol>\n<li dir=\"ltr\">Erstellen Sie zun&auml;chst ein Verzeichnis zum Speichern Ihrer SSL-Zertifikate:\n<pre>sudo mkdir -p \/etc\/apache2\/ssl<\/pre>\n<p><\/p>\n<\/li>\n<li dir=\"ltr\">Als N&auml;chstes m&uuml;ssen Sie Ihre Zertifikate in das Verzeichnis kopieren, das Sie gerade erstellt haben.\n<p>Angenommen, Ihre Zertifikate befinden sich auf Ihrem lokalen Computer und Sie verwenden auf Ihrem lokalen Computer das Betriebssystem Windows, k&ouml;nnen Sie WinSCP verwenden, um Zertifikatsdateien in das zuvor erstellte Verzeichnis \/etc\/apache2\/ssl hochzuladen.<\/p>\n<p>Falls Sie auf Ihrem lokalen Computer eine Linux Distributaion verwenden, ersetzen Sie &bdquo;your_username&ldquo; und &bdquo;your_server_ip&ldquo; im folgenden Beispiel durch Ihren tats&auml;chlichen Benutzernamen und die IP-Adresse Ihres Servers und f&uuml;hren Sie die drei Befehle separat aus:<\/p>\n<pre>scp \/path\/to\/your\/certificate.crt your_username@your_server_ip:\/etc\/apache2\/ssl\/&nbsp;<\/pre>\n<pre>scp \/path\/to\/your\/certificate.key your_username@your_server_ip:\/etc\/apache2\/ssl\/ <\/pre>\n<pre>scp \/path\/to\/your\/certificate_chain.crt your_username@your_server_ip:\/etc\/apache2\/ssl\/<\/pre>\n<p><\/p>\n<\/li>\n<li dir=\"ltr\">Legen Sie dann die Berechtigungen f&uuml;r diese Zertifikate fest:\n<pre>sudo chmod 600 \/etc\/apache2\/ssl\/certificate.key<\/pre>\n<p><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li dir=\"ltr\">Als n&auml;chstes m&uuml;ssen Sie Apache f&uuml;r die Verwendung von SSL konfigurieren. Sie m&uuml;ssen die VirtualHost Konfiguration f&uuml;r Ihre Website erstellen oder &auml;ndern, um SSL verwenden zu k&ouml;nnen.&nbsp;\n<ol>\n<li dir=\"ltr\">Erstellen Sie eine neue Konfigurationsdatei f&uuml;r Ihre SSL-Website oder bearbeiten Sie die Standard Konfigurationsdatei:\n<pre>sudo nano \/etc\/apache2\/sites-available\/your_domain_ssl.conf<\/pre>\n<p>Bitte beachten Sie, dass Sie vi, nano oder einen anderen Texteditor Ihrer Wahl verwenden k&ouml;nnen.<\/p>\n<p>Ersetzen Sie &bdquo;your_domain_ssl.conf&ldquo; durch den gew&uuml;nschten Konfigurationsdateinamen, z. B. &bdquo;default-ssl.conf&ldquo;, wenn Sie die Standarddatei bearbeiten.<\/p>\n<\/li>\n<li dir=\"ltr\">F&uuml;gen Sie die folgende Konfiguration zur ge&ouml;ffneten Textdatei hinzu oder &auml;ndern Sie sie:\n<pre>&lt;VirtualHost *:443&gt; &nbsp; &nbsp; &nbsp; &nbsp;\n&nbsp; &nbsp; ServerAdmin <a href=\"\/cdn-cgi\/l\/email-protection\" rel=\"nofollow\" class=\"__cf_email__\" data-cfemail=\"e0998f9592bf858d81898ca08598818d908c85ce838f8d\">[email&nbsp;protected]<\/a> &nbsp; &nbsp; &nbsp; &nbsp; \n&nbsp; &nbsp; ServerName your_domain.com &nbsp; &nbsp; &nbsp; &nbsp; \n&nbsp; &nbsp; ServerAlias www.your_domain.com &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n\n&nbsp; &nbsp; DocumentRoot \/var\/www\/html &nbsp; &nbsp; &nbsp; &nbsp; \n&nbsp; &nbsp; SSLEngine on &nbsp; &nbsp; &nbsp; &nbsp; \n&nbsp; &nbsp; SSLCertificateFile \/etc\/apache2\/ssl\/certificate.crt &nbsp; &nbsp; &nbsp; &nbsp; \n&nbsp; &nbsp; SSLCertificateKeyFile \/etc\/apache2\/ssl\/certificate.key &nbsp; &nbsp; &nbsp; &nbsp; \n&nbsp; &nbsp; SSLCertificateChainFile \/etc\/apache2\/ssl\/certificate_chain.crt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n\n&nbsp; &nbsp; &lt;Directory \/var\/www\/html&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \n&nbsp; &nbsp; &nbsp; &nbsp; Options Indexes FollowSymLinks &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \n&nbsp; &nbsp; &nbsp; &nbsp; AllowOverride All &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \n&nbsp; &nbsp; &nbsp; &nbsp; Require all granted &nbsp; &nbsp; &nbsp; &nbsp; \n&nbsp; &nbsp; &lt;\/Directory&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n\n&nbsp; &nbsp; ErrorLog ${APACHE_LOG_DIR}\/error.log &nbsp; &nbsp; &nbsp; &nbsp; \n&nbsp; &nbsp; CustomLog ${APACHE_LOG_DIR}\/access.log combined &nbsp; &nbsp; \n&nbsp; &nbsp; &lt;\/VirtualHost&gt; \nEnsure that \"SSLCertificateFile\", \"SSLCertificateKeyFile\", and \"SSLCertificateChainFile\" point to the correct paths of your certificate files<\/pre>\n<p><\/p>\n<\/li>\n<li dir=\"ltr\">\n<p dir=\"ltr\">Aktivieren Sie die SSL-Site mit dem folgenden Befehl:<\/p>\n<pre>sudo a2ensite your_domain_ssl.conf&nbsp;<\/pre>\n<p>&nbsp;<\/li>\n<li dir=\"ltr\">\n<p dir=\"ltr\">(optional) Deaktivieren Sie die Standard-HTTP-Site, wenn Sie m&ouml;chten:<\/p>\n<pre dir=\"ltr\">sudo a2dissite 000-default.conf<\/pre>\n<p><\/p>\n<\/li>\n<li dir=\"ltr\">Apache starten, um &Auml;nderungen zu &uuml;bernehmen:\n<pre>sudo systemctl reload apache2 <\/pre>\n<p>&nbsp;<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><em><strong dir=\"ltr\">Optional k&ouml;nnen Sie auch HTTP auf HTTPS umleiten, indem Sie die folgenden Schritte ausf&uuml;hren:<\/strong><\/em><\/p>\n<p><\/p>\n<p dir=\"ltr\">Um den gesamten HTTP-Datenverkehr auf HTTPS umzuleiten, k&ouml;nnen Sie Folgendes zu Ihrer Konfiguration des virtuellen Hosts ohne SSL hinzuf&uuml;gen (normalerweise in &bdquo;000-default.conf&ldquo;):<\/p>\n<p><\/p>\n<pre>&lt;VirtualHost *:80&gt; &nbsp; &nbsp; \n&nbsp; &nbsp; ServerAdmin <a href=\"\/cdn-cgi\/l\/email-protection\" rel=\"nofollow\" class=\"__cf_email__\" data-cfemail=\"ea93859f98b58f878b8386aa8f928b879a868fc4898587\">[email&nbsp;protected]<\/a> &nbsp; &nbsp; &nbsp;\n&nbsp; &nbsp; ServerName your_domain.com &nbsp; &nbsp; &nbsp;\n&nbsp; &nbsp; ServerAlias www.your_domain.com &nbsp; &nbsp; &nbsp; &nbsp; \n\n&nbsp; &nbsp; DocumentRoot \/var\/www\/html &nbsp; &nbsp; &nbsp; &nbsp; \n\n&nbsp; &nbsp; RewriteEngine On &nbsp; &nbsp; &nbsp;\n&nbsp; &nbsp; RewriteCond %{HTTPS} off &nbsp; &nbsp; &nbsp;\n&nbsp; &nbsp; RewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301] &nbsp; &nbsp; &nbsp; &nbsp; \n\n&nbsp; &nbsp; ErrorLog ${APACHE_LOG_DIR}\/error.log &nbsp; &nbsp; &nbsp;\n&nbsp; &nbsp; CustomLog ${APACHE_LOG_DIR}\/access.log combined &nbsp;\n&lt;\/VirtualHost&gt;&nbsp;<\/pre>\n<p dir=\"ltr\"><\/p>\n<p dir=\"ltr\">Aktivieren Sie dann das &bdquo;Rewrite&ldquo;-Modul und starten Sie Apache neu:<\/p>\n<pre>sudo a2enmod rewrite sudo systemctl restart apache2 <\/pre>\n<p dir=\"ltr\"><\/p>\n<p dir=\"ltr\">Jetzt sollte Ihre Website &uuml;ber HTTPS mit Ihren SSL-Zertifikaten zug&auml;nglich sein.<\/p>\n<p><\/p>\n<p>Weitere Informationen zu SSL finden Sie in unserem <a href=\"https:\/\/contabo.com\/blog\/de\/der-ultimative-ssl-guide\/\" target=\"_blank\" rel=\"noopener\"><u>Blog hier<\/u><\/a>.<\/p>\n<p dir=\"ltr\">&nbsp;<\/p>\n<\/p>\n<p><span class=\"ast-load-more active\"><a href=\"https:\/\/help.contabo.com\/de\/support\/solutions\/articles\/103000301786-wie-installiere-ich-ssl-zertifikate-auf-apache-\" rel=\"nofollow\">Details&#8230;<\/a> <\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wie installiere ich SSL auf Apache? Zun&auml;chst m&uuml;ssen Sie Apache installieren, falls es noch nicht auf Ihrem Server installiert ist. Sie k&ouml;nnen Apache mit den folgenden Befehlen installieren: Aktualisieren Sie Ihre Paketliste mit diesem Befehl: sudo apt update Installieren Sie Apache mit diesem Befehl: sudo apt install apache &Uuml;berpr&uuml;fen Sie mit diesen Befehlen, ob Apache [&hellip;]<\/p>\n","protected":false},"author":72,"featured_media":0,"template":"","meta":{"inline_featured_image":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2068],"tags":[],"class_list":["post-22280","kb","type-kb","status-publish","hentry","category-kb-de"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Contabo Web","author_link":"https:\/\/contabo.com\/blog\/de\/author\/julius-nalivaiko\/"},"uagb_comment_info":0,"uagb_excerpt":"Wie installiere ich SSL auf Apache? Zun&auml;chst m&uuml;ssen Sie Apache installieren, falls es noch nicht auf Ihrem Server installiert ist. Sie k&ouml;nnen Apache mit den folgenden Befehlen installieren: Aktualisieren Sie Ihre Paketliste mit diesem Befehl: sudo apt update Installieren Sie Apache mit diesem Befehl: sudo apt install apache &Uuml;berpr&uuml;fen Sie mit diesen Befehlen, ob Apache&hellip;","_links":{"self":[{"href":"https:\/\/contabo.com\/blog\/de\/wp-json\/wp\/v2\/kb\/22280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contabo.com\/blog\/de\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/contabo.com\/blog\/de\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/de\/wp-json\/wp\/v2\/users\/72"}],"version-history":[{"count":0,"href":"https:\/\/contabo.com\/blog\/de\/wp-json\/wp\/v2\/kb\/22280\/revisions"}],"wp:attachment":[{"href":"https:\/\/contabo.com\/blog\/de\/wp-json\/wp\/v2\/media?parent=22280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/contabo.com\/blog\/de\/wp-json\/wp\/v2\/categories?post=22280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/contabo.com\/blog\/de\/wp-json\/wp\/v2\/tags?post=22280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}