VirtualHost на основе имен: файл Vhosts.conf :
################# Named VirtualHosts NameVirtualHost 127.0.0.2:80 <VirtualHost 127.0.0.2:80> ServerAdmin admin@main.com ServerName main.com ServerAlias main.com ServerPath /var/www/domain DocumentRoot "/var/www/domain" DirectoryIndex index.html index.php index.htm AddDefaultCharset KOI8-R </VirtualHost> <Directory /var/www/domain> AllowOverride None
Options FollowSymlinks
Allow from all </Directory> Файл зоны DNS main_com.zone в /var/named :
@ IN SOA main.com. root.main.com. ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS localhost.
main.com IN CNAME localhost
1 IN PTR localhost.
Блок файла /etc/named.conf :
controls { inet 127.0.0.1 allow { any; } keys { "key"; }; };
options { pid-file "/var/run/named/named.pid"; directory "/var/named"; /* * If there is a firewall between you and nameservers you want * to talk to, you might need to uncomment the query-source * directive below. Previous versions of BIND always asked * questions using port 53, but BIND 8.1 uses an unprivileged * port by default. */ // query-source address * port 53; };
// // a caching only nameserver config // zone "." { type hint; file "named.ca"; };
zone "0.0.127.in-addr.arpa" { type master; file "named.local"; }; zone "main.com" IN { . type master; . file "main_com.zone"; . allow-update { none; }; };
И далее при наборе в броузере http://127.0.0.2 выдается index.html - такой как и надо. Но вот при наборе http://main.com - Неизвестный узел main.com Что не так - подскажите ???