Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server Alias under Linux / Apache 1

Status
Not open for further replies.

Mlima

Programmer
Jan 3, 2001
15
BR
Hi, friends:

I want to have, for instance, as a real Domain, and as just an alias, so that when browsing to any of them it can bring the same homepage, that is, abc.com.br. In this case, xyz.com.br wouldn´t have a home or web directory, nor email, nor ftp.

I configured the file systems as below (I changed the true domain names, this is just an example), but it is not working. abc is reachable, but xyz is not. Maybe something is wrong or I forgot something. Please, review the files and tell me this. Thanks a lot.

Mario./

/var/named/abc.com.br file:
---------------------------

$TTL 48200
@ IN SOA ns.multisitesdominios.com.br. webmaster.multisitesdominios.com.br. (
2001060303 ; serial
10800 ; refresh
3600 ; retry
604800 ; expire
86400 ; default_ttl
)
IN NS ns.multisitesdominios.com.br.
IN NS ns2.multisitesdominios.com.br.
IN MX 10 mail
IN A 200.201.129.12
;
www IN A 200.201.129.12
ftp IN A 200.201.126.12
mail IN A 200.201.129.12
smtp IN A 200.201.129.12
pop IN A 200.201.129.12

/var/named/xyz.com.br file:
---------------------------

$TTL 48200
@ IN SOA ns.multisitesdominios.com.br. webmaster.multisitesdominios.com.br. (
2001060403 ; serial
10800 ; refresh
3600 ; retry
604800 ; expire
86400 ; default_ttl
)
IN NS ns.multisitesdominios.com.br.
IN NS ns2.multisitesdominios.com.br.
IN A 200.201.129.12
;

/etc/named.conf entries:
------------------------

zone "abc.com.br"{
type master;
file "abc.com.br";
};

zone "xyz.com.br"{
type master;
file "xyz.com.br";
};

Obs: The secondary /etc/named.conf file is also accordingly configured.

/usr/local/apache/conf/httpd.conf file:
---------------------------------------

<virtualhost 200.201.129.12>
ServerAdmin webmaster@multisitesdominios.com.br
ServerName ServerAlias abc.com.br
ServerAlias DocumentRoot /home/abc/www
ScriptAlias /cgi-bin/ /home/abc/ErrorLog logs/abc-error-log
TransferLog logs/abc-access-log
</virtualhost>

As xyz is just a serveralias for abc, we didn´t create a xyz <virtualhost> block for it.

Thanks.
 
I know this is basic but have you checked your dns server's table's to be sure that it points to the same ip?
 
Yes, and the problem seems to be that in /var/named/xyz.cm.br we should also have an entry like:

www IN CNAME
I´m gonna try. Thanks.

Mario./
 
Well in ServerAlias you may want that to be set to *.abc.com.br so that any name prior to abc.com.br will go to the main document root. As for the second server, is it on the same box? or is it elsewhere?

If the second name xyz.com.br is on the same box, just make another virtualhost container like above and change it to xyz.com.br, leaving it set to the same document root.

Hopr this helps!!


Rninja
 
Good, thanks. Well, by the way, there's something I don't understand how it is done. It is the propagation of DNS information. If I alter any DNS information on my nameserver, is my server itself which sends this to the world to be chached elsewhere? Or does it participate on any other scheme?

Thanks for explaining this.

Mario./

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top