<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>DomTool/Installation</title><revhistory><revision><revnumber>23</revnumber><date>2018-04-19 02:12:01</date><authorinitials>ClintonEbadi</authorinitials><revremark>i'm redundant</revremark></revision><revision><revnumber>22</revnumber><date>2018-04-19 01:59:35</date><authorinitials>ClintonEbadi</authorinitials><revremark>$HOST is short hostname</revremark></revision><revision><revnumber>21</revnumber><date>2018-04-14 04:37:13</date><authorinitials>ClintonEbadi</authorinitials><revremark>log file is no longer used, systemd is used instead of init</revremark></revision><revision><revnumber>20</revnumber><date>2018-04-14 02:49:29</date><authorinitials>ClintonEbadi</authorinitials></revision><revision><revnumber>19</revnumber><date>2018-04-14 02:43:54</date><authorinitials>ClintonEbadi</authorinitials><revremark>one command to clone</revremark></revision><revision><revnumber>18</revnumber><date>2013-01-04 08:17:05</date><authorinitials>ClintonEbadi</authorinitials><revremark>bind_config group is legacy from when we delegated maintenance to jsl</revremark></revision><revision><revnumber>17</revnumber><date>2012-12-30 20:39:14</date><authorinitials>ClintonEbadi</authorinitials><revremark>more reorg</revremark></revision><revision><revnumber>16</revnumber><date>2012-12-30 20:26:42</date><authorinitials>ClintonEbadi</authorinitials><revremark>clarify where you must run domtool-addcert</revremark></revision><revision><revnumber>15</revnumber><date>2012-12-24 02:02:01</date><authorinitials>ClintonEbadi</authorinitials><revremark>update install guide</revremark></revision><revision><revnumber>14</revnumber><date>2012-12-20 22:12:58</date><authorinitials>ClintonEbadi</authorinitials><revremark>this page is a lie</revremark></revision><revision><revnumber>13</revnumber><date>2010-12-05 21:39:29</date><authorinitials>ClintonEbadi</authorinitials></revision><revision><revnumber>12</revnumber><date>2010-12-01 05:57:02</date><authorinitials>ClintonEbadi</authorinitials><revremark>easier way to setup the certificate for a slave</revremark></revision><revision><revnumber>11</revnumber><date>2010-12-01 05:16:24</date><authorinitials>ClintonEbadi</authorinitials></revision><revision><revnumber>10</revnumber><date>2010-02-16 17:59:06</date><authorinitials>DavorOcelic</authorinitials></revision><revision><revnumber>9</revnumber><date>2010-02-16 17:58:03</date><authorinitials>DavorOcelic</authorinitials></revision><revision><revnumber>8</revnumber><date>2010-02-16 17:53:19</date><authorinitials>DavorOcelic</authorinitials></revision><revision><revnumber>7</revnumber><date>2009-09-27 19:04:38</date><authorinitials>AdamChlipala</authorinitials><revremark>keytab</revremark></revision><revision><revnumber>6</revnumber><date>2009-09-27 17:09:15</date><authorinitials>AdamChlipala</authorinitials><revremark>No more 'make' failure!</revremark></revision><revision><revnumber>5</revnumber><date>2008-07-07 04:27:52</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>4</revnumber><date>2008-03-15 15:57:47</date><authorinitials>AdamChlipala</authorinitials><revremark>/etc/bind/zones</revremark></revision><revision><revnumber>3</revnumber><date>2008-03-15 15:57:02</date><authorinitials>AdamChlipala</authorinitials><revremark>More instructions</revremark></revision><revision><revnumber>2</revnumber><date>2008-03-15 15:36:52</date><authorinitials>AdamChlipala</authorinitials><revremark>Finishing the process</revremark></revision><revision><revnumber>1</revnumber><date>2008-03-09 14:28:16</date><authorinitials>AdamChlipala</authorinitials></revision></revhistory></articleinfo><note><para>In this document, <code>$HOST</code> is equivalent to <code>$(hostname)</code> (i.e. the first part of the fqdn,  e.g. <code>fritz</code> for <code>fritz.hcoop.net</code> <code>fritz</code>, we should probably switch to using the FQDN ) </para></note><section><title>Deploying an Update</title><para>Push all changes to the release branch, and tag as <code>release_${isodate}</code> (e.g. <code>release_20121022</code> for October 22nd, 2012). If you make multiple releases in a day append <code>-N</code> starting with <code>1</code>. </para><para>Running the <code>deploy-domtool</code> script will then pull, build, and install domtool sitewide. </para><para>To deploy on an individual host, use the <code>deploy-domtool-on-host</code> script. </para></section><section><title>New Machine</title><para>Ensure these Debian packages are installed: <code>mlton libssl-dev libpcre3-dev rsync</code> (our <ulink url="https://wiki.hcoop.net/DomTool/Installation/AutomatedSystemInstall#">AutomatedSystemInstall</ulink> does this for you) </para><para>Create <code>/afs/hcoop.net/common/domtool/build/$HOST</code> </para><para>Clone the <code>domtool2</code> repository and checkout release: </para><screen><![CDATA[cd /afs/hcoop.net/common/domtool/build/$HOST
git clone -b release /afs/hcoop.net/user/h/hc/hcoop/.hcoop-git/domtool2.git domtool2]]></screen><para>If a slave (the usual setup): </para><itemizedlist><listitem><para>Add node to <code>HOSTS_SLAVE</code> (unless it is the new master) variable <code>deploy-domtool</code> script. Afterward the general deployment procedure should work. </para></listitem><listitem><para>Create the needed SSL certificate for the node by running (on the machine with the domtool certificate authority): <code>domtool-addcert $HOST</code> </para></listitem></itemizedlist><para>The first time <ulink url="https://wiki.hcoop.net/DomTool/Installation/DomTool#">DomTool</ulink> is deployed to a host, it should be done manually using <code>deploy-domtool-on-host --slave --bootstrap</code> to ensure systemd units are installed and enabled. </para><section><title>Work Directories</title><para><ulink url="https://wiki.hcoop.net/DomTool/Installation/DomTool#">DomTool</ulink> should create these during installation, but it does not yet (see <ulink url="https://bugzilla.hcoop.net/show_bug.cgi?id=935">Bug 935</ulink>). </para><para>At HCoop, Puppet should automatically create them. </para><para>Domtool's scratch directory: </para><screen><![CDATA[sudo mkdir /var/domtool
sudo chown domtool.nogroup /var/domtool]]></screen><para>Create subdirectories of <code>/var/domtool</code> in the same way, depending on which services this slave will be managing: (incomplete) </para><itemizedlist><listitem><para>bind: <code>/var/domtool/zones</code> </para></listitem><listitem><para>apache: <code>/var/domtool/vhosts</code> and <code>/var/domtool/apache2_logs</code> </para></listitem><listitem><para>firewall: <code>/var/domtool/firewall</code> </para></listitem></itemizedlist></section></section><section><title>etc.</title><itemizedlist><listitem><para>To make everyone's Emacs autoload domtool-mode by default, put this in <code>/usr/local/share/emacs/site-lisp/default.el</code>: </para></listitem></itemizedlist><screen><![CDATA[(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/domtool-mode")
(require 'domtool-mode-startup)]]></screen><itemizedlist><listitem><para>If this slave manages BIND, make sure that the directory <code>/etc/bind/zones</code> exists. </para></listitem><listitem><para>Configure Certifications and keys </para><itemizedlist><listitem><para>If setting up the disptacher possibly set up local CA and SSL, and certificate for a node as said on <ulink url="https://wiki.hcoop.net/DomTool/Installation/DomTool/SslProcedures#">DomTool/SslProcedures</ulink>, and manually copy the certificate and key into the right places:</para><screen><![CDATA[mkdir ~domtool/keys/$HOST
cp serverkey.pem ~domtool/keys/$HOST/key.pem
cp servercert.pem ~domtool/certs/$HOST.pem]]></screen></listitem></itemizedlist></listitem><listitem><para>Be sure a keytab for <code>domtool</code> is in <code>/etc/keytabs/domtool</code>, with permissions set so that only <code>domtool</code> can read it. This is handled by puppet automatically at hcoop. </para></listitem><listitem><para>Try starting the slave server: </para></listitem></itemizedlist><screen><![CDATA[sudo service domtool-slave start]]></screen><itemizedlist><listitem><para>After ensuring that the slave starts, make the slave (or server) start at boot </para></listitem></itemizedlist><screen><![CDATA[sudo insserv domtool-slave]]></screen><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="https://wiki.hcoop.net/DomTool/Installation/CategorySystemAdministration#">CategorySystemAdministration</ulink> <ulink url="https://wiki.hcoop.net/DomTool/Installation/CategoryNeedsWork#">CategoryNeedsWork</ulink> </para></section></article>