[CentOS] Apache: confusion about virtual hosts and DNS on a local network
Niki Kovacs
contact at kikinovak.net
Sat Sep 19 13:04:07 UTC 2009
nate a écrit :
>
> just add a record
>
> microlinux.buildbox IN A #.#.#.#
>
That gives me a partial success. I added my two virtual hosts to the DNS
server, like this:
babasse A 192.168.1.1
buildbox A 192.168.1.2
lifebook A 192.168.1.3
raymonde A 192.168.1.4
jukebox A 192.168.1.5
frankenstein A 192.168.1.6
ap A 192.168.1.253
modem A 192.168.1.254
microlinux.buildbox A 192.168.1.2
kikinovak.buildbox A 192.168.1.2
I increased the serial and restarted named.
Then, on the webserver, I added this to httpd.conf:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin info at microlinux.fr
DocumentRoot /var/www/html/microlinux
ServerName buildbox.presbytere.local
ServerAlias microlinux.buildbox.presbytere.local
ErrorLog logs/microlinux-error_log
CustomLog logs/microlinux-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin contact at kikinovak.net
DocumentRoot /var/www/html/kikinovak
ServerName buildbox.presbytere.local
ServerAlias kikinovak.buildbox.presbytere.local
ErrorLog logs/kikinovak-error_log
CustomLog logs/kikinovak-access_log common
</VirtualHost>
... and I duly restarted httpd.
Now, I can fire up a browser anywhere on the LAN and view the first site
via http://microlinux.buildbox. But curiously, when I try to view the
second site via http://kikinovak.buildbox, I also get the first site at
the second address. Any idea what's going on here?
Niki
More information about the CentOS
mailing list