Linux Debian Apache2 SSL ?

OpenMedia

Lieutenant
Registriert
Okt. 2016
Beiträge
706
Hallo zusammen,
ich habe mir ein SSL Zertifikat bei sslforfree.com geholt und nun wollte ich diese importieren meine 000default unter /etc/apache2/sites-enabled sieht folgender maßen aus :

Code:
<VirtualHost *:80>
        ServerAdmin webmaster@domain
        DocumentRoot /var/www/mail

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Nun habe ich unter den Pfad /etc/ssl/Zertifikat die Zertifikate eingefügt meine neue 000default würde dann so aussehen :

Code:
<VirtualHost *:443>
    ServerName mail.domain
    DocumentRoot /var/www/mail

    <IfModule mod_ssl.c>
        SSLEngine on
        SSLCertificateFile /etc/ssl/Zertifikat/certificate.crt
        SSLCertificateKeyFile /etc/ssl/Zertifikat/private.key
        SetEnvIf User-Agent ".*MSIE.*" \
          nokeepalive ssl-unclean-shutdown \
          downgrade-1.0 force-response-1.0
    </IfModule>
</VirtualHost>

Leider funktioniert diese nicht kann mir jemand helfen ?
 
Probier es mal damit:

Code:
<VirtualHost *:443>
        SSLEngine on
        ServerAdmin email@example.com

        ServerName www.example.com
        ServerAlias example.com
        DocumentRoot "/var/www/example.com/htdocs"

        #SSL Forward Security
        SSLProtocol all -SSLv2 -SSLv3
        SSLHonorCipherOrder on

        # Compress HTML, CSS, JavaScript, Text, XML, fonts.....
        <IfModule mod_deflate.c>
                AddOutputFilterByType DEFLATE application/javascript
                AddOutputFilterByType DEFLATE application/rss+xml
                AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
                AddOutputFilterByType DEFLATE application/x-font
                AddOutputFilterByType DEFLATE application/x-font-opentype
                AddOutputFilterByType DEFLATE application/x-font-otf
                AddOutputFilterByType DEFLATE application/x-font-truetype
                AddOutputFilterByType DEFLATE application/x-font-ttf
                AddOutputFilterByType DEFLATE application/x-javascript
                AddOutputFilterByType DEFLATE application/xhtml+xml
                AddOutputFilterByType DEFLATE application/xml
                AddOutputFilterByType DEFLATE font/opentype
                AddOutputFilterByType DEFLATE font/otf
                AddOutputFilterByType DEFLATE font/ttf
                AddOutputFilterByType DEFLATE image/svg+xml
                AddOutputFilterByType DEFLATE image/x-icon
                AddOutputFilterByType DEFLATE text/css
                AddOutputFilterByType DEFLATE text/html
                AddOutputFilterByType DEFLATE text/javascript
                AddOutputFilterByType DEFLATE text/plain
                AddOutputFilterByType DEFLATE text/xml
        </IfModule>

        #Security

        ServerSignature Off

        <IfModule mod_headers.c>
                Header set X-XSS-Protection "1; mode=block"
                Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
                Header set X-Content-Type-Options nosniff
                Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
        </IfModule>

        #Security ende

        LogLevel warn
        ErrorLog /var/www/example.com/logs/ssl_error.log
        CustomLog /var/www/example.com/logs/ssl_access.log combined

        SSLCertificateChainFile /etc/ssl/example.com/certificatechainfile.cert
        SSLCertificateFile      /etc/ssl/example.com/public.key
        SSLCertificateKeyFile   /etc/ssl/example.com/secret.key

        <Directory /var/www/example.com/htdocs/>
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>
 
Hay die Config ist etwas zu überfüllt geht das nicht etwas Smarter ?

Cool Master schrieb:
Probier es mal damit:

Code:
<VirtualHost *:443>
        SSLEngine on
        ServerAdmin email@example.com

        ServerName www.example.com
        ServerAlias example.com
        DocumentRoot "/var/www/example.com/htdocs"

        #SSL Forward Security
        SSLProtocol all -SSLv2 -SSLv3
        SSLHonorCipherOrder on

        # Compress HTML, CSS, JavaScript, Text, XML, fonts.....
        <IfModule mod_deflate.c>
                AddOutputFilterByType DEFLATE application/javascript
                AddOutputFilterByType DEFLATE application/rss+xml
                AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
                AddOutputFilterByType DEFLATE application/x-font
                AddOutputFilterByType DEFLATE application/x-font-opentype
                AddOutputFilterByType DEFLATE application/x-font-otf
                AddOutputFilterByType DEFLATE application/x-font-truetype
                AddOutputFilterByType DEFLATE application/x-font-ttf
                AddOutputFilterByType DEFLATE application/x-javascript
                AddOutputFilterByType DEFLATE application/xhtml+xml
                AddOutputFilterByType DEFLATE application/xml
                AddOutputFilterByType DEFLATE font/opentype
                AddOutputFilterByType DEFLATE font/otf
                AddOutputFilterByType DEFLATE font/ttf
                AddOutputFilterByType DEFLATE image/svg+xml
                AddOutputFilterByType DEFLATE image/x-icon
                AddOutputFilterByType DEFLATE text/css
                AddOutputFilterByType DEFLATE text/html
                AddOutputFilterByType DEFLATE text/javascript
                AddOutputFilterByType DEFLATE text/plain
                AddOutputFilterByType DEFLATE text/xml
        </IfModule>

        #Security

        ServerSignature Off

        <IfModule mod_headers.c>
                Header set X-XSS-Protection "1; mode=block"
                Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
                Header set X-Content-Type-Options nosniff
                Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
        </IfModule>

        #Security ende

        LogLevel warn
        ErrorLog /var/www/example.com/logs/ssl_error.log
        CustomLog /var/www/example.com/logs/ssl_access.log combined

        SSLCertificateChainFile /etc/ssl/example.com/certificatechainfile.cert
        SSLCertificateFile      /etc/ssl/example.com/public.key
        SSLCertificateKeyFile   /etc/ssl/example.com/secret.key

        <Directory /var/www/example.com/htdocs/>
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>
 
Die Config ist nicht überfüllt... Schau dir wenigstens mal an was die Befehle machen und bewirken.

Btw. Regeln beachten bzg. zitieren...
 
meins sieht so aus und geht auch

Code:
<IfModule mod_ssl.c>
   <VirtualHost _default_:443>

	ServerAdmin webmaster@localhost
	ServerName domain.com
	DocumentRoot /var/www/html

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	SSLEngine on
	SSLProxyEngine On

	SSLCertificateFile	/etc/letsencrypt/live/domain.com/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem

	<FilesMatch "\.(cgi|shtml|phtml|php)$">
	   SSLOptions +StdEnvVars
	</FilesMatch>

	<Directory /usr/lib/cgi-bin>
	   SSLOptions +StdEnvVars
	</Directory>

	<Directory /var/www/html>
	   AllowOverride All
	   Options -Indexes
	</Directory>
   </VirtualHost>
</IfModule>

btw: ich nutze das kostenlose letsencrypt SSL Zertifikat :)
 
Ohne eine Info was fuer eine Fehlermeldung Apache logt koennen wir dir unmoeglich fundiert weiterhelfen.
 
Zurück
Oben