You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Steve Swift <st...@gmail.com> on 2006/11/28 10:09:20 UTC
[users@httpd] Virtual Hosts and SSL
Where should I go to learn about configuring Virtual Hosts and SSL in the
same apache?
I have virtual hosts woking using "NameVirtualHost *:80"
SSL works for the Virtual Hosts *I* have defined
But in the (default) ssl.conf file installed with apache I find:
<VirtualHost _default_:443>
SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
... (other, less interesting lines)
</VirtualHost>
What puzzles me is this:
The VirtualHost definition above seems to be working as SSL is finding the
Certificate File (otherwise how would SSL work at all?)
How is this VirtualHost definition working in conjunction with
"NameVirtualHost *:80" ?
--
Steve Swift
http://www.swiftys.org.uk
Re: [users@httpd] Virtual Hosts and SSL
Posted by Joshua Slive <jo...@slive.ca>.
On 11/28/06, Steve Swift <st...@gmail.com> wrote:
> What puzzles me is this:
> The VirtualHost definition above seems to be working as SSL is finding the
> Certificate File (otherwise how would SSL work at all?)
> How is this VirtualHost definition working in conjunction with
> "NameVirtualHost *:80" ?
It has no relation with the NameVirtualHost directive. Notice that
NameVirtualHost applies to only the IP-Address:ports matching *:80 --
so it only affects port-80 hosts. The SSL vhost is on port
_default_:443, meaning that it catches all IP addresses (not otherwise
mapped) on port 443.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Virtual Hosts and SSL
Posted by Steve Swift <st...@gmail.com>.
Thanks for that, perhaps I'll get a change to use it some time. However,
the server in question in this case is inside IBM, and the only common part
of its servername across the virtualhosts is ".ibm.com" so I won't rush off
to get a certificate for that!
On 28/11/06, Robert Fox <rf...@nd.edu> wrote:
>
> You only need a separate IP for every virtual host if you are not using a
> wildcard certificate. Wildcard certs cost a
> little more, but they are good for all hosts within a particular domain.
> Then, you can run all of your vhosts on port
> 443 with the same IP, and the cert will work for all of the vhosts.
>
--
Steve Swift
http://www.swiftys.org.uk
Re: [users@httpd] Virtual Hosts and SSL
Posted by Robert Fox <rf...@nd.edu>.
You only need a separate IP for every virtual host if you are not using a wildcard certificate. Wildcard certs cost a
little more, but they are good for all hosts within a particular domain. Then, you can run all of your vhosts on port
443 with the same IP, and the cert will work for all of the vhosts.
Also, if you choose to go with a non-wildcard cert, you can actually run several virtual hosts on the same IP, using
different certs for each vhost, but then you are forced to run SSL over a non-standard port. At that point, you need to
tell Apache to listen on that port, and configure each of your virtual hosts to listen on both port 80 and whatever port
you assign it for SSL transactions. SSL binds to a particular socket, so it's a combination of IP + port number that is
unique.
And, it's always necessary to have a separate and complete set of configuration directives for each port that a vhost
runs under.
Rob
Frode E. Moe wrote:
> On Tue, Nov 28, 2006 at 09:09:20 +0000, Steve Swift wrote:
>
>>Where should I go to learn about configuring Virtual Hosts and SSL in the
>>same apache?
>>
>>I have virtual hosts woking using "NameVirtualHost *:80"
>>SSL works for the Virtual Hosts *I* have defined
>>
>>But in the (default) ssl.conf file installed with apache I find:
>>
>><VirtualHost _default_:443>
>>SSLEngine on
>>SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
>>SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
>>... (other, less interesting lines)
>></VirtualHost>
>>
>>What puzzles me is this:
>>The VirtualHost definition above seems to be working as SSL is finding the
>>Certificate File (otherwise how would SSL work at all?)
>>How is this VirtualHost definition working in conjunction with
>>"NameVirtualHost *:80" ?
>
>
> You need a separate IP for each SSL virtualhost, since SSL certificates
> are exchanged before any HTTP headers (especially the Host: header) are
> transferred. So my guess is that apache just picks the first SSL
> certificate applicable for a given IP. In other words, it makes no sense
> to use NameVirtualHost for SSL / port 443. I don't think your *:80 stuff
> makes any difference either way as that sould be independent of anything
> on :443.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Virtual Hosts and SSL
Posted by Steve Swift <st...@gmail.com>.
Thank you for that answer. I'm just beginning to use SSL, and at the moment
I'm using the self-signed certificate that was installed for my server
during the original apache installation.
For my testing I'll need to generate additional certificates/Sever keys for
the Virtual Hosts I define in ssl.conf
On 28/11/06, Frode E. Moe <fr...@coretrek.no> wrote:
>
> You need a separate IP for each SSL virtualhost, since SSL certificates
> are exchanged before any HTTP headers (especially the Host: header) are
> transferred. So my guess is that apache just picks the first SSL
> certificate applicable for a given IP. In other words, it makes no sense
> to use NameVirtualHost for SSL / port 443. I don't think your *:80 stuff
> makes any difference either way as that sould be independent of anything
> on :443.
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
--
Steve Swift
http://www.swiftys.org.uk
Re: [users@httpd] Virtual Hosts and SSL
Posted by Robert Fox <rf...@nd.edu>.
You only need a separate IP for every virtual host if you are not using a wildcard certificate. Wildcard certs cost a
little more, but they are good for all hosts within a particular domain. Then, you can run all of your vhosts on port
443 with the same IP, and the cert will work for all of the vhosts.
Also, if you choose to go with a non-wildcard cert, you can actually run several virtual hosts on the same IP, using
different certs for each vhost, but then you are forced to run SSL over a non-standard port. At that point, you need to
tell Apache to listen on that port, and configure each of your virtual hosts to listen on both port 80 and whatever port
you assign it for SSL transactions. SSL binds to a particular socket, so it's a combination of IP + port number that is
unique.
And, it's always necessary to have a separate and complete set of configuration directives for each port that a vhost
runs under.
Rob
Frode E. Moe wrote:
> On Tue, Nov 28, 2006 at 09:09:20 +0000, Steve Swift wrote:
>
>>Where should I go to learn about configuring Virtual Hosts and SSL in the
>>same apache?
>>
>>I have virtual hosts woking using "NameVirtualHost *:80"
>>SSL works for the Virtual Hosts *I* have defined
>>
>>But in the (default) ssl.conf file installed with apache I find:
>>
>><VirtualHost _default_:443>
>>SSLEngine on
>>SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
>>SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
>>... (other, less interesting lines)
>></VirtualHost>
>>
>>What puzzles me is this:
>>The VirtualHost definition above seems to be working as SSL is finding the
>>Certificate File (otherwise how would SSL work at all?)
>>How is this VirtualHost definition working in conjunction with
>>"NameVirtualHost *:80" ?
>
>
> You need a separate IP for each SSL virtualhost, since SSL certificates
> are exchanged before any HTTP headers (especially the Host: header) are
> transferred. So my guess is that apache just picks the first SSL
> certificate applicable for a given IP. In other words, it makes no sense
> to use NameVirtualHost for SSL / port 443. I don't think your *:80 stuff
> makes any difference either way as that sould be independent of anything
> on :443.
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
--
-----------------------------------------------------------------------
Robert Fox Systems Administrator
University Libraries of Notre Dame Phone: (574)631-3353
211 Hesburgh Library Email: rfox2@nd.edu
Notre Dame, IN 46556
"Sufficit tibi gratia mea nam virtus in infirmitate perficitur" - 2 Corinthians 12:9
-----------------------------------------------------------------------
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Virtual Hosts and SSL
Posted by "Frode E. Moe" <fr...@CoreTrek.no>.
On Tue, Nov 28, 2006 at 09:09:20 +0000, Steve Swift wrote:
> Where should I go to learn about configuring Virtual Hosts and SSL in the
> same apache?
>
> I have virtual hosts woking using "NameVirtualHost *:80"
> SSL works for the Virtual Hosts *I* have defined
>
> But in the (default) ssl.conf file installed with apache I find:
>
> <VirtualHost _default_:443>
> SSLEngine on
> SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
> SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
> ... (other, less interesting lines)
> </VirtualHost>
>
> What puzzles me is this:
> The VirtualHost definition above seems to be working as SSL is finding the
> Certificate File (otherwise how would SSL work at all?)
> How is this VirtualHost definition working in conjunction with
> "NameVirtualHost *:80" ?
You need a separate IP for each SSL virtualhost, since SSL certificates
are exchanged before any HTTP headers (especially the Host: header) are
transferred. So my guess is that apache just picks the first SSL
certificate applicable for a given IP. In other words, it makes no sense
to use NameVirtualHost for SSL / port 443. I don't think your *:80 stuff
makes any difference either way as that sould be independent of anything
on :443.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org