[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Domain Name Forwarding on a Raq3



Adam Reynolds wrote:

> I'm looking into having one primary domain and forwarding five others to
> the web space for that domain. I'm assuming that this is not possible
> through the Raq interface and that I would have to edit some of the
> underlying Apache files.
--

I found the following very useful, which may or may not suit your needs. If
you follow this proceedure and then add the redirect html page to the
apporpriate site, something like /home/sites/home/users/NEWDOMAIN/web -
Should work fine.   Rgds Steve Bassi

"  In the siteadmin of MYDOMAIN.com create a user for NEWDOMAIN.com called
NEWDOMAIN (can be whatever username you like). Then map the domain to the
/users/NEWDONAIN/web directory under MYDOMAIN. Doing it this way makes it
easy to deal with email for NEWDOMAIN.com.

First telnet/SSH in to your Raq as root.
Then create an include file for httpd.conf:
touch /etc/httpd/conf/include.conf

Then back up your httpd.conf file:
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.backup
Then open httpd.conf for editing:
pico -w /etc/httpd/conf/httpd.conf

Where you have something like:
NameVirtualHost xxx.xxx.xxx.xxx
<VirtualHost xxx.xxx.xxx.xxx>
ServerName www.MYDOMAIN.com
.....
</VirtualHost>

add the following line before the NameVirtualHost bit:
Include /etc/httpd/conf/include.conf

so it now reads:

Include /etc/httpd/conf/include.conf

NameVirtualHost xxx.xxx.xxx.xxx
<VirtualHost xxx.xxx.xxx.xxx>
ServerName www.MYDOMAIN.com
.....
</VirtualHost>

At this point it's a good idea to restart httpd just to make sure that
the server is happy with the changes to the httpd.conf file:
/etc/rc.d/init.d/httpd restart

Assuming you don't get any errors with restarting, open include.conf
for editing:
pico -w /etc/httpd/conf/include.conf

Then make an entry for NEWDOMAIN.com as follows:

<VirtualHost xxx.xxx.xxx.xxx>
ServerName www.NEWDOMAIN.com
ServerAdmin admin
DocumentRoot /home/sites/sitex/users/NEWDOMAIN/web
ServerAlias NEWDOMAIN.com
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
# Uncomment next 2 lines if you want to use SSI
#AddHandler server-parsed .shtml
#AddType    text/html     .shtml
</VirtualHost>

Then exit and save the file.

Then restart httpd:
/etc/rc.d/init.d/httpd restart

Obviously you will need to set up A records for NEWDOMAIN.com and
www.NEWDOMAIN.com.


One bonus of doing it with a user called NEWDOMAIN is that NEWDOMAIN can use
separate FTP to log in to upload files and can also go to
http://www.MYDOMAIN.com/personal/ and enter his user name and password to
get to the Personal Profile. So he can act as an independent site, but is
not taking up one of the virtual sites in your main GUI.

If you want all email for NEWDOMAIN.com to go to the NEWDOMAIN user see:
below


Email for newdomain.com to go to a user on mydomain.com and that the user's
name is newdomain

You have already set up DNS for newdomain.com and mydomain.com as normal as
above, make sure you include MX records. You have also already created a
user newdomain in mydomain.com

Login as root

Back up the files that you will be editing:
cp /etc/sendmail.cw /etc/sendmail.cw.backup
cp /etc/virtusertable /etc/virtusertable.backup

Then edit the files as required:

pico -w /etc/sendmail.cw
Go to the end of the file and type:
newdomain.com
www.newdomain.com

Then Ctrl-X to exit from pico and save the file

pico -w /etc/virtusertable
Go to the end of the file beneath the line that reads "# Put custom
additions below" and type:

@newdomain.com   newdomain
@www.newdomain.com newdomain

Then Ctrl-X to exit from pico and save the file

Then at the command prompt type:
/usr/bin/makemap hash /etc/virtusertable < /etc/virtusertable
/etc/rc.d/init.d/sendmail restart

Now you should be set up so that user1@xxxxxxxxxxxx will get all the email
for anyone@xxxxxxxxxxxxx