[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cobalt-users] Two Domains, Two Emails, same site
- Subject: [cobalt-users] Two Domains, Two Emails, same site
- From: "Joe" <my_hidden_email@xxxxxxxxx>
- Date: Wed Jul 11 10:17:01 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
This was really in reply to [cobalt-users] Pointers - RaQ 4r
but I added more, so I canged the title, sorry. The following
is long, but detailed.
> Message: 5
> From: "Nicholas Piecora" <NPiecora@xxxxxxxxxxxxx>
> To: <cobalt-users@xxxxxxxxxxxxxxx>
> Date: Wed, 11 Jul 2001 14:39:06 -0400
> Subject: [cobalt-users] Pointers - RaQ 4r
> Reply-To: cobalt-users@xxxxxxxxxxxxxxx
>
> Hello,
>
> This is another question that I am sure has been asked, but
> not sure the best way to do this.
>
> I have some users that would like to have one primary
> website, lets say x.com, and they also have the domain names
> y.com and z.com. The user would like to have y and z.com
> point to x.com. The address bar in the browser should still
> say z.com even when the data that it is pulling is from
> x.com. I was told that the best way to do this is to create a
<snip>
I have been wanting to tackle this topic for awhite, so I guess I will
do it now, I try to be as precise as possible, so bear with me.
I am going to explain how to point one domain to a dirctory of any
exsisting site. Also share the same email!
Bear in mind that editing system files technically invalidates your
warranty (but then how can anyone administer a Raq properly without
editing system files....).
I have found that you SHOULD NOT make your entries in httpd.conf!
You should make a extra config file out side of your httpd.conf file.
The reason I am explaining it this way is so if you add sites
via your control panel in the future you don't run the risk off wiping
out any mods you may have made.
You will make ONE addition to the http.conf file and that is all.
You will not need to make a virtual site with the control panel
at all. You will need to add the DNS setting via your control panel
though.
Now here we go, ready?
First off, decide what IP # you want the domain to use, for example
lets say it is 123.123.123.123
Go into your admin control panel, click control panel button, click
parameters for your domain name system, add your (A) records.
For example lets call the domain name secondsite.com
Now add the domain name that you are going to use to point to another
directory of a fully set up site on your Raq, with the IP you
decided to use, this don't have to be the same IP as the first site.
Add 2 (A) records here, one with the "www" and
one with out. While you are at it add a MX record I will explain
how to set point email at another site to, lets get the domain
name working first.
You should have:
secondsite.com -> 123.123.123.123
www.secondsite.com -> 123.123.123.123
secondsite.com Very-High priority secondsite.com
Save the domain name by clicking "Save changes to the DNS Server"
Go back to the control panel then click "Save Changes"
YOU ARE NOW DONE IN THE CONTROL PANEL TIME TO HEAD TO TELNET!
Telnet into your raq using you admin username and password.
when you get to the prompt type:
su -
it will ask for a password, normally this would be your admin
password again. After this, should be logged into your raq via
telnet as root.
Back up to the "root" of the drive by typing:
cd /
Back up your httpd.cong file by typing:
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.backup
Now change to the directory /etc/httpd/conf by typing:
cd /etc/httpd/conf
Now here is where you will make your ONE change to the
httpd.conf file.
Edit the file by typing:
pico httpd.conf
You should now be in the pico text editor, hold down your
control key and hit V until you get all the way to the very
bottom and add this line:
Include /etc/httpd/conf/extra.conf
Make sure include is capitalized.
hold down your control key again and hit X, it should ask
if you want to save the file, say yes.
Now, lets make your "extra" config file. Just as the line I
told you to add to the httpd.conf file, lets name this file
extra.conf (your "extra" domains, the way I phrase it)
type:
touch extra.conf
This creates a blank, empty file called extra.conf
Now open that file up in PICO!!
Type:
pico extra.conf
In here you will add the setting for your extra domains.
You need to add the following, but first you will need
the actual site number of the domain you want to point the
second domain to, let for example say it is site52 and the
directory name is called directory
(Just a quick note, when I do this, I suggest that the user
add a pop/ftp account and I point the second domain name there,
in this case if you create a username "jdoe" you could use this in
the upcoming instruction:
DocumentRoot /home/sites/site52/users/jdoe/web
This keeps the second site in its own area all together and you can
give their own FTP access, they can't use FrontPage though, unless
someone else knows how to do this)
Now add the following, but between {HTTP_HOST} AND !^123.123 use
the TAB key. The following also has to look just like this, none of
these lines can wrap to the next line or it will cause errors:
<VirtualHost 123.123.123.123>
ServerName www.secondsite.com
ServerAdmin admin
DocumentRoot /home/sites/site52/web/directory
ServerAlias secondsite.com
RewriteEngine on
RewriteCond %{HTTP_HOST} !^123.123.123.123(:80)?$
RewriteCond %{HTTP_HOST} !^www.secondsite.com(:80)?$
RewriteRule ^/(.*) http://www.secondsite.com/$1
[L,R]
RewriteOptions inherit
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType text/html .shtml
</VirtualHost>
There, now hold down your control key and hit X, and save the file.
Now lets get this to work. You will have to restart httpd!
Do this by typing:
cd /
then type:
/etc/rc.d/init.d/httpd stop
wait a few seconds then type:
/etc/rc.d/init.d/httpd start
You could just type:
/etc/rc.d/init.d/httpd restart
but I have found stopping and then starting works better, don't
ask me why, just have.
It should now work. Type typing secondsite.com and www.secondsite.com
in the browser. If it is not working, then you may have done
something wrong.
If you want to add another domain name here, just append to this file
by opening it up and adding more settings to the end, like,
<VirtualHost 123.123.123.123>
ServerName www.secondsite.com
ServerAdmin admin
DocumentRoot /home/sites/site52/web/directory
ServerAlias secondsite.com
RewriteEngine on
RewriteCond %{HTTP_HOST} !^123.123.123.123(:80)?$
RewriteCond %{HTTP_HOST} !^www.secondsite.com(:80)?$
RewriteRule ^/(.*) http://www.secondsite.com/$1
[L,R]
RewriteOptions inherit
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType text/html .shtml
</VirtualHost>
<VirtualHost 123.123.123.123>
ServerName www.thirdsite.com
ServerAdmin admin
DocumentRoot /home/sites/site52/web/directory
ServerAlias thirdsite.com
RewriteEngine on
RewriteCond %{HTTP_HOST} !^123.123.123.123(:80)?$
RewriteCond %{HTTP_HOST} !^www.thirdsite.com(:80)?$
RewriteRule ^/(.*) http://www.thirdsite.com/$1
[L,R]
RewriteOptions inherit
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType text/html .shtml
</VirtualHost>
NOW THE EMAIL PART!!!!!!!!
Thanks to Roger Harrison for most of this next part. Thanks Roger!
http://list.cobalt.com/pipermail/cobalt-users/2000-October/023655.html
This helped me a lot when I was a newbie last year. I copied
and pasted most of what he said with a few changes.
First make sure you are at the root of your drive by typing:
cd /
then backup the files that you will be editing by typing:
cp /etc/sendmail.cw /etc/sendmail.cw.backup
and:
cp /etc/virtusertable /etc/virtusertable.backup
Then edit the files as required by typing:
pico -w /etc/sendmail.cw
Go to the very end of the file and type:
secondsite.com
www.secondsite.com
Then Ctrl-X to exit from pico and save the file
now type:
pico -w /etc/virtusertable
Go to the end of the file beneath the line that reads "# Put custom
additions below" and type:
@secondsite.com %1@xxxxxxxxxxxxxx
@www.secondsite.com %1@xxxxxxxxxxxxxx
(them are not spaces, us your TAB key between .com and %1)
Then Ctrl-X to exit from pico and save the file
This sets it up so you can share two domains with one user account
jdoe@xxxxxxxxxxxxxx can get email at jdoe@xxxxxxxxxxxxx
Then at the command prompt type:
/usr/bin/makemap hash /etc/virtusertable < /etc/virtusertable
then type:
/etc/rc.d/init.d/sendmail restart
This will restart the email server.
Now you should be set up so that jdoe@firstdomain will get email
for jdoe@xxxxxxxxxxxxxx
Sorry I am anonymous, but it seems after I posted here in the past
my raq was getting hit, a lot, after I quite posting here, they stopped,
after awhile that is. I have had no problems since. I think a lot
of people here are very sincere, but I also feel that there are hackers
lurking this list, esp. when a new exploit comes out and Sun Cobalt has
no patch for it, or the patch don't work right.
I got hit once after I posted, is this .pkg working? Blam, raq got
hacked.
I wanted to still communicate with people here, read all the great tips,
but for the security of my server I am now anonymous, thanks yahoo.com
I have learned about 95% about administering my server from this
email list. The archive is great. Be careful though, some
post are not in detail for a newbie ;)
Research many post about what you are looking to do. You will be
surprise the first one you stumble across is not right.
Take care and enjoy,
Joe I think