{"id":1624,"date":"2014-06-28T14:14:02","date_gmt":"2014-06-28T12:14:02","guid":{"rendered":"http:\/\/www.unicoda.com\/?p=1624"},"modified":"2014-06-26T15:14:07","modified_gmt":"2014-06-26T13:14:07","slug":"installing-cabot-on-debian","status":"publish","type":"post","link":"https:\/\/www.unicoda.com\/?p=1624","title":{"rendered":"Installing Cabot on Debian"},"content":{"rendered":"<p>Let&rsquo;s say we want to install <a href=\"http:\/\/cabotapp.com\" target=\"_blank\">Cabot<\/a> on a server, but not on AWS, nor on DigitalOcean. And because we like challenges, let&rsquo;s just use Debian Wheezy 7.5 instead of the recommended Ubuntu 12.04 LTS. Ready?<\/p>\n<p>We will try to follow Cabot <a href=\"http:\/\/cabotapp.com\/qs\/quickstart.html\" target=\"_blank\">quickstart<\/a> to perform the installation.<br \/>\nBut first, we must set up a few things. I&rsquo;ve discovered that during installation, Cabot locks the password of the root account using <em>passwd -l root<\/em>. So be aware that you won&rsquo;t be able to log with root and ssh if you haven&rsquo;t set an authentication process using SSH keys. As <em>The Hitchhiker&rsquo;s Guide to the Galaxy<\/em> would say: \u00ab\u00a0Don&rsquo;t Panic\u00a0\u00bb, you can reverse the process if you want using <em>passwd -u root<\/em>. As a security, you could always create another user with <em>adduser mynewuser<\/em> and give him an admin status by adding it to the suddoers file with <em>visudo<\/em>.<\/p>\n<p>So let&rsquo;s create our keys and configure ssh.<br \/>\nGenerate the key:<\/p>\n<pre>ssh-keygen -t rsa<\/pre>\n<p>Now that we have a key named <em>id_rsa.pub<\/em> in our <em>.ssh<\/em> directory, we should do the following steps:<\/p>\n<ol>\n<li>Generate the key-file.<\/li>\n<li>Somehow get the key-file over to the right user-id on the right host.<\/li>\n<li>If that user doesn&rsquo;t already have an \u00ab\u00a0.ssh\u00a0\u00bb directory, create one AND set its permissions to \u00ab\u00a0700.\u00a0\u00bb (\u00ab\u00a0rwx&#8212;&#8212;\u00ab\u00a0)<\/li>\n<li>If that user doesn&rsquo;t already have an \u00ab\u00a0.ssh\/authorized_keys\u00a0\u00bb file, create one AND set its permissions to \u00ab\u00a0600.\u00a0\u00bb (\u00ab\u00a0rw&#8212;&#8212;-\u00ab\u00a0)<\/li>\n<li>Append &#8230; don&rsquo;t overwrite(!) &#8230; the new key to that file.<\/li>\n<\/ol>\n<p>Or we can use <em>ssh-copy-id<\/em>:<\/p>\n<pre> ssh-copy-id -i ~\/.ssh\/id_rsa.pub root@hostname.org<\/pre>\n<p>You should now be able to log in without having to type in a password.<\/p>\n<p>Before going further, we need to install Fabric as it is used to provision the server and deploy Cabot.<\/p>\n<pre>pip install fabric<\/pre>\n<p>Fabric also requires some dependencies which are described on <a href=\"http:\/\/www.fabfile.org\/installing.html\" target=\"_blank\">Fabric installation page<\/a>.<\/p>\n<p>Next step, clone the repository. I am using the deploy branch of <a href=\"https:\/\/github.com\/lincolnloop\/cabot\/tree\/deploy\" target=\"_blank\">lincolnloop fork<\/a> which include awesome python packaging.<\/p>\n<pre> git clone https:\/\/github.com\/lincolnloop\/cabot.git\r\n git checkout deploy\r\n cd cabot<\/pre>\n<p>Modify configuration: (might need to use development.env with the fork here)<\/p>\n<pre> cp conf\/production.env.example conf\/production.env\r\n vim conf\/production.env<\/pre>\n<p>Before doing anything, make sure you can or can&rsquo;t install nodejs: <em>aptitude search node<\/em>. If nodejs can&rsquo;t be found, you&rsquo;ll need to install it manually.<br \/>\nA few changes before provisioning our server. Edit file <em>bin\/setup_dependencies.sh<\/em><br \/>\nand remove line 57 and 58:\u00a0\u00a0 <em>&lsquo;nodejs<\/em>&lsquo; and <em>&lsquo;npm&rsquo;<\/em><br \/>\nInstall nodejs manually, npm should come it.<\/p>\n<pre>fab provision -H root@your.server.hostname<\/pre>\n<p>Once it&rsquo;s done, we can deploy cabot:<\/p>\n<pre> fab deploy -H ubuntu@your.server.hostname<\/pre>\n<p>You should get an error because cabot is trying to use upstart but can&rsquo;t find it.<br \/>\nTo run Cabot, log in to your server under the user ubuntu.<\/p>\n<pre> cd 2014-06-19-e662635<\/pre>\n<p>(Your directory will have a different name following a similar pattern year-month-day-wathever)<\/p>\n<pre> foreman start<\/pre>\n<p>Congratulations, Cabot should now be running!<\/p>\n<p><a href=\"http:\/\/www.unicoda.com\/wp-content\/uploads\/2014\/06\/cabot.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1635\" src=\"http:\/\/www.unicoda.com\/wp-content\/uploads\/2014\/06\/cabot.jpg\" alt=\"Cabot\" width=\"1003\" height=\"873\" srcset=\"https:\/\/www.unicoda.com\/wp-content\/uploads\/2014\/06\/cabot.jpg 1003w, https:\/\/www.unicoda.com\/wp-content\/uploads\/2014\/06\/cabot-300x261.jpg 300w, https:\/\/www.unicoda.com\/wp-content\/uploads\/2014\/06\/cabot-344x300.jpg 344w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<h3>Things to do<\/h3>\n<p>I will certainly add a simple init.d script to my Cabot fork so that we can run it easily. I will maybe change one or more things as the ubuntu username.<\/p>\n<p>Understanding how to install and run Cabot took me a few hours. I got disturbed by the quickstart speaking of AWS or DigitalOcean server. I also tried to install it manually but didn&rsquo;t manage to get it work, although I was close to it (I think. Or at least I hope ^^). Installing it on Debian added some difficulties, but nothing insurmountable. As a conclusion, I must say that Cabot is worth the effort. It provides a great way to monitor your service with Http checks and the possibility to alert based on Graphite metrics is just priceless.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&rsquo;s say we want to install Cabot on a server, but not on AWS, nor on DigitalOcean. And because we like challenges, let&rsquo;s just use Debian Wheezy 7.5 instead of the recommended Ubuntu 12.04 LTS. Ready? We will try to follow Cabot quickstart to perform the installation. But first, we must set up a few &hellip; <a href=\"https:\/\/www.unicoda.com\/?p=1624\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Installing Cabot on Debian&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,126,5],"tags":[190,23,241,164],"class_list":["post-1624","post","type-post","status-publish","format-standard","hentry","category-installation","category-logiciellibre","category-terminal","tag-cabot","tag-debian","tag-installation","tag-monitoring"],"_links":{"self":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts\/1624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1624"}],"version-history":[{"count":4,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts\/1624\/revisions"}],"predecessor-version":[{"id":1637,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=\/wp\/v2\/posts\/1624\/revisions\/1637"}],"wp:attachment":[{"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.unicoda.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}