LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-24-2017, 06:01 AM   #1
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 170

Rep: Reputation: Disabled
Multiple ssl vhost in Apache on Slackware, how?


Hi,
I am trying to configure multiple (3) ssl vhosts in Apache on Slackware unfortunately all vhosts are trying to use certs from the first vhost which cause "Your connection is not secure" error. I don't really understand why, here is my config:

Code:
Listen [::]:443
Listen 0.0.0.0:443

SSLProtocol             all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite		ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
SSLHonorCipherOrder     on
SSLCompression          off
SSLSessionTickets	off

SSLUseStapling          on
SSLStaplingResponderTimeout 5
SSLStaplingReturnResponderErrors off

SSLPassPhraseDialog  builtin

SSLSessionCache        "shmcb:/var/run/ssl_scache(512000)"
SSLSessionCacheTimeout  300
SSLStaplingCache        shmcb:/var/run/ocsp(128000)

##
## SSL Virtual Host Context
##

<VirtualHost domain1.com:443>
        DocumentRoot "/var/www/htdocs/www.domain1.com"
        ServerName domain1.com:443
        ServerAlias www.domain1.com:443
        ServerAdmin @
        ErrorLog "/var/log/httpd/domain1.com-ssl_error.log"
        TransferLog "/var/log/httpd/domain1.com-ssl_access.log"
        CustomLog "/var/log/httpd/domain1.com-ssl_custom.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
        LogLevel warn

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

        SSLEngine on

        SSLCertificateFile      /etc/ssl/domain1/4f0facdd84c0c5.crt
        SSLCertificateKeyFile   /etc/ssl/domain1/domain1-decrypted.key
        SSLCertificateChainFile /etc/ssl/domain1/gd_bundle-g2-g1.crt

        Header always add Strict-Transport-Security "max-age=15768000"
    
        BrowserMatch "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>                                  

<VirtualHost domain2.com:443>
        DocumentRoot "/var/www/htdocs/www.domain2.com"
        ServerName domain2.com:443
        ServerAlias www.domain2.com:443
        ServerAdmin @
        ErrorLog "/var/log/httpd/domain2.com-ssl_error.log"
        TransferLog "/var/log/httpd/domain2.com-ssl_access.log"
        CustomLog "/var/log/httpd/domain2.com-ssl_custom.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
        LogLevel warn

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

        SSLEngine on

        SSLCertificateFile      /etc/ssl/domain2/5ceab673c3bfddf1.crt
        SSLCertificateKeyFile   /etc/ssl/domain2/domain2.com.key
        SSLCertificateChainFile /etc/ssl/domain2/gd_bundle-g2-g1.crt

        Header always add Strict-Transport-Security "max-age=15768000"
    
        BrowserMatch "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>                                  

<VirtualHost rma.domain2.com:443>
        DocumentRoot "/home/domain2/public_html"
        ServerName rma.domain2.com:443
        ServerAlias www.rma.domain2.com:443
        ServerAdmin @
        ErrorLog "/var/log/httpd/rma.domain2.com-ssl_error.log"
        TransferLog "/var/log/httpd/rma.domain2.com-ssl_access.log"
        CustomLog "/var/log/httpd/rma.domain2.com-ssl_custom.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
        LogLevel warn

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

        SSLEngine on

        SSLCertificateFile      /etc/ssl/domain2/5ceab673c3bfddf1.crt
        SSLCertificateKeyFile   /etc/ssl/domain2/domain2.com.key
        SSLCertificateChainFile /etc/ssl/domain2/gd_bundle-g2-g1.crt

        Header always add Strict-Transport-Security "max-age=15768000"
    
        BrowserMatch "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
 
Old 01-24-2017, 06:12 AM   #2
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
Why have you put ":443" on the end of all your ServerName and ServerAlias lines?
 
Old 01-24-2017, 04:31 PM   #3
davleema
Member
 
Registered: Jun 2015
Location: Belgium
Distribution: Slackware x64
Posts: 43

Rep: Reputation: Disabled
Quote:
Originally Posted by 55020 View Post
Why have you put ":443" on the end of all your ServerName and ServerAlias lines?
Indeed, you should not add :443 at the end of the ServerName or ServerAlias.

Afaik, it's also not needed to repeat the domain name in the <VirtualHost ...> lines: just use <VirtualHost *:443>.

Create <VirtualHost *:443> ... </VirtualHost> blocks for each domainname.

Reference: https://httpd.apache.org/docs/2.4/vh...ame-based.html


David
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rewrite rule with multiple recondition in apache vhost vignesh4sh Linux - Server 1 11-05-2013 05:36 AM
Apache Internal Server Redirection vhost => vhost not working [Debian & Apache 2] Smokin... Linux - Server 1 05-26-2013 12:06 PM
[SOLVED] Apache2 Multiple SSL vhost in different vhost files, does not work LBM Linux - Software 2 09-24-2010 06:06 AM
Apache ssl on only *one* vhost belorion Linux - Networking 1 12-01-2005 03:59 PM
Apache: Alias is working on ssl vhost but not on mass vhost jonavogt Linux - Software 0 06-07-2005 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration