Admin/SetupGuides/skynetvhost

Setting up a Typical Skynet Vhost

There are two elements to setting up a skynet vhost ( something.skynet.ie ).

  1. DNS entry to be Added

  2. Apache Vhost Entry to be Added

A. Adding a DNS Entry

  1. Check to see if the address/entry (something.skynet.ie) is already assigned!!:

ping something.skynet.ie
nslookup something.skynet.ie
  1. ssh into intelligence as root (primary dns server)

  2. Edit the main skynet bind zone file. Note that the skynet.ie and csn.ul.ie zones are symlinked and taken from the one 'combo' zone file.

# Backup the named.combo.skynet.ie file firstly in case! Then edit it:
vi /etc/bind/zones/skynet/named.combo.skynet.ie
  1. Make sure to place the entry in the correct place to keep the file in order and tidy. Typically, vhosts for skynet members will be under the ";CNAMEs Galore" Section. Clubs&Society Vhosts are to be placed under ";C&S/SU CNAMEs". Also - try and keep the alphabetical order please! Its just common sense! More than likely the entry will appear as follows:

something                  CNAME   caro
  1. Update the serial for the zone file. Typically it is a date timestamp, with a 2 digit increment counter at the end, E.g.:

                2006101800 ; serial
                # The above is for the 18th of October, 2006. And the 00'th change on that day.
  1. Save the zone file.

  2. Reload the zone file into bind. There is a command-line helper app which will reload in the zone file for bind. This command-line helper is /usr/sbin/rndc. Thus to reload the zone file, run this on the primary dns server (intelligence):

/usr/sbin/rndc reload
  1. Check /var/log/daemon.log to ensure there were no errors:

tail /var/log/daemon.log
  1. Test to see if the DNS entry is added and reloaded in correctly using the following tools:

ping something.skynet.ie
nslookup something.skynet.ie

If ping something.skynet.ie pings caro's ip address - the DNS entry has been added correctly.

B.a Adding an Apache Vhost Entry (for something.skynet.ie)

The DNS entry which was added in above will send the client to the ip address of the webserver (caro). It is then up to apache on the webserver to read in and handle the request for something.skynet.ie

  1. ssh into caro (the main webserver).

  2. create a symlink to the directory something.skynet.ie should load:

ln -s /home/$user/public_html /srv/vhost/something

where /home/$user/public_html is the source directory to be shown at something.skynet.ie

B.b: Adding an Apache Vhost Entry (not for something.skynet.ie)

The DNS entry which was added in above will send the client to the ip address of the webserver (caro). It is then up to apache on the webserver to read in and handle the request

  1. ssh into caro (the main webserver).

  2. Copy an existing standard vhost entry (/etc/apache2/sites-available/) and modify. Here is a typical apache vhost:

<VirtualHost *:80>
ServerAdmin username@csn.ul.ie
ServerName something.csn.ul.ie
ServerAlias something.skynet.ie
UserDir disabled
DocumentRoot /home/username/
ErrorLog logs/virtual/something-errors
TransferLog logs/virtual/something-access
</VirtualHost>
  1. Enable vhost with

a2ensite
  1. Save file, and Reload the apache config:

/etc/init.d/apache2 reload

Test and Test

Make sure all works ok and as expected.

last edited 2010-04-06 15:12:30 by 10