apache mod_ssl kai virtualhosting

Giannis Papaioannou jhn at egnatia.ee.auth.gr
Wed Feb 27 20:45:02 EET 2002


prospa8w na sthsw ena web server me name-based virtual hosting, auto pou
de katafera einai na xrhsimopoihsw diaforetika certificates, ena gia
ka8e site, o apache panta stelnei ena apo auta me apotelesma to
enoxlhtiko warning oti Common Name kai Server Name de tairiazoun.

Sto httpd.conf exw ta e3hs:

Port 80
DocumentRoot /var/www
ServerAdmin webmaster at site.gr
#ServerName 

<IfModule mod_ssl.c>
Listen 443
Listen 80

AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl

SSLPassPhraseDialog  builtin
SSLSessionCache         dbm:/var/run/ssl_scache
SSLSessionCacheTimeout  300
SSLMutex  file:/var/run/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLProtocol +all -SSLv2
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
</IfModule>

NameVirtualHost 10.0.0.5:80

<VirtualHost 10.0.0.5>
    ServerName www.site1.gr
    DocumentRoot /var/www/site1

    RewriteEngine on
RewriteRule ^/cgi-bin/(.*)$ https://www.site1.gr/cgi-bin/$1 [R=Permanent][L]
</VirtualHost>

<VirtualHost 10.0.0.5:433>
    ServerName www.site1.gr
    DocumentRoot /var/www/site1

  <IfModule mod_ssl.c>
    SSLEngine on
    SSLCertificateFile /etc/apache/ssl.crt/site1.cert
    SSLCertificateKeyFile /etc/apache/ssl.key/site1.key
  </IfModule>
</VirtualHost>

<VirtualHost 10.0.0.5>
    ServerName www.site2.gr
    DocumentRoot /var/www/site2

   RewriteEngine on
RewriteRule ^/cgi-bin/(.*)$ https://www.site2.gr/cgi-bin/$1 [R=Permanent][L]
</VirtualHost>

<VirtualHost 10.0.0.5:433>
    ServerName www.site2.gr
    DocumentRoot /var/www/site2 

<IfModule mod_ssl.c>
    SSLEngine on
    SSLCertificateFile /etc/apache/ssl.crt/site2.cert
    SSLCertificateKeyFile /etc/apache/ssl.key/site2.key
  </IfModule>
</VirtualHost>

Otan prospa8w na dw to http://www.site1.gr/cgi-bin/... mou petaei to
warning connection to www.site1.gr however secutiry certificate for
www.site2.gr

enw sto www.site2.gr ola douleuoun mia xara.

thx in advance
Giannis





More information about the Linux-greek-users mailing list