Gentoo Archives: gentoo-server

From: Maik Musall <lists@××××××.de>
To: gentoo-server@l.g.o
Subject: [gentoo-server] Apache vhosts IP/name-based with SSL
Date: Thu, 16 Feb 2006 15:44:22
Message-Id: 20060216153909.GA15396@musall.de
1 Hello friends,
2
3 I'm stuck setting up an apache with the following properties:
4
5 one.com is on 1.1.1.1:80 and 1.1.1.1:443
6 two.com is on 2.2.2.2:80 and 2.2.2.2:443
7 three.com is also on 2.2.2.2:80, no SSL
8
9 I maintain two different ssl certificates for the two SSL hosts, that's
10 the reason I have two different IP addresses for them.
11
12 I tried several configuration variants. The VirtualHost setup I supposed
13 to be the most correct is as follows:
14
15 httpd.conf: no VirtualHost directives
16
17 vhosts.d/00_one.com.conf:
18 NameVirtualHost 1.1.1.1:80
19 <VirtualHost 1.1.1.1:80>
20 ServerName one.com
21 </VirtualHost>
22
23 vhosts.d/01_two.com.conf:
24 NameVirtualHost 2.2.2.2:80
25 <VirtualHost 2.2.2.2:80>
26 ServerName two.com
27 </VirtualHost>
28
29 vhosts.d/02_three.com.conf:
30 # no NameVirtualHost directive since it's already in
31 # 01_two.com.conf, this still confuses me
32 <VirtualHost 2.2.2.2:80>
33 ServerName three.com
34 </VirtualHost>
35
36 modules.d/41_mod_ssl.default-vhost.conf:
37 NameVirtualHost 1.1.1.1:443
38 NameVirtualHost 2.2.2.2:443
39 <VirtualHost 1.1.1.1:443>
40 ServerName one.com
41 </VirtualHost>
42 <VirtualHost 2.2.2.2:443>
43 ServerName two.com
44 </VirtualHost>
45
46 With this setup, I always get the following warning:
47
48 # /usr/sbin/apache2 -S
49 [Thu Feb 16 16:34:15 2006] [warn] NameVirtualHost 1.1.1.1:80 has no VirtualHosts
50 [Thu Feb 16 16:34:15 2006] [warn] NameVirtualHost 2.2.2.2:80 has no VirtualHosts
51 VirtualHost configuration:
52 Syntax OK
53
54 Using *:80 and *:443 at all NameVirtualHost and VirtualHost places, or
55 using *:80 and *:443 with NameVirtualHost and concrete IP addresses with
56 VirtualHost directives, I get:
57
58 # /usr/sbin/apache2 -S
59 [Thu Feb 16 16:36:16 2006] [warn] NameVirtualHost *:80 has no VirtualHosts
60 VirtualHost configuration:
61 Syntax OK
62
63 Although syntax is reported to be "OK" I'm still worried by the warnings
64 that my setup is flawed. Can anybody give me a hint?
65
66 Thanks
67 Maik
68 --
69 Maik Musall <maik@××××××.de>
70 GPG public key 0x856861EB (keyserver: wwwkeys.de.pgp.net)
71 --
72 gentoo-server@g.o mailing list

Replies

Subject Author
Re: [gentoo-server] Apache vhosts IP/name-based with SSL Craig Webster <craig@××××××.net>