[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] VirtualHost with Host-Aliases??
- Subject: Re: [cobalt-users] VirtualHost with Host-Aliases??
- From: Webmaster <webmaster@xxxxxxxxx>
- Date: Mon Jan 10 19:36:19 2000
At 16:43 10/01/00 +0100, you wrote:
>How can I add to a virtual Domain a Domain-Alias?
>
>example:
>
>Host: www.domain.com
>
>and now I want a second (www.domain.net) and this should have the same
>document directory like www.domain.com.
>How can I manage this?
>Edit /etc/httpd/conf/httpd.conf???
>
Hi,
WEB PART:
Add the following line in your httpd.conf file at last line
Include /etc/httpd/conf/cnames.conf
Then create a file /etc/httpd/conf/cnames.conf
with at least following contents.
<VirtualHost your.ip.number.here>
ServerName www.domainB.com
ServerAlias domainB.com
RedirectPermanent / http://www.domainA.com/
</VirtualHost>
(you may omit the ServerAlias if you don't need)
Now restart the web server.
E-MAIL PART:
Look for the line in the file /etc/virtusertable
# Put custom additions below (Do not change/remove this line).
After above line add your new config.
## domainB.com --> domainA.com ##
@domainB.com %1@xxxxxxxxxxx
#Similarly
@mydomain.net %1@xxxxxxxxxxxx
@mydomain.org %1@xxxxxxxxxxxx
Then run the following command at shell prompt.
makemap hash /etc/virtusertable.db < /etc/virtusertable
I normally use a handy perl script to up date the virtusertable
It follows.
my script /usr/bin/newvirt
----------
#! /usr/bin/perl
system("makemap hash /etc/virtusertable.db < /etc/virtusertable");
exit;
--------
Regards,
Babu P. Yogarajah