White dot for spacing only
The Dice Project


Development Meeting Management Software

The web service that is used for assisting the management of the Development Meeting is built as a rails application with access via an apache web server and with a mysql backend database.

Setting up the server

The server that runs the software has a DNS CNAME record of devproj so that the user interface to the software is via the URL https://devproj.inf.ed.ac.uk/.

The server's LCFG profile includes a header file, dice/options/devproj-server.h, that sets up most of the software needed for the service. That header includes a few more other headers:

The rails application is located, by default, at /disk/devproj/rails and is supplied by the devproj rpm (the exact package is defined via the devproj-server.h header file).

The apache configuration file is, by default, held at /disk/devproj/httpd/httpd.conf.devproj and is also supplied by the devproj rpm.

Mirroring and Mysql Backups

The two locations /disk/devproj and /var/lib/mysql are mirrored via rsync. The first location contains, by default, the rails application files, the apache configuration file and the weekday backups of the mysql database. The second contains a snapshot of the mysql live database.

Starting and stopping the server

The devproj server is active as long as the mysql database and the apache web server are running. These are started and stopped via the standard lcfg-mysql and lcfg-apache components respectively. Consequently the service will be started automatically on reboot and stopped when the server is shut down.

The web server document root

The document root for the apache web server is /disk/devproj/rails/tracker/public (this is defined in the apache configuration file /disk/devproj/httpd/httpd.conf.devproj). There are only a few real html files within that document root and any URL that doesn't correspond to one of these files is mapped via the rewrite mechanism into calls to the rails application (see the Development Meeting Support Software Manual).

Restoring the data

All the actual data on the development projects is held in the mysql database, so restoring the project data is very like restoring any other mysql database. There are weekday dumps of the mysql database that are held in /disk/devproj/backup/mysql by default. If these are lost (as well as the actual mysql database) then there are recent copies of both these and the live mysql database on the mirror server.

If the devproj server has completely failed and one needs to install a replacement machine then one should do the following:

  1. Install a new machine as a server or desktop or commandeer an existing machine for the purpose. But don't include the devproj-server.h header until after the machine has installed and booted.
  2. Add the the following lines to the machine's profile:
    #define DEVPROJ_SERVER
    #include <dice/options/devproj-server.h>

    However only add the first line if this is to be the actual devproj server; don't add that first line if it is a test server (just add the second #include line).

  3. If building a test server, then add the following lines to the profile:
    _X509_SERVICE(<machinename>)
    cosign.servicename<machinename>
    !x509.hashed_<machinename>mSET(/etc/httpd/conf/CA)
    cosign.file_filter_key/etc/httpd/conf/<machinename>.key
    cosign.file_filter_crt/etc/httpd/conf/<machinename>.crt
    !cosign.servicesmADD(<machinename>.inf.ed.ac.uk;0;;Informatics Development Projects test server;https://<machinename>.inf.ed.ac.uk/)
  4. Wait for the profile of the machine to compile and then install the new packages:
    $ om updaterpms run
  5. Start the cosign component and configure the SSL certificates for this cosign-protected web site:
    $ om cosign start

    You can check that cosign has started correctly by checking that /var/cosign has 2 directories - filter and ticket.

    Move any existing .crt file for this host out of the way (if it doesn't exist then one can skip this step). As root do:

    $ mv /etc/httpd/conf/<machinename>.crt /etc/httpd/conf/<machinename>.crt.old

    Create the SSL certificates:

    $ om x509 run

    and if this fails because the resources aren't available run the command:

    $ om x509 configure

    Check that the 3 <machinename> files have been created in /etc/httpd/conf along with a CA directory.

    Make sure the apache daemon can read them. As root do:

    $ chown -R apache.apache /etc/httpd/conf/CA
  6. Change the CNAME record in the inf domain dns map so that devproj is an alias for the new machine but not if you are building a test server:
    $ rfe dns/inf

    Comment out the old line

    # #verbatim inf.ed.ac.uk devproj IN CNAME dolly.inf.ed.ac.uk.

    and add the replacement line

    #verbatim inf.ed.ac.uk devproj IN CNAME <machinename>.inf.ed.ac.uk.
  7. Copy the latest mysql dump file from the mirror server (currently pyrolisk.inf.ed.ac.uk:/disk/rmirror131/devproj/devproj/backup/mysql/dump.*) to /tmp on the new server
  8. Copy /var/lib/mysql/rootpwd from the mirror (currently pyrolisk.inf.ed.ac.uk:/disk/rmirror131/devproj/mysql/rootpwd). You must do this before you start the mysql component.
  9. Start the mysql daemon
    $ om mysql start
  10. Load the mysql databases
    $ cd /tmp
    $ mysql -u root mysql
    mysql> source /tmp/dump.<weekday of most recent dump>
    mysql> FLUSH PRIVILEGES;
    mysql> \q
  11. Edit /disk/devproj/rails/tracker/config/database.yml to contain the password from the mirror. This is currently at pyrolisk:/disk/rmirror131/devproj/devproj/rails/tracker/config/database.yml
  12. If building a test server, you will need to edit /disk/devproj/httpd/httpd.conf.devproj to reflect the correct server name and to ensure that the correct KX509 keys are used i.e. change references to devproj to <machinename>
  13. Start the apache daemon:
    $ om apache start

Check that apache has started by doing ps - ef | grep httpd.

If the dns change has propagated as far as a machine then from that machine one should then be able to access the devproj web service via the normal URL https://devproj.inf.ed.ac.uk/ ( or https://<machinename>.inf.ed.ac.uk/ in the case of a test server).


 : Units : User_support 

Mini Informatics Logo - Link to Main Informatics Page
Please contact us with any comments or corrections.
Unless explicitly stated otherwise, all material is copyright The University of Edinburgh
Spacing Line