Toon posts:

[apache+ssl] vhosts...

Pagina: 1
Acties:

Verwijderd

Topicstarter
oke het volgende...

Ik heb een 5 tal vhosts waarvan ik er 1 via ssl wil laten werken en de rest niet. Dus 4 moeten werken alleen via http en 1 via alleen https

dit is een stuk van mijn httpd.conf

NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
DocumentRoot /www/htdocs
ServerName box.x.nl
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /www/htdocs/mrtg
ServerName mrtg.x.nl
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /www/htdocs/alice
ServerName alice.x.nl
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /home/ody/www
ServerName www.iets.nl
</VirtualHost>

<IfDefine SSL>

<VirtualHost *:443>
ServerName secure.plein-origami.nl
DocumentRoot /www/htdocs
SSLEngine on
SSLCertificateFile /www/conf/ssl.crt/server.crt
SSLCertificateKeyFile /www/conf/ssl.key/server.key
</VirtualHost>

</IfDefine>

Het probleem is dat alle vhosts via http en https bereikbaar zijn... hoe krijg ik dit voor elkaar???

  • Steije
  • Registratie: Juni 2000
  • Laatst online: 14:11
Zet de SSL-vHost op een apart ip-adres?

Some people manage by the book, even though they don't know who wrote the book or even what book.


  • _JGC_
  • Registratie: Juli 2000
  • Laatst online: 16:58
ff een opmerking tussendoor maken: ik neem aan dat je mod_ssl gebruikt, heb je daarvan de handleiding wel gelezen wat betreft VHosts?
SSL kent nml geen vhosts :P

Ik heb 1 VHost op SSL staan, de rest is allemaal plain HTTP. Stukje uit mijn config:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
NameVirtualHost *:80

<VirtualHost *:80>
   ServerName www.jgc.homeip.net
   DocumentRoot /var/www/htdocs
</VirtualHost>
                                                                                
<VirtualHost *:80>
   ServerName mail.jgc.homeip.net
   DocumentRoot /var/www/mail
</VirtualHost>
                                                                                
<VirtualHost *:80>
   ServerName forum.jgc.homeip.net
   DocumentRoot /var/www/forum
</VirtualHost>

<VirtualHost _default_:443>
  DocumentRoot /usr/share/squirrelmail
<IfModule mod_ssl.c>
   SSLEngine on
   SSLCertificateFile    /etc/apache/ssl.crt/server.crt
   SSLCertificateKeyFile /etc/apache/ssl.key/server.key
   SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
   </IfModule>
</VirtualHost>


Die bovenste VHost is wat iemand te zien krijgt als ie een niet ingestelde VHost pakt, of als iemand op IP adres probeert mn server te krijgen
De mail VHost bevat alleen een index.php die refresht naar mn https VHost.
Forum spreekt voor zich dacht ik :P

Voor SSL kan je geen VHosts instellen, dus zodra iemand https://www.jgc.homeip.net doet, krijgt ie sowieso squirrel voor zn neus.