Pretpostavimo da ti je fiksna IP adresa 1.2.3.4
1. Inslitaj named server (bind) i podesi zone na sledeci nacin:
1.1 edituj named.conf
[root@kerber~]# vi /etc/named.conf
....
zone "second-hand.co.rs" IN {
type master;
file "secondhand-rs";
};
zone "weldteco.rs" IN {
type master;
file "weldteco-rs";
};
...
1.2 edituj zone fajlove (secondhand-rs, weldteco-rs)
[root@kerber mqueue]# more /var/named/weldteco-rs
$ORIGIN .
$TTL 86400 ; 1 day
weldteco.rs IN SOA kerber.kladovonet.com. root.kerber.kladovonet.com. (
2013101501 ; serial
10800 ; refresh (3 hours)
3600 ; retry (1 hour)
360000 ; expire (4 days 4 hours)
86400 ; minimum (1 day)
)
NS kerber.kladovonet.com.
A 212.200.113.130
MX 10 weldteco.rs.
$ORIGIN weldteco.rs.
pop3 CNAME weldteco.rs.
smtp CNAME weldteco.rs.
www A 212.200.113.133
2. Na domain hostingu (Goddady, RNIDS,...) podesi da su DNS serveri za tvoj domen na 1.2.3.4 IP adresi
Ako nemas logicko ime za tvoju IP adresu, podesi hotname prvo:
recimo: dns1.imedomena.com - 1.2.3.4
Tek onda podesi dns za oba sajta na: dns1.imedomena.com
3. Podesi apache
3.1 Edituj httpd.conf i podesi opciju pod VirtualHost...
[root@web ~]# vi /etc/httpd/conf/httpd.conf
Nadji ServerName i podesi: IP adresu:port
ServerName web.kladovonet.com:80
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
<VirtualHost *:80>
ServerAdmin
[email protected]
DocumentRoot /home/secondhand/second-hand.co.rs
ServerName
www.second-hand.co.rs
ErrorLog /var/log/httpd/second-hand.co.rs-error_log
CustomLog /var/log/httpd/second-hand.co.rs-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin
[email protected]
DocumentRoot /var/www/sajtovi/weldteco.rs
ServerName
www.weldteco.rs
ErrorLog /var/log/httpd/weldteco.rs-error_log
CustomLog /var/log/httpd/weldteco.rs-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin
[email protected]
DocumentRoot /var/www/sajtovi/cybercity.rs
ServerName
www.kladovo.net
ErrorLog /var/log/httpd/www.kladovonet.com-error_log
CustomLog /var/log/httpd/www.kladovonet.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin
[email protected]
DocumentRoot /home/geosoft/geosoft.co.rs
ServerName
www.geosoft.co.rs
ErrorLog /var/log/httpd/geosoft.kladovonet.com-error_log
CustomLog /var/log/httpd/geosoft.kladovonet.com-access_log common
</VirtualHost>
....
Resetuj named, resetuj apache...
Voila...
[Ovu poruku je menjao zivanicd dana 31.10.2014. u 18:04 GMT+1]