httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] multiple vhosts on port 80 and port 443
Date Thu, 19 Oct 2006 13:16:34 GMT
> -----Original Message-----
> From: joe pond [mailto:digger920@hotmail.com] 
> Sent: Thursday, October 19, 2006 2:59 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] multiple vhosts on port 80 and port 443
> 
> I noticed on 10/19/2006 several postings about this. I may 
> have included too 
> much stuff but some folks may need the info.
> 
> The following configuration setup enables me to have multiple 
> vhost on port 
> 80 and multiple vhosts on port 443 and I can require 
> login/password or not 
> for eithe port 80 or port 443.
> 
> The non-matching server name on the 2nd 443 host would seem to be 
> resolveable by creating another certificate with that servers 
> name in it but 
> I have not tried that yet.

Don't bother - it won't work. As masro says, the SSL channel is
established first - before the server gets the Host header that it needs
for NameVirtualHost resolution. So the server will always use the certs
from the first SSL VH to set up the connection.

Check the archive for SSL NBVH - it's been gone over a million times
already...

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

> 
> HTH
> 
> digger920
> 
> 
> Apache2.2.X, SSL, Vhosts
> 
> I use include files to make troubleshooting a bit easier.
> This is a WAMP server BTW.
> 
> In httpd.conf
> 
> Listen 192.168.10.4:80
> Listen 192.168.10.4:443
> 
> LoadModule ssl_module modules/mod_ssl.so
> 
> 
> 
> # Virtual hosts
> Include conf/extra/httpd-vhosts.conf
> 
> # Secure (SSL/TLS) connections
> Include conf/extra/httpd-ssl.conf
> 
> <IfModule ssl_module>
> SSLMutex default
> SSLSessionCache none
> SSLRandomSeed startup builtin
> SSLRandomSeed connect builtin
> </IfModule>
> 
> ========================
> 
> In httpd-vhosts.conf
> 
> NameVirtualHost *:80
> 
> <VirtualHost *:80>
>     ServerAdmin whoever@where-ever
>     ServerName juneau
>     DocumentRoot "C:/Server/Apache2.2/htdocs"
> 
>     #ErrorLog logs/dummy-host.example.com-error_log
>     #CustomLog logs/dummy-host.example.com-access_log common
> </VirtualHost>
> 
> <VirtualHost *:80>
>     ServerAdmin whoever@where-ever
>     ServerName ASite
>     #ServerAlias Test1
>     DocumentRoot "C:/Server/Apache2.2/htdocs/www/A-Site"
> 
>     #ErrorLog logs/dummy-host2.example.com-error_log
>     #CustomLog logs/dummy-host2.example.com-access_log common
> </VirtualHost>
> 
> <VirtualHost *:80>
>     ServerAdmin whoever@where-ever
>     ServerName secure
>     DocumentRoot "C:/Locked"
>     <Directory /Locked>
>     AuthType Basic
>     AuthName "Locked Test"
>     AuthUserFile C:/Server/Apache2.2/htdocs/passwords/pwrd
>     Require user testuser
>     Order allow,deny
> 			Allow from all
>     </Directory>
>     #ErrorLog logs/dummy-host2.example.com-error_log
>     #CustomLog logs/dummy-host2.example.com-access_log common
> </VirtualHost>
> 
> ==================================
> 
> In httpd-ssl.conf
> 
> NameVirtualHost *:443
> 
> ##  SSL Global Context
> 
> AddType application/x-x509-ca-cert .crt
> AddType application/x-pkcs7-crl    .crl
> 
> SSLSessionCache        
> shmcb:c:/server/apache2.2/logs/ssl_scache(512000)
> SSLSessionCacheTimeout  300
> 
> ## SSL Virtual Host Context
> 
> <VirtualHost *:443>
> 
> #   General setup for the virtual host
> 		ServerName juneau
> 		ServerAdmin whoever@where-ever
> 		DocumentRoot "c:/SecureToo/"
> 
> 		<Directory /SecureToo>
> 			Order allow,deny
> 			Allow from all
> 		</Directory>
> 
> 
> 		ErrorLog 
> c:/server/apache2.2/logs/vhost_SSL_error_log.log
> 		TransferLog 
> c:/server/apache2.2/logs/vhost_SSL_access_log.log
> 
> 
> #   SSL Engine Switch:
> #   Enable/Disable SSL for this virtual host.
> SSLEngine on
> 
> SSLCipherSuite 
> ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
> 
> SSLCertificateFile c:/server/apache2.2/conf/ssl/juneau.crt
> 
> SSLCertificateKeyFile c:/server/apache2.2/conf/ssl/juneau.key
> 
> SSLCertificateChainFile c:/server/apache2.2/conf/ssl/juneau.crt
> 
> <FilesMatch "\.(cgi|shtml|phtml|php)$">
>     SSLOptions +StdEnvVars
> </FilesMatch>
> <Directory "c:/server/apache2.2/cgi-bin">
>     SSLOptions +StdEnvVars
> </Directory>
> 
> BrowserMatch ".*MSIE.*" \
>          nokeepalive ssl-unclean-shutdown \
>          downgrade-1.0 force-response-1.0
> 
> CustomLog c:/server/apache2.2/logs/ssl_request_log \
>           "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
> 
> </VirtualHost>
> 
> <VirtualHost *:443>
>     ServerAdmin whoever@when-ever
>     ServerName secure
>     DocumentRoot "C:/Locked/"
>     <Directory /Locked>
>     AuthType Basic
>     AuthName "Locked Test"
>     AuthUserFile C:/Server/Apache2.2/htdocs/passwords/pwrd
>     Require user jpond
>     Order allow,deny
> 			Allow from all
>     </Directory>
>     #ErrorLog logs/dummy-host2.example.com-error_log
>     #CustomLog logs/dummy-host2.example.com-access_log common
> </VirtualHost>
> 
> _________________________________________________________________
> Add a Yahoo! contact to Windows Live Messenger for a chance 
> to win a free 
> trip! 
> http://www.imagine-windowslive.com/minisites/yahoo/default.asp
x?locale=en-us&hmtagline
> 
> 
> ---------------------------------------------------------------------
> 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
>
 
 
This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

---------------------------------------------------------------------
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


Mime
View raw message