Hej,
Jag har installerat OpenSSL och skapat/konfigurerat subdomäner som fungerar utmärkt. Jag har också skapat ceritifkat och nycklar per subdomän (varje subdomän ska köra egen certifikat och nyckel). I varje subdomän finns utrymmen som ska köras över HTTPS och jag har skapat för varje subdomän två Virtual Host som lyssnar på port 80 respektive 443. Och det fungerar som önskat, dvs varje subdomän använder sin egen cert/nyckel-par.
Men jag vill inte ha två "Virtual Host" för varje subdomän utan en. Har hört att mod_ssl bör konfigureras med två VH i såna här fall. Urklipp ur min httpd.conf ser ut som nedan:
NameVirtualHost 127.0.0.3:80
NameVirtualHost 127.0.0.3:443<VirtualHost 127.0.0.3:80>
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/www"
ServerName xxx1.localhost
DirectoryIndex index.htm index.php<Directory "C:/Program Files/Apache Group/Apache2/htdocs/www/admin">
Order allow,deny
Deny from all
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.3:443>
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/www"
ServerName xxx1.localhostSSLEngine on
SSLCertificateFile "conf/ssl/xxx1.cert"
SSLCertificateKeyFile "conf/ssl/xxx1.key"
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown<Directory "C:/Program Files/Apache Group/Apache2/www/admin">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Som ni ser vill jag inte tillåta kommunikation till admin foldern utan SSL. Vidare så testar jag konfigurationerna lokalt på WinXP pro innan jag läggar upp allt på Apache2.x.
Vad jag vill alltså är slå ihop dessa subdomäner till en i konfigurationsfilen. Det ska se ut som det här ungefär:
# <VirtualHost 127.0.0.2:80 127.0.0.2:443>
# DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/www"
# ServerName xxx1.localhost
# DirectoryIndex index.htm index.php
#
# SSLEngine on
# SSLCertificateFile "conf/ssl/xxx1.cert"
# SSLCertificateKeyFile "conf/ssl/xxx1.key"
# SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
#
# SSLRequireSSL off
# <Directory "C:/Program Files/Apache Group/Apache2/htdocs/www/admin">
# SSLRequireSSL on
# </Directory>
# </VirtualHost>
Det är väl uppenbart att ovanstående konfiguration inte fungerar...Måste man ha två "Virutal Host":er för en sådan lösning?
Tack på förhand...
hbi