Doc file for administration of the server

Access count 1744


Setting up a new virtual domain

Assuming someone has arranged for you to host the domain newdomain.com, here is what needs to be done:
1) Log onto the server xdr.com, then become root
2) do "adduser newdomain"
3) do "passwd newdomain". Pick a password for the person to log on to.
4) do "su newdomain"
5) do "cd ~newdomain"
6) do "cp ~epyx/srm.conf ."
7) do "chmod 755 ."
8) do "mkdir www"
9) do "chmod 755 www"
10) Edit the srm.conf file, and replace epyx with newdomain. There are two places where you need to replace epyx.
11) Place any web pages you want into the www directory. Make sure they are chmod'd 755.
12) do "exit" (this returns you to being root).
13) Append the following lines to the file /etc/httpd/conf/httpd.conf:

< VirtualHost www.newdomain.com>
ServerAdmin root@xdr.com
DocumentRoot /home/newdomain/www
ServerName www.newdomain.com
ResourceConfig /home/newdomain/srm.conf
< /VirtualHost>
Don't have a space after the < and before the VirtualHost or /Virtualhost lines above. I had to put a space after the < to prevent the browser from interpreting it as an html tag...
14) Restart the httpd daemon. Do this by running "ps aux" and finding the httpd entry that is all by itself. Then do "kill -HUP #" where # is the process id of the httpd task. Do another "ps aux" to make sure httpd is still running.
15) Add the following line to the /etc/named.boot file:
primary       newdomain.com      named.newdomain

16) do "cd /var/named"
17) do "cp named.dummy named.newdomain"
18) Edit the named.newdomain file and replace newdomain.com with the real name of the new domain. There are 3 places where newdomain.com must be replaced.
19) do "ps aux" and find out the process ID of the named daemon. Then do a "kill -HUP #" where # is the process id of the named daemon.
20) do another "ps aux" to make sure named is still running.
21) The new domain should have been registered with the following name servers:
primary:
ns.xdr.com
208.242.122.43

secondary:
ns2.xdr.com
208.242.122.44

22) If you have any doubts about your ability to do this, have either Dave or Alex do it for you, since it's possible to mess up stuff pretty badly.

Sendmail configuration

I've turned on the virtusertable feature of sendmail which allows us to redirect email as needed. Originally to receive email on the server we had to keep adding entries to the 207.199.152.70 line of /etc/hosts, which would have eventually been a problem because the line would have gotten too long for vi to edit correctly.

Now for each new domain we host, we just add an entry to the /etc/sendmail.cw line, then restart the sendmail process. This can be done by running, as root:

/etc/rc.d/init.d/sendmail restart
To redirect email you must modify the file /etc/emails. The general form is
[From email address]       [To email address]
Each time email comes in addressed to the left side, it will get remapped to the right side. For the left side you can omit the actual userid, so ALL email will get remapped. For this case you can use the %1 token to represent the user id:
@epyx.com       %1@xdr.com
This will have the effect of everything sent to epyx.com will be relayed to xdr.com. The right side can contain just a userid, in which case email will be directed to an account on the server. Or it can contain userid@remotehost where remotehost is any machine on the internet. There is more info on this on the Virtual Hosting with Sendmail page.

After modifying the emails file you've got to recreate the hashed database file /etc/virtusertable.db. This is done with the following command:

makemap -v hash /etc/virtusertable < /etc/emails
You don't need to restart the sendmail process to have changes take effect.