Mam zewnetrzny adres IP i domene. Chcialem zrobic tak, zeby przez subdomeny laczyc sie z virtualnymi hostami na apache. Czyli np jezeli mam mojaDomena.pl to chce zeby przez subdomena.mojaDomena.pl mozna bylo wejsc na inna strone niz przez mojaDomena.pl.
cat /etc/apache2/vhosts.d/00_default_vhost.conf
Code: Select all
# Virtual Hosts
#
<IfDefine DEFAULT_VHOST>
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
ServerName mojadomena.pl
Include /etc/apache2/vhosts.d/default_vhost.include
<IfModule mpm_peruser_module>
ServerEnvironment apache apache
</IfModule>
</VirtualHost>
<VirtualHost *:80>
ServerName subdomena.mojadomena.pl
DocumentRoot /var/www/subDomena
<Directory "/var/www/subDomena">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
</IfDefine>
cat /etc/bind/named.conf
Code: Select all
options {
directory "/var/bind";
// uncomment the following lines to turn on DNS forwarding,
// and change the forwarding ip address(es) :
//forward first;
forwarders {
194.204.159.1;
194.204.152.34;
};
listen-on-v6 { none; };
listen-on { 127.0.0.1; };
// to allow only specific hosts to use the DNS server:
//allow-query {
// 127.0.0.1;
//};
// if you have problems and are behind a firewall:
//query-source address * port 53;
pid-file "/var/run/named/named.pid";
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "pri/localhost.zone";
allow-update { none; };
notify no;
};
zone "mojaDomena.pl" {
type master;
file "pri/mojaDomena.pl";
notify yes;
};
zone "127.in-addr.arpa" IN {
type master;
file "pri/127.zone";
allow-update { none; };
notify no;
};
cat /var/bind/pri/mojaDomena.pl.zone
Code: Select all
$TTL 86400
@ IN SOA subdomena.mojaDomena.pl. (
2008122601 ; Serial
28800 ; Refresh
14400 ; Retry
604800 ; Expire - 1 week
86400 ) ; Minimum
mojaDomena.pl IN A <<moj IP>>
subdomena IN A <<moj IP>>
localhost IN A 127.0.0.1
subdomena.mojaDomena.pl IN A <<moj IP>>
Pozdrawiam.

