<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CRIN Trac: Ticket #23: Development and staging environment</title>
    <link>https://trac.crin.org/trac/ticket/23</link>
    <description>&lt;p&gt;
Email from Peter:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
We would like to set up an environment that is as close as possible to the
production environment as possible, so that we are able to trial and review
any changes to the site before they go live.
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;We would ideally have two environments dev and stage on the same box.
&lt;ul&gt;&lt;li&gt;Ideally we would use dev.crin.org and stage.crin.org as two document
roots
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;We will script any deployment from git
&lt;ul&gt;&lt;li&gt;the same script should be used on productin too
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;We will use drush to sync between production and staging/dev
&lt;ul&gt;&lt;li&gt;we will need to have ssh access between the stage box and the prod box
to be able to sync
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
I would also like to know how you manage updates on the boxes. In the long
run it is pretty important that the dev box is kept in sync with the prod
box.
&lt;/p&gt;
&lt;/blockquote&gt;
</description>
    <language>en-us</language>
    <image>
      <title>CRIN Trac</title>
      <url>https://trac.crin.org/trac/chrome/site/logo.gif</url>
      <link>https://trac.crin.org/trac/ticket/23</link>
    </image>
    <generator>Trac 1.0.2</generator>
    <item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 17 Jun 2015 16:37:34 GMT</pubDate>
      <title>hours changed; totalhours set</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:1</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.15&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                set to &lt;em&gt;0.15&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Replying to &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23" title="defect: Development and staging environment (closed: fixed)"&gt;peter&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
We would like to set up an environment that is as close as possible to the
production environment as possible, so that we are able to trial and review
any changes to the site before they go live.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
That makes sense.
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;ul&gt;&lt;li&gt;We would ideally have two environments dev and stage on the same box.
&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;
That shouldn't be a problem.
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;ul&gt;&lt;li&gt;Ideally we would use dev.crin.org and stage.crin.org as two document
roots
&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;
Makes sense.
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;ul&gt;&lt;li&gt;We will script any deployment from git
&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;
Good idea.
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;ul&gt;&lt;li&gt;the same script should be used on productin too
&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;
Makse sense.
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;ul&gt;&lt;li&gt;We will use drush to sync between production and staging/dev
&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;
There is an issue with &lt;tt&gt;drush&lt;/tt&gt; I would need to resolve first, it doesn't support SSL/TLS MySQL connections and currently the &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; web server connects using SSL/TLS MySQL to &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; so I think we would need to change that to use &lt;tt&gt;stunnel&lt;/tt&gt; or &lt;tt&gt;ssh&lt;/tt&gt;, see &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/18" title="defect: Drush (closed: fixed)"&gt;ticket:18&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Also today I have set the Zend OPcache to not check for updated PHP files (the php files are all owned by root currently and there is no way for them to be updated!), see &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/9#comment:16" title="task: Monitor and adjust server settings after Crin1 and Crin2 server go live (closed: fixed)"&gt;ticket:9#comment:16&lt;/a&gt; so a &lt;tt&gt;service php5-fpm restart&lt;/tt&gt; or something would be needed after each deplyment of updated PHP files, but that shouldn't be a problem.
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;ul&gt;&lt;li&gt;we will need to have ssh access between the stage box and the prod box
to be able to sync
&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;
No problem.
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
I would also like to know how you manage updates on the boxes. In the long
run it is pretty important that the dev box is kept in sync with the prod
box.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
I have been applying Debian security updates as they are available using this script, &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/AptitudeUpdateScript"&gt;wiki:AptitudeUpdateScript&lt;/a&gt; which records the updates in &lt;tt&gt;/root/Changelog&lt;/tt&gt; and then the Changelog is emailed by &lt;tt&gt;logwatch&lt;/tt&gt; and I have also been recording the updates on &lt;a class="new ticket" href="https://trac.crin.org/trac/ticket/17" title="task: Debian System Updates (new)"&gt;ticket:17&lt;/a&gt;, this is all quite quick to do and I could easilly do it for a dev box.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Thu, 18 Jun 2015 09:02:11 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:2</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.15&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.15&lt;/em&gt; to &lt;em&gt;0.3&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
I have a few more thoughts on this, how do these suggestions sound?
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Using the same database server for the dev and live servers would be a cost saving.
&lt;/li&gt;&lt;li&gt;The live server has 4GB of RAM, a dev server might be able to get away with 512MB or 1GB, this would make it slower but cheaper.
&lt;/li&gt;&lt;li&gt;The key differences that the live and dev/stage sites need to have are:
&lt;ul&gt;&lt;li&gt;A &lt;tt&gt;robots.txt&lt;/tt&gt; to ensure that the site isn't indexed be search engines.
&lt;/li&gt;&lt;li&gt;One or more methods (eg a database edit or a MTA setting or Drupal module) to ensure that the dev/stage sites never send emails to anyone other than developers.
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;A script to sync the files and database from live to dev/stage which potentially also omits cache and log tables and also potentially edits all email addresses, this could be on the database server to make it quicker to run.
&lt;/li&gt;&lt;/ol&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Thu, 18 Jun 2015 09:10:37 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:3</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.05&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.3&lt;/em&gt; to &lt;em&gt;0.35&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
One further thought, the git repository could potentially be hosted on the same server as Trac (&lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt;) and it could be integrated with Trac so that the code could be browsed via Trac etc, see &lt;a class="ext-link" href="http://trac.edgewall.org/wiki/TracGit"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://trac.edgewall.org/wiki/TracGit&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>peter</dc:creator>

      <pubDate>Fri, 26 Jun 2015 16:40:04 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:4</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:4</guid>
      <description>
        &lt;pre class="wiki"&gt;Hi Chris here is my current technical writeup.
= Development server =
------------------------------
== Domains
* dev.crin.org
* stage.crin.org
== Resources
1GB Ram
Both sites will be hosted on the same server.
Database server shared with production.
= Repository
All code will be managed via a source repository "owned" by the client.
= Functionality
== Deployment scripts
In order to ensure consistency, all deployment should take place in a
consistent manner.
== Database and file sync
Allow developers to safely sync between environments
prod -&amp;gt; stage -&amp;gt; dev -&amp;gt; local
== Database snapshot and restore
Drush based database snapshot with reliable, tested, roll-back.
= Tasks
*deployment scripts
  * automatic db snapshot before deployment (on prod environment)
  * dedicated deployment user
    *developers should be able to sudo to deploy user
* apache environment setup
  * Allow scripts and code to be aware of environment
  * correct file ownership permissions for webserver and deployment user
    * umask and group ownership takes some fiddling
* sync scripts
  * drush based sync
  * ensure that dev/stage sites have shield module enabled to disable
indexing
* drush setup
   * aliases
      *  prod, stage,dev, local
      *  part of code repository to allow easy dev setup
* database
  * Set up environment databases
  * Backup and restore scripts
  * standard backup filename and location
  * daily snapshots of development database
      * (kept for 1 week)
  * simple drush based db restore
* Developer access
  * ssh to dev server
  * ssh to prod server from (dev server?)
  * access to log files (dev and prod)
* Email prevention
  * MTA should route all email to a single email address
      * Much safer at a system level than a drupal level
* documentation
--
===============================================================
Code Positive Ltd.                              Drupal +
http://codepositive.com
 Skills.Networks.Process.Development
Office: 0207 987 3928
Mobile: 07971 478 482
Skype: the-greenman
twitter: @greenman
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 29 Jun 2015 09:15:34 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:5</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:5</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.25&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.35&lt;/em&gt; to &lt;em&gt;0.6&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Thanks for the write up above, I'm not totally clear regarding exactly what things I'll be needed for, I presume you would like me to do the following?
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Create SSH accounts
&lt;/li&gt;&lt;li&gt;Set up Nginx
&lt;/li&gt;&lt;li&gt;Set up MySQL databases
&lt;/li&gt;&lt;li&gt;Set up DNS
&lt;/li&gt;&lt;li&gt;Set up MTA
&lt;/li&gt;&lt;li&gt;Set up Munin
&lt;/li&gt;&lt;li&gt;Document the setup
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
I assume that Peter will do all the deployment scripts and Solr setup? I would expect that above 7 tasks shouldn't take more that 7 hours.
&lt;/p&gt;
&lt;p&gt;
Note that backups are being sorted out on &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/11" title="defect: Set up backups (closed: fixed)"&gt;ticket:11&lt;/a&gt; and there is also a possible issues with Drush, &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/18" title="defect: Drush (closed: fixed)"&gt;ticket:18&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
I'm not sure that 1GB of RAM would be essential for the dev server, it'll need to have at least 1 Nginx, php5-fpm and Java process running, looking at the &lt;a class="ext-link" href="https://munin.crin.org/munin/crin.org/crin2.crin.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;Crin2 Munin stats&lt;/a&gt;, this is the amount of memory 1 process takes (dividing the memory used by the number of processes, of course this isn't totally accurate due to shared memory between processes):
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;tt&gt;php5-fpm&lt;/tt&gt; - 75M
&lt;/li&gt;&lt;li&gt;&lt;tt&gt;nginx&lt;/tt&gt; - 10M
&lt;/li&gt;&lt;li&gt;&lt;tt&gt;java&lt;/tt&gt; - 140M
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
I suspect that a 512M RAM dev server would be adequate, note that upgrading a virtual server from 512M to 1G is possible whereas downgrading from 1G to 512M isn't.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>peter</dc:creator>

      <pubDate>Mon, 29 Jun 2015 14:50:20 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:6</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:6</guid>
      <description>
        &lt;p&gt;
Ok. Chris, lets try the 512M server config.
I would also need a little help from from you on the webserver umask and ownership permissions.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>peter</dc:creator>

      <pubDate>Mon, 29 Jun 2015 15:35:05 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:7</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:7</guid>
      <description>
        &lt;pre class="wiki"&gt;Hi Chris
What is your cost estimate for a server with this spec?
On 29 June 2015 at 15:50, CRIN Trac &amp;lt;trac@trac.crin.org&amp;gt; wrote:
&amp;gt; #23: Development and staging environment
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt;                  Reporter:  chris   |                Owner:  chris
&amp;gt;                      Type:  defect  |               Status:  new
&amp;gt;                  Priority:  major   |            Milestone:  Maintenance
&amp;gt;                 Component:  drupal  |              Version:
&amp;gt;                Resolution:          |             Keywords:
&amp;gt; Estimated Number of Hours:  0       |  Add Hours to Ticket:  0
&amp;gt;                 Billable?:  1       |          Total Hours:  0.6
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt;
&amp;gt; Comment (by peter):
&amp;gt;
&amp;gt;  Ok. Chris, lets try the 512M server config.
&amp;gt;  I would also need a little help from from you on the webserver umask and
&amp;gt;  ownership permissions.
&amp;gt;
&amp;gt; --
&amp;gt; Ticket URL: &amp;lt;https://trac.crin.org/trac/ticket/23#comment:6&amp;gt;
&amp;gt; CRIN Trac &amp;lt;https://trac.crin.org/trac&amp;gt;
&amp;gt; Trac project for CRIN website and servers.
&amp;gt;
--
===============================================================
Code Positive Ltd.                              Drupal +
http://codepositive.com
Skills.Networks.Process.Development
Office: 0207 987 3928
Mobile: 07971 478 482
Skype: the-greenman
twitter: @greenman
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 29 Jun 2015 20:59:37 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:8</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:8</guid>
      <description>
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:6" title="Comment 6"&gt;peter&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
I would also need a little help from from you on the webserver umask and ownership permissions.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
No problem.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 29 Jun 2015 21:00:52 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:9</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:9</guid>
      <description>
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:7" title="Comment 7"&gt;peter&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
What is your cost estimate for a server with this spec?
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
The &lt;a class="ext-link" href="https://1984.is/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://1984.is/&lt;/a&gt; Virtual Server prices are here:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="https://1984.is/product/vps/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://1984.is/product/vps/&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 07 Jul 2015 08:39:40 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:10</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:10</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.08&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.6&lt;/em&gt; to &lt;em&gt;0.68&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Jenny / Gillian -- would you like me to start setting up a development server for Code Positive as discussed on this ticket above?
&lt;/p&gt;
&lt;p&gt;
If you would, could you (or perhaps ask Andrew to?) order it using the &lt;a class="ext-link" href="https://management.1984hosting.com/accounts/login/?next=/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;1984.is management interface&lt;/a&gt;:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;RAM: 512M
&lt;/li&gt;&lt;li&gt;OS:  64 bit Debian 7 (Jessie)
&lt;/li&gt;&lt;li&gt;Server Name: CRIN4
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
And then let me have the login details once it has been setup. Thanks.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 07 Jul 2015 10:14:34 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:11</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:11</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.03&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.68&lt;/em&gt; to &lt;em&gt;0.71&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Jenny asked by email:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
Please could you confirm a quote before we go ahead with this
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
I guessed that it might take up to 7 hours, details on this comment:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="https://trac.crin.org/trac/ticket/23#comment:5"&gt;https://trac.crin.org/trac/ticket/23#comment:5&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
But please note that this is not a quote, it is an estimate of the amount of time it might take.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 07 Jul 2015 11:04:29 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:12</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:12</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.1&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.71&lt;/em&gt; to &lt;em&gt;0.81&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Following a chat with Andrew I am revising the guess for how long this might take from 1 hour per task listed below to 30 mins per task, so 3.5 hours in total, but please note that there is no slack in this at all so there is no guarantee that this won't prove to be another underestimate of the time needed (I was hoping to avoid underestimating the time needed by estimating 7 hours).
&lt;/p&gt;
&lt;p&gt;
Please also note that no time has been allowed for helping Code Positive with setting up any scripts for deployment and updating of sites and databases or for doing backups.
&lt;/p&gt;
&lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:5" title="Comment 5"&gt;chris&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
I presume you would like me to do the following?
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Create SSH accounts
&lt;/li&gt;&lt;li&gt;Set up Nginx
&lt;/li&gt;&lt;li&gt;Set up MySQL databases
&lt;/li&gt;&lt;li&gt;Set up DNS
&lt;/li&gt;&lt;li&gt;Set up MTA
&lt;/li&gt;&lt;li&gt;Set up Munin
&lt;/li&gt;&lt;li&gt;Document the setup
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
I would expect that above 7 tasks shouldn't take more that 7 hours.
&lt;/p&gt;
&lt;/blockquote&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jenny</dc:creator>

      <pubDate>Tue, 07 Jul 2015 13:10:05 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:13</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:13</guid>
      <description>
        &lt;pre class="wiki"&gt;
Thanks Chris. This looks ok, but we are concerned about the possibility of going over 7 hours as we simply can't afford it. Can we agree this as the maximum?
Thanks,
Jenny
Sent from my iPhone
&amp;gt; On 7 Jul 2015, at 12:04, CRIN Trac &amp;lt;trac@trac.crin.org&amp;gt; wrote:
&amp;gt;
&amp;gt; #23: Development and staging environment
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt;                 Reporter:  chris   |                Owner:  chris
&amp;gt;                     Type:  defect  |               Status:  new
&amp;gt;                 Priority:  major   |            Milestone:  Maintenance
&amp;gt;                Component:  drupal  |              Version:
&amp;gt;               Resolution:          |             Keywords:
&amp;gt; Estimated Number of Hours:  0       |  Add Hours to Ticket:  0.1
&amp;gt;                Billable?:  1       |          Total Hours:  0.71
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt; Changes (by chris):
&amp;gt;
&amp;gt; * hours:  0 =&amp;gt; 0.1
&amp;gt; * totalhours:  0.71 =&amp;gt; 0.81
&amp;gt;
&amp;gt;
&amp;gt; Comment:
&amp;gt;
&amp;gt; Following a chat with Andrew I am revising the guess for how long this
&amp;gt; might take from 1 hour per task listed below to 30 mins per task, so 3.5
&amp;gt; hours in total, but please note that there is no slack in this at all so
&amp;gt; there is no guarantee that this won't prove to be another underestimate of
&amp;gt; the time needed (I was hoping to avoid underestimating the time needed by
&amp;gt; estimating 7 hours).
&amp;gt;
&amp;gt; Please also note that no time has been allowed for helping Code Positive
&amp;gt; with setting up any scripts for deployment and updating of sites and
&amp;gt; databases or for doing backups.
&amp;gt;
&amp;gt; Replying to [comment:5 chris]:
&amp;gt;&amp;gt; I presume you would like me to do the following?
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; 1. Create SSH accounts
&amp;gt;&amp;gt; 2. Set up Nginx
&amp;gt;&amp;gt; 3. Set up MySQL databases
&amp;gt;&amp;gt; 4. Set up DNS
&amp;gt;&amp;gt; 5. Set up MTA
&amp;gt;&amp;gt; 6. Set up Munin
&amp;gt;&amp;gt; 7. Document the setup
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; I would expect that above 7 tasks shouldn't take more that 7 hours.
&amp;gt;
&amp;gt; --
&amp;gt; Ticket URL: &amp;lt;https://trac.crin.org/trac/ticket/23#comment:12&amp;gt;
&amp;gt; CRIN Trac &amp;lt;https://trac.crin.org/trac&amp;gt;
&amp;gt; Trac project for CRIN website and servers.
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 07 Jul 2015 13:25:24 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:14</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:14</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.17&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.81&lt;/em&gt; to &lt;em&gt;0.98&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:13" title="Comment 13"&gt;jenny&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
Thanks Chris. This looks ok, but we are concerned about the possibility of going over 7 hours as we simply can't afford it. Can we agree this as the maximum?
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
I wouldn't spend more than 2 or 3 hours on this a day and would document everything I'm doing via Trac so you would be aware of how much time was being spent and how many tasks were being done. The only item in this list that I don't immeditialy know how to resolve is this one (all the others are quite straightforward):
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Set up MTA (mail transport agent)
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
Code Positive have asked for:
&lt;/p&gt;
&lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:4" title="Comment 4"&gt;peter&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;ul&gt;&lt;li&gt;Email prevention
&lt;ul&gt;&lt;li&gt;MTA should route all email to a single email address
&lt;ul&gt;&lt;li&gt;Much safer at a system level than a drupal level
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;
If this item were omitted then I would be quite confident that all 6 other tasks could be done in less than 3 hours -- this item is the only, somewhat, unknown task.
&lt;/p&gt;
&lt;p&gt;
Also note that this (rerouting all email to developers rather than clients) can be done at a Drupal level, using, for example, this module:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="https://www.drupal.org/project/reroute_email"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://www.drupal.org/project/reroute_email&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
However not doing this at a MTA level would increase the risk that the development server might send emails to clients, so I wouldn't advise only using the Drupal modules (doing both would probably be a good idea).
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jenny</dc:creator>

      <pubDate>Tue, 07 Jul 2015 13:35:09 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:15</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:15</guid>
      <description>
        &lt;pre class="wiki"&gt;Ok, can we go ahead with this then, please.
Thanks,
Jenny
Sent from my iPhone
&amp;gt; On 7 Jul 2015, at 14:25, CRIN Trac &amp;lt;trac@trac.crin.org&amp;gt; wrote:
&amp;gt;
&amp;gt; #23: Development and staging environment
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt;                 Reporter:  chris   |                Owner:  chris
&amp;gt;                     Type:  defect  |               Status:  new
&amp;gt;                 Priority:  major   |            Milestone:  Maintenance
&amp;gt;                Component:  drupal  |              Version:
&amp;gt;               Resolution:          |             Keywords:
&amp;gt; Estimated Number of Hours:  0       |  Add Hours to Ticket:  0.17
&amp;gt;                Billable?:  1       |          Total Hours:  0.81
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt; Changes (by chris):
&amp;gt;
&amp;gt; * hours:  0 =&amp;gt; 0.17
&amp;gt; * totalhours:  0.81 =&amp;gt; 0.98
&amp;gt;
&amp;gt;
&amp;gt; Comment:
&amp;gt;
&amp;gt; Replying to [comment:13 jenny]:
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; Thanks Chris. This looks ok, but we are concerned about the possibility
&amp;gt; of going over 7 hours as we simply can't afford it. Can we agree this as
&amp;gt; the maximum?
&amp;gt;
&amp;gt; I wouldn't spend more than 2 or 3 hours on this a day and would document
&amp;gt; everything I'm doing via Trac so you would be aware of how much time was
&amp;gt; being spent and how many tasks were being done. The only item in this list
&amp;gt; that I don't immeditialy know how to resolve is this one (all the others
&amp;gt; are quite straightforward):
&amp;gt;
&amp;gt; * Set up MTA (mail transport agent)
&amp;gt;
&amp;gt; Code Positive have asked for:
&amp;gt;
&amp;gt; Replying to [comment:4 peter]:
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; * Email prevention
&amp;gt;&amp;gt;  * MTA should route all email to a single email address
&amp;gt;&amp;gt;      * Much safer at a system level than a drupal level
&amp;gt;
&amp;gt; If this item were omitted then I would be quite confident that all 6 other
&amp;gt; tasks could be done in less than 3 hours -- this item is the only,
&amp;gt; somewhat, unknown task.
&amp;gt;
&amp;gt; Also note that this (rerouting all email to developers rather than
&amp;gt; clients) can be done at a Drupal level, using, for example, this module:
&amp;gt;
&amp;gt; * https://www.drupal.org/project/reroute_email
&amp;gt;
&amp;gt; However not doing this at a MTA level would increase the risk that the
&amp;gt; development server might send emails to clients, so I wouldn't advise only
&amp;gt; using the Drupal modules (doing both would probably be a good idea).
&amp;gt;
&amp;gt; --
&amp;gt; Ticket URL: &amp;lt;https://trac.crin.org/trac/ticket/23#comment:14&amp;gt;
&amp;gt; CRIN Trac &amp;lt;https://trac.crin.org/trac&amp;gt;
&amp;gt; Trac project for CRIN website and servers.
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 07 Jul 2015 13:40:00 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:16</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:16</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.02&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.98&lt;/em&gt; to &lt;em&gt;1.0&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:15" title="Comment 15"&gt;jenny&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
Ok, can we go ahead with this then, please.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Would you like me to include setting up the MTA or would you be happy for that to be omitted?
&lt;/p&gt;
&lt;p&gt;
Are you happy to order the virtual server and let me have the details, as per:
&lt;/p&gt;
&lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:10" title="Comment 10"&gt;chris&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
could you (or perhaps ask Andrew to?) order it using the &lt;a class="ext-link" href="https://management.1984hosting.com/accounts/login/?next=/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;1984.is management interface&lt;/a&gt;:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;RAM: 512M
&lt;/li&gt;&lt;li&gt;OS:  64 bit Debian 7 (Jessie)
&lt;/li&gt;&lt;li&gt;Server Name: CRIN4
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
And then let me have the login details once it has been setup.
&lt;/p&gt;
&lt;/blockquote&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 07 Jul 2015 13:41:26 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:17</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:17</guid>
      <description>
        &lt;p&gt;
Sorry, I got the version number wrong, Jessie is Debian 8 not 7:
&lt;/p&gt;
&lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:16" title="Comment 16"&gt;chris&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;blockquote class="citation"&gt;
&lt;ul&gt;&lt;li&gt;OS:  64 bit Debian 7 (Jessie)
&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;/blockquote&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>peter</dc:creator>

      <pubDate>Tue, 07 Jul 2015 13:50:04 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:18</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:18</guid>
      <description>
        &lt;pre class="wiki"&gt;Hi Chris
Are we going to be using exim? If so I can take on the mail routing.
I have a router for exim that would work to reroute all email.
Peter
On Tue, 7 Jul 2015 14:41 CRIN Trac &amp;lt;trac@trac.crin.org&amp;gt; wrote:
&amp;gt; #23: Development and staging environment
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt;                  Reporter:  chris   |                Owner:  chris
&amp;gt;                      Type:  defect  |               Status:  new
&amp;gt;                  Priority:  major   |            Milestone:  Maintenance
&amp;gt;                 Component:  drupal  |              Version:
&amp;gt;                Resolution:          |             Keywords:
&amp;gt; Estimated Number of Hours:  0       |  Add Hours to Ticket:  0
&amp;gt;                 Billable?:  1       |          Total Hours:  1.0
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt;
&amp;gt; Comment (by chris):
&amp;gt;
&amp;gt;  Sorry, I got the version number wrong, Jessie is Debian 8 not 7:
&amp;gt;
&amp;gt;  Replying to [comment:16 chris]:
&amp;gt;  &amp;gt; &amp;gt;
&amp;gt;  &amp;gt; &amp;gt; * OS:  64 bit Debian 7 (Jessie)
&amp;gt;
&amp;gt; --
&amp;gt; Ticket URL: &amp;lt;https://trac.crin.org/trac/ticket/23#comment:17&amp;gt;
&amp;gt; CRIN Trac &amp;lt;https://trac.crin.org/trac&amp;gt;
&amp;gt; Trac project for CRIN website and servers.
&amp;gt;
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 07 Jul 2015 13:53:26 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:19</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:19</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.02&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;1.0&lt;/em&gt; to &lt;em&gt;1.02&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:18" title="Comment 18"&gt;peter&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
Are we going to be using exim? If so I can take on the mail routing.
&lt;/p&gt;
&lt;p&gt;
I have a router for exim that would work to reroute all email.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Excellent, yes, I was just going to use the Debian default, Exim, I'm happy to leave the configuration of that to you. Note that we should ensure that Exim is configured before we install copies of the site.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 13 Jul 2015 08:38:31 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:20</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:20</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.02&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;1.02&lt;/em&gt; to &lt;em&gt;1.04&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Is the dev server going to be ordered this week? I'm asking since I'm going to have reduced availability from the end of this week for 6 weeks.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 13 Jul 2015 13:16:19 GMT</pubDate>
      <title>cc, status changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:21</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:21</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;cc&lt;/strong&gt;
              &lt;em&gt;mori&lt;/em&gt; added
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;accepted&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Mori added as a Cc for this ticket.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 13 Jul 2015 17:56:01 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:22</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:22</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.25&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;1.04&lt;/em&gt; to &lt;em&gt;1.29&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
SUMMARY: The following issue has been resolved and Jenny and Gillian don't need to take any action on it.
&lt;/p&gt;
&lt;p&gt;
Request from Mori:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
In order to automatically change the site's configuration per
environment, we need nginx to have environment variables available for
PHP to know which environment the site is running on.
&lt;/p&gt;
&lt;p&gt;
It will be good if we can refer to the variable like below:
&lt;/p&gt;
&lt;pre class="wiki"&gt;$_SERVER['SITE_ENV']
&lt;/pre&gt;&lt;p&gt;
If possible, please make the return values as below:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Prod:  'crin_prod'
&lt;/li&gt;&lt;li&gt;Stage: 'crin_stage'
&lt;/li&gt;&lt;li&gt;Dev: 'crin_dev'
&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;
I have added this to &lt;tt&gt;/etc/nginx/sites-available/crin.org&lt;/tt&gt; on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;  fastcgi_param SITE_ENV crin_prod;
&lt;/pre&gt;&lt;p&gt;
Restarted &lt;tt&gt;nginx&lt;/tt&gt; and &lt;tt&gt;php5-fpm&lt;/tt&gt; and created a test &lt;tt&gt;.php&lt;/tt&gt; file containing:
&lt;/p&gt;
&lt;pre class="wiki"&gt;&amp;lt;?php
phpinfo();
?&amp;gt;
&lt;/pre&gt;&lt;p&gt;
And &lt;tt&gt;_SERVER["SITE_ENV"]&lt;/tt&gt; was set to &lt;tt&gt;crin_prod&lt;/tt&gt;, so this will be fine on the dev server, it'll just be a matter of coding the other values into the &lt;tt&gt;nginx&lt;/tt&gt; config files.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 14 Jul 2015 13:15:09 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:23</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:23</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.79&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;1.29&lt;/em&gt; to &lt;em&gt;2.08&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
The server has been created, and I have completed one of the tasks, setting up &lt;tt&gt;ssh&lt;/tt&gt;, details follow.
&lt;/p&gt;
&lt;p&gt;
I'm sorry that this has taken longer than the estimate of 30 mins.
&lt;/p&gt;
&lt;h2 id="SSHconfig"&gt;SSH config&lt;/h2&gt;
&lt;p&gt;
Adding user accounts for &lt;tt&gt;chris&lt;/tt&gt;, &lt;tt&gt;peter&lt;/tt&gt; and &lt;tt&gt;mori&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;export NEWUSER="chris"
adduser --disabled-password $NEWUSER
adduser $NEWUSER sudo
mkdir /home/$NEWUSER/.ssh
chmod 700 /home/$NEWUSER/.ssh
chown -R $NEWUSER:$NEWUSER  /home/$NEWUSER/.ssh
&lt;/pre&gt;&lt;p&gt;
Install &lt;tt&gt;vim&lt;/tt&gt; and set it to be the default editor:
&lt;/p&gt;
&lt;pre class="wiki"&gt;aptitude install vim
echo "export EDITOR='vim'" &amp;gt;&amp;gt; /root/.bashrc
source /root/.bashrc
echo "syntax on" &amp;gt;&amp;gt; /root/.vimrc
&lt;/pre&gt;&lt;p&gt;
Edit &lt;tt&gt;/etc/sudoers&lt;/tt&gt; to enable password less sudo:
&lt;/p&gt;
&lt;pre class="wiki"&gt;#%sudo  ALL=(ALL:ALL) ALL
%sudo  ALL=(ALL)       NOPASSWD: ALL
&lt;/pre&gt;&lt;p&gt;
Add the root ssh public keys to the server from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; and &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; and lock them down to the specific IP addresses:
&lt;/p&gt;
&lt;pre class="wiki"&gt;mkdir ~/.ssh
vi ~/.ssh/authorized_keys
&lt;/pre&gt;&lt;p&gt;
Eg, &lt;tt&gt;/root/.ssh/authorized_keys&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;from="93.95.228.179" ssh-rsa AAA... root@CRIN1
from="93.95.228.180" ssh-rsa AAA... root@CRIN2
&lt;/pre&gt;&lt;p&gt;
Edit &lt;tt&gt;/root/ssh/config&lt;/tt&gt; on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; and &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; to add:
&lt;/p&gt;
&lt;pre class="wiki"&gt;Host crin4
  User root
  Hostname crin4.crin.org
&lt;/pre&gt;&lt;p&gt;
Test the ssh connections from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; and &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;ssh crin4
&lt;/pre&gt;&lt;p&gt;
Copy public keys from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; to &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;scp /home/chris/.ssh/authorized_keys crin4:/home/chris/.ssh/
scp /home/peter/.ssh/authorized_keys crin4:/home/peter/.ssh/
scp /home/mori/.ssh/authorized_keys crin4:/home/mori/.ssh/
&lt;/pre&gt;&lt;p&gt;
Chown them on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;chown chris:chris /home/chris/.ssh/authorized_keys
chown peter:peter /home/peter/.ssh/authorized_keys
chown mori:mori /home/mori/.ssh/authorized_keys
&lt;/pre&gt;&lt;p&gt;
Add DNS entries:
&lt;/p&gt;
&lt;pre class="wiki"&gt;crin4 900 IN A 93.95.228.222
*.crin4 900 IN A 93.95.228.222
dev 900 IN A 93.95.228.222
stage 900 IN A 93.95.228.222
&lt;/pre&gt;&lt;p&gt;
Edit &lt;tt&gt;/etc/hosts&lt;/tt&gt; on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt;, &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; and &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;93.95.228.222   crin4 crin4.crin.org dev.crin.org dev stage.crin.org stage
93.95.228.179   crin1 crin1.crin.org phpmyadmin.crin.org crin1.webarch.net cloud.crin.org www.cloud.crin.org stats.crin.org wiki.crin1.crin.org wiki.crin.org
93.95.228.180   crin2 crin2.crin.org crin2.webarch.net
&lt;/pre&gt;&lt;p&gt;
Edit &lt;tt&gt;/etc/hostname&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;crin4.crin.org
&lt;/pre&gt;&lt;p&gt;
And &lt;tt&gt;/etc/mailname&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;crin4.crin.org
&lt;/pre&gt;&lt;p&gt;
Disable logins via passwords (console logins will still work), edit &lt;tt&gt;/etc/ssh/sshd_config&lt;/tt&gt; and change:
&lt;/p&gt;
&lt;pre class="wiki"&gt;AllowGroups sudo root
PasswordAuthentication no
&lt;/pre&gt;&lt;p&gt;
Restart &lt;tt&gt;ssh&lt;/tt&gt; and test -- it's working fine.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 14 Jul 2015 13:17:48 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:24</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:24</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.03&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;2.08&lt;/em&gt; to &lt;em&gt;2.11&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Actually I haven't gone over time -- in &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:23" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:23&lt;/a&gt; I configured &lt;tt&gt;ssh&lt;/tt&gt; and did the DNS setup, so I'm, so far, under time for the first two tasks.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 14 Jul 2015 14:00:12 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:25</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:25</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.67&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;2.11&lt;/em&gt; to &lt;em&gt;2.78&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Jenny / Gillian, I'm afraid the original estimate of 1 hour for setting up &lt;tt&gt;nginx&lt;/tt&gt; was more accurate (but also quite a big underestimate) than the revised estimate of 30 mins -- I have spent 40 mins setting up &lt;tt&gt;nginx&lt;/tt&gt; but have not completed the task -- how would you like me to proceed?
&lt;/p&gt;
&lt;h2 id="Nginx"&gt;Nginx&lt;/h2&gt;
&lt;p&gt;
Install some packages, based on the list of things installed on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; on &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/6#comment:4" title="task: Migrate Drupal site from GreenQloud (closed: fixed)"&gt;ticket:6#comment:4&lt;/a&gt; (omitting &lt;tt&gt;drush&lt;/tt&gt; as &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; has one from source, see &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/6#comment:7" title="task: Migrate Drupal site from GreenQloud (closed: fixed)"&gt;ticket:6#comment:7&lt;/a&gt; and adding &lt;tt&gt;rsync&lt;/tt&gt;).
&lt;/p&gt;
&lt;pre class="wiki"&gt;aptitude install nginx-common nginx-extras php5 php5-fpm php-pear php5-mysql php5-intl php5-imagick php5-memcached memcached rsync
&lt;/pre&gt;&lt;p&gt;
Copy the live config over from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;rsync -av /etc/nginx/sites-available/ crin4:/etc/nginx/sites-available/
&lt;/pre&gt;&lt;p&gt;
Copy the &lt;tt&gt;vim&lt;/tt&gt; config for syntax highlighting over:
&lt;/p&gt;
&lt;pre class="wiki"&gt;rsync -av /root/.vim/ crin4:/root/.vim/
&lt;/pre&gt;&lt;p&gt;
Delete the config files we don't need, copy and rename the others:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /etc/nginx/sites-available
rm crin2.crin.org
rm crin.com
mv enoc.crin.org enoc.crin4.crin.org
mv solr.crin.org solr.crin4.crin.org
cp crin.org dev.crin.org
mv crin.org stage.crin.org
&lt;/pre&gt;&lt;p&gt;
Set up &lt;a class="ext-link" href="https://cacert.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://cacert.org/&lt;/a&gt; cert following the steps done for &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; on &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/8#comment:2" title="task: Install phpMyAdmin on crin1 and enable encrypted connections from crin2 (closed: fixed)"&gt;ticket:8#comment:2&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;mkdir /root/bin
cd /root/bin
wget http://svn.cacert.org/CAcert/Software/CSRGenerator/csr
chmod 700 csr
./csr
Private Key and Certificate Signing Request Generator
This script was designed to suit the request format needed by
the CAcert Certificate Authority. www.CAcert.org
Short Hostname (ie. imap big_srv www2): crin4
FQDN/CommonName (ie. www.example.com) : crin4.crin.org
Type SubjectAltNames for the certificate, one per line. Enter a blank line to finish
SubjectAltName: DNS:crin4.crin.org
SubjectAltName: DNS:*.crin4.crin.org
SubjectAltName: DNS:dev.crin.org
SubjectAltName: DNS:stage.crin.org
SubjectAltName: DNS:crin4.webarch.net
SubjectAltName: DNS:*.crin4.webarch.net
SubjectAltName: DNS:
Running OpenSSL...
&lt;/pre&gt;&lt;p&gt;
Login to &lt;a class="ext-link" href="https://www.cacert.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://www.cacert.org/&lt;/a&gt; and generate the cert, save it to &lt;tt&gt;/root/crin4_server.pem&lt;/tt&gt;.
&lt;/p&gt;
&lt;p&gt;
Edit the config, &lt;tt&gt;dev.crin.org&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;
server {
        #listen 80;
        listen 80 default_server;
        server_name dev.crin.org;
        root /var/www/dev;
        access_log /var/log/nginx/dev.crin.org.access.log;
        error_log  /var/log/nginx/dev.crin.org.error.log info;
        index index.php;
        # only include for unencrypted site
        include  gzip;
        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }
        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }
        # taken from .htaccess file
        location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$ {
                #allow 127.0.0.1;
                deny all;
        }
        # Very rarely should these ever be accessed outside of your lan
        location ~* \.(txt|log)$ {
                #allow 127.0.0.1;
                deny all;
        }
        # This matters if you use drush
        location = /backup {
                deny all;
        }
        # hide backup_migrate files
        location ~* ^/files/backup_migrate {
                deny all;
        }
        location ~* ^/sites/default/files/backup {
                deny all;
        }
        location ~ \..*/.*\.php {
                return 403;
        }
        # No no for private
                location ~ ^/sites/.*/private/ {
                return 403;
        }
        # this isn't readable anyway
                location ~ ^/xmlrpc\.php$ {
                return 403;
        }
        # https://groups.drupal.org/node/238983
        location ~* /sites/default/files/.*\.php$ {
                return 444;
        }
        # symlink to sites/default/files/images/i
        location ~* /i/.*\.php$ {
                return 444;
        }
        # symlink to sites/default/files/images/docs
        location ~* /docs/.*\.php$ {
                return 444;
        }
        # Block access to "hidden" files and directories whose names begin with a
        # period. This includes directories used by version control systems such
        # as Subversion or Git to store control files.
        location ~ (^|/)\. {
                return 403;
        }
#added
        # login redirect
        location ~ /user {
                rewrite ^/(.*)$ https://dev.crin.org/$1? permanent;
                #rewrite ^/(.*)$ https://$server_name/$1? permanent;
                #rewrite ^/(.*)$ https://crin.web1.crin.webarch.net/$1? permanent;
        }
        ### Upload progress support.
        ### http://drupal.org/project/filefield_nginx_progress
        ### http://github.com/masterzen/nginx-upload-progress-module
        location ~ (?&amp;lt;upload_form_uri&amp;gt;.*)/x-progress-id:(?&amp;lt;upload_id&amp;gt;\d*) {
                rewrite ^ $upload_form_uri?X-Progress-ID=$upload_id;
        }
        location ^~ /progress {
                upload_progress_json_output;
                report_uploads uploads;
        }
        # Restrict cron access
        # http://mailman.nginx.org/pipermail/nginx/2010-August/022009.html
        location /cron.php {
                allow 127.0.0.1;
                allow 93.95.228.222;
                error_page 403 =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                deny all;
        }
        location / {
                # This is cool because no php is touched for static content
                try_files $uri $uri/ @rewrite;
                error_page 404 = @rewrite;
                expires max;
        }
        location @rewrite {
                # Some modules enforce no slash (/) at the end of the URL
                # Else this rewrite block wouldn&amp;amp;amp;#39;t be needed (GlobalRedirect)
                rewrite ^/(.*)$ /index.php?q=$1;
        }
        location ~ \.php$ {
                include fastcgi_params;
                fastcgi_param SITE_ENV crin_dev;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
                fastcgi_send_timeout 1200s;
                fastcgi_read_timeout 1200s;
                fastcgi_buffers 256 16k;
                fastcgi_busy_buffers_size 32k;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                # track uploads in the 'uploads' zone
                # remember connections for 30s after they finished
                track_uploads uploads 60s;
        }
}
server {
        listen 80;
        server_name dev.crin.org;
        access_log /var/log/nginx/dev.crin.org.access.log;
        error_log  /var/log/nginx/dev.crin.org.error.log info;
        location / {
                return      301 http://dev.crin.org$request_uri;
        }
}
server {
        listen 443 ssl spdy default_server;
        #server_name crin.web1.crin.webarch.net crin.web1;
        server_name dev.crin.org;
        root /var/www/drupal;
        ssl  on;
        #ssl_certificate     /etc/ssl/gandi/crin.org.chained.pem;
        #ssl_certificate_key /etc/ssl/gandi/crin.org.key.pem;
        ssl_certificate  /etc/ssl/cacert/crin4.crin.org.chained.pem;
        ssl_certificate_key  /etc/ssl/cacert/crin4.crin.org.key.pem;
        ssl_dhparam /etc/ssl/gandi/dhparam.pem;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;
        ssl_prefer_server_ciphers on;
        add_header Strict-Transport-Security max-age=15768000;
        # 24 hours
        #add_header Strict-Transport-Security max-age=86400;
        ## Use a SSL/TLS cache for SSL session resume.
        ssl_session_cache shared:SSL:60m;
        ssl_session_timeout 30m;
        # see https://wiki.mozilla.org/Security/Server_Side_TLS#Nginx
        # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
        add_header X-Frame-Options SAMEORIGIN;
        # OCSP Stapling -- this needs a newer version of Nginx
        # http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_stapling
        # https://packages.debian.org/wheezy-backports/nginx-extras
        # fetch OCSP records from URL in ssl_certificate and cache them
        #ssl_stapling on;
        #ssl_stapling_verify on;
        ## verify chain of trust of OCSP response using Root CA and Intermediate certs
        #ssl_trusted_certificate /etc/ssl/gandi/gandi.pem;
        access_log /var/log/nginx/dev.crin.org.ssl_access.log;
        error_log  /var/log/nginx/dev.org.ssl_error.log info;
        index index.php;
#location = /owncloud {
#
#allow all;
#}
        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }
        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }
        location = /852C9C97D0C38497FD3777A798844720.txt {
                allow all;
        }
        # taken from .htaccess file
        location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$ {
                #allow 127.0.0.1;
                deny all;
        }
        # Very rarely should these ever be accessed outside of your lan
        location ~* \.(txt|log)$ {
                #allow 127.0.0.1;
                deny all;
        }
        # This matters if you use drush
        location = /backup {
                deny all;
        }
        # hide backup_migrate files
                location ~* ^/files/backup_migrate {
                deny all;
        }
        location ~* ^/sites/default/files/backup {
                deny all;
        }
        # not
        location ~ \..*/.*\.php {
                return 403;
        }
        # No no for private
                location ~ ^/sites/.*/private/ {
                return 403;
        }
        # this isn't readable anyway
                location ~ ^/xmlrpc\.php$ {
                return 403;
        }
        # https://groups.drupal.org/node/238983
        location ~* /sites/default/files/.*\.php$ {
                return 444;
        }
        # symlink to sites/default/files/images/i
        location ~* /i/.*\.php$ {
                return 444;
        }
        # symlink to sites/default/files/images/docs
        location ~* /docs/.*\.php$ {
                return 444;
        }
        # Block access to "hidden" files and directories whose names begin with a
        # period. This includes directories used by version control systems such
        # as Subversion or Git to store control files.
        location ~ (^|/)\. {
                return 403;
        }
        ### Upload progress support.
        ### http://drupal.org/project/filefield_nginx_progress
        ### http://github.com/masterzen/nginx-upload-progress-module
        location ~ (?&amp;lt;upload_form_uri&amp;gt;.*)/x-progress-id:(?&amp;lt;upload_id&amp;gt;\d*) {
                rewrite ^ $upload_form_uri?X-Progress-ID=$upload_id;
        }
        location ^~ /progress {
                upload_progress_json_output;
                report_uploads uploads;
        }
        # Restrict cron access
        # http://mailman.nginx.org/pipermail/nginx/2010-August/022009.html
        location /cron.php {
                allow 127.0.0.1;
                allow 93.95.228.222;
                error_page 403 =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                deny all;
        }
        location / {
                # This is cool because no php is touched for static content
                try_files $uri $uri/ @rewrite;
                error_page 404 = @rewrite;
                expires max;
        }
        location @rewrite {
                # Some modules enforce no slash (/) at the end of the URL
                # Else this rewrite block wouldn&amp;amp;amp;#39;t be needed (GlobalRedirect)
                rewrite ^/(.*)$ /index.php?q=$1;
        }
        location ~ \.php$ {
                include fastcgi_params;
                fastcgi_param SITE_ENV crin_dev;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
                fastcgi_send_timeout 1200s;
                fastcgi_read_timeout 1200s;
                fastcgi_buffers 256 16k;
                fastcgi_busy_buffers_size 32k;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                # track uploads in the 'uploads' zone
                # remember connections for 30s after they finished
                track_uploads uploads 60s;
        }
}
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 14 Jul 2015 18:05:18 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:26</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:26</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.08&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;2.78&lt;/em&gt; to &lt;em&gt;2.86&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Jenny / Gillian -- I have been thinking about the following, the estimate of 3 hours was based on these 6. tasks (see &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:5" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:5&lt;/a&gt; and &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:14" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:14&lt;/a&gt;):
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Create SSH accounts
&lt;/li&gt;&lt;li&gt;Set up Nginx
&lt;/li&gt;&lt;li&gt;Set up MySQL databases
&lt;/li&gt;&lt;li&gt;Set up DNS
&lt;/li&gt;&lt;li&gt;Set up Munin
&lt;/li&gt;&lt;li&gt;Document the setup
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
It is possible that setting up Munin and MySQL will take less than an hour, so I'll do them next and see where were are up to. We could also omit documenting the server, although this might cause things to take longer in the long run (more time will be spent trying to work out how things are setup) it would save some time in the short term and the live servers were not properly documented to save time (see &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; and &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;) and all the answers can be found in the tickets comments with enough searching.
&lt;/p&gt;
&lt;p&gt;
How does that sound as a way forward?
&lt;/p&gt;
&lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:25" title="Comment 25"&gt;chris&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
Jenny / Gillian, I'm afraid the original estimate of 1 hour for setting up &lt;tt&gt;nginx&lt;/tt&gt; was more accurate (but also quite a big underestimate) than the revised estimate of 30 mins -- I have spent 40 mins setting up &lt;tt&gt;nginx&lt;/tt&gt; but have not completed the task -- how would you like me to proceed?
&lt;/p&gt;
&lt;/blockquote&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>gillian</dc:creator>

      <pubDate>Wed, 15 Jul 2015 09:40:04 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:27</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:27</guid>
      <description>
        &lt;pre class="wiki"&gt;Hi Chris,
We should put documentation in place. Please check in once you have reached
3 hours.
Best,
Gillian
On 14 July 2015 at 19:05, CRIN Trac &amp;lt;trac@trac.crin.org&amp;gt; wrote:
&amp;gt; #23: Development and staging environment
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt;                  Reporter:  chris   |                Owner:  chris
&amp;gt;                      Type:  defect  |               Status:  accepted
&amp;gt;                  Priority:  major   |            Milestone:  Maintenance
&amp;gt;                 Component:  drupal  |              Version:
&amp;gt;                Resolution:          |             Keywords:
&amp;gt; Estimated Number of Hours:  0       |  Add Hours to Ticket:  0.08
&amp;gt;                 Billable?:  1       |          Total Hours:  2.78
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt; Changes (by chris):
&amp;gt;
&amp;gt;  * hours:  0 =&amp;gt; 0.08
&amp;gt;  * totalhours:  2.78 =&amp;gt; 2.86
&amp;gt;
&amp;gt;
&amp;gt; Comment:
&amp;gt;
&amp;gt;  Jenny / Gillian -- I have been thinking about the following, the estimate
&amp;gt;  of 3 hours was based on these 6. tasks (see ticket:23#comment:5 and
&amp;gt;  ticket:23#comment:14):
&amp;gt;
&amp;gt;  1. Create SSH accounts
&amp;gt;  2. Set up Nginx
&amp;gt;  3. Set up MySQL databases
&amp;gt;  4. Set up DNS
&amp;gt;  5. Set up Munin
&amp;gt;  6. Document the setup
&amp;gt;
&amp;gt;  It is possible that setting up Munin and MySQL will take less than an
&amp;gt;  hour, so I'll do them next and see where were are up to. We could also
&amp;gt;  omit documenting the server, although this might cause things to take
&amp;gt;  longer in the long run (more time will be spent trying to work out how
&amp;gt;  things are setup) it would save some time in the short term and the live
&amp;gt;  servers were not properly documented to save time (see [[Crin1]] and
&amp;gt;  [[Crin2]]) and all the answers can be found in the tickets comments with
&amp;gt;  enough searching.
&amp;gt;
&amp;gt;  How does that sound as away forward?
&amp;gt;
&amp;gt;  Replying to [comment:25 chris]:
&amp;gt;  &amp;gt; Jenny / Gillian, I'm afraid the original estimate of 1 hour for setting
&amp;gt;  up `nginx` was more accurate (but also quite a big underestimate) than the
&amp;gt;  revised estimate of 30 mins -- I have spent 40 mins setting up `nginx` but
&amp;gt;  have not completed the task -- how would you like me to proceed?
&amp;gt;
&amp;gt; --
&amp;gt; Ticket URL: &amp;lt;https://trac.crin.org/trac/ticket/23#comment:26&amp;gt;
&amp;gt; CRIN Trac &amp;lt;https://trac.crin.org/trac&amp;gt;
&amp;gt; Trac project for CRIN website and servers.
&amp;gt;
--
Gillian Harrow
Organisational Development Manager
*Child Rights International Network - CRIN*
Unit W125-127, Westminster Business Square
1-45 Durham Street
London SE11 5JH
United Kingdom
E: gillian@crin.org
T: +44 (0)20 7401 2257
Website: www.crin.org
Twitter: @CRINwire
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 15 Jul 2015 10:11:23 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:28</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:28</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.07&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;2.86&lt;/em&gt; to &lt;em&gt;2.93&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:27" title="Comment 27"&gt;gillian&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
We should put documentation in place.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
OK, great, apart from documenting the dev server work is also needed to document the live servers and also I think we could do with documentation about how best to use Trac.
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
Please check in once you have reached 3 hours.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
The total for this ticket was, before I wrote this comment, 2h 51m, see: &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:26" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:26&lt;/a&gt;, before I started work on the dev server yesterday it stood at 1h 17m, see &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:22" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:22&lt;/a&gt;.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 15 Jul 2015 10:50:39 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:29</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:29</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.5&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;2.93&lt;/em&gt; to &lt;em&gt;3.43&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Gillian / Jenny: The Munin install has taken 30 mins, however it has yet to be tested and some services won't be producing graphs as they have yet to be installed and configured.
&lt;/p&gt;
&lt;h2 id="Munin"&gt;Munin&lt;/h2&gt;
&lt;p&gt;
Setting up Munin, referencing &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/10" title="defect: Install Munin server and clients (closed: fixed)"&gt;ticket:10&lt;/a&gt;, install the client on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;aptitude install munin-node
&lt;/pre&gt;&lt;p&gt;
Backup the config file on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;mv /etc/munin/plugin-conf.d/munin-node /etc/munin/plugin-conf.d/munin-node.orig
&lt;/pre&gt;&lt;p&gt;
Copy the config from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;scp /etc/munin/plugin-conf.d/munin-node crin4:
&lt;/pre&gt;&lt;p&gt;
Copy plugins from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;, on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;mkdir -p /usr/local/share/munin/plugins/php5-fpm-munin-plugins/
&lt;/pre&gt;&lt;p&gt;
On &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;rsync -av /usr/local/share/munin/plugins/ crin4:/usr/local/share/munin/plugins/
&lt;/pre&gt;&lt;p&gt;
Enable the same plugins on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt; as on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /etc/munin/plugins
ln -s /usr/share/munin/plugins/fail2ban
ln -s /usr/share/munin/plugins/fw_conntrack
ln -s /usr/share/munin/plugins/fw_forwarded_local
ln -s /usr/share/munin/plugins/ip_ ip_93.95.228.222
ln -s /usr/share/munin/plugins/memcached_ memcached_bytes
ln -s /usr/share/munin/plugins/memcached_ memcached_counters
ln -s /usr/share/munin/plugins/memcached_ memcached_rates
ln -s /usr/share/munin/plugins/multips
ln -s /usr/share/munin/plugins/multips_memory
ln -s /usr/share/munin/plugins/nginx_request
ln -s /usr/share/munin/plugins/nginx_status
rm nfs4_client nfs_client nfsd nfsd4
aptitude remove nfs-common
ln -s /usr/share/munin/plugins/ntp_kernel_err
ln -s /usr/share/munin/plugins/ntp_kernel_pll_freq
ln -s /usr/share/munin/plugins/ntp_kernel_pll_off
ln -s /usr/share/munin/plugins/ntp_offset
aptitude install npt
ln -s /usr/local/share/munin/plugins/php5-fpm-munin-plugins/phpfpm_average
ln -s /usr/local/share/munin/plugins/php5-fpm-munin-plugins/phpfpm_connections
ln -s /usr/local/share/munin/plugins/php5-fpm-munin-plugins/phpfpm_memory
ln -s /usr/local/share/munin/plugins/php5-fpm-munin-plugins/phpfpm_processes
ln -s /usr/local/share/munin/plugins/php5-fpm-munin-plugins/phpfpm_status
ln -s /usr/local/share/munin/plugins/php_opcache_memoryusage
ln -s /usr/local/share/munin/plugins/php_opcache_restarts
&lt;/pre&gt;&lt;p&gt;
On &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; add the following to &lt;tt&gt;/etc/munin/munin.conf&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;[crin4.crin.org]
     address 93.95.228.222
     use_node_name yes
&lt;/pre&gt;&lt;p&gt;
On &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt; edit the following lines in &lt;tt&gt;/etc/munin/munin-node.conf&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;#allow ^127\.0\.0\.1$
#allow ^::1$
allow ^93\.95\.228\.179$
#host *
host 93.95.228.222
&lt;/pre&gt;&lt;p&gt;
Restart the client on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;service munin-node restart
&lt;/pre&gt;&lt;p&gt;
We should soon have graphs at this address:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="https://munin.crin.org/munin/crin.org/crin4.crin.org/index.html"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://munin.crin.org/munin/crin.org/crin4.crin.org/index.html&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
Note that some things won't yet work as the applications haven't been installed, a couple I can think of are the firewall and memcache.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 15 Jul 2015 11:32:56 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:30</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:30</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.54&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;3.43&lt;/em&gt; to &lt;em&gt;3.97&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Gillian / Jenny, MySQL has been set up for the dev server, copies of the live database haven't been copied yet, this task has taken just over 30 min.
&lt;/p&gt;
&lt;h2 id="MySQL"&gt;MySQL&lt;/h2&gt;
&lt;p&gt;
Copy config files from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; to &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;scp /root/.my.cnf crin4:
scp /home/peter/.my.cnf crin4:/home/peter/
scp /home/mori/.my.cnf crin4:/home/mori/
scp /home/chris/.my.cnf crin4:/home/chris/
&lt;/pre&gt;&lt;p&gt;
On &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt; chown files copied and create a directory for the &lt;a class="ext-link" href="https://cacert.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://cacert.org/&lt;/a&gt; keys and certs:
&lt;/p&gt;
&lt;pre class="wiki"&gt;chown peter:peter /home/peter/.my.cnf
chown mori:mori /home/mori/.my.cnf
chown chris:chris /home/chris/.my.cnf
mkdir /etc/ssl/cacert
&lt;/pre&gt;&lt;p&gt;
Copy keys and certs from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;rsync -av /etc/ssl/cacert/ crin4:/etc/ssl/cacert/
&lt;/pre&gt;&lt;p&gt;
On &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; add databases and users for the stage and dev sites, following the steps documented for &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;, &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/6#comment:4" title="task: Migrate Drupal site from GreenQloud (closed: fixed)"&gt;ticket:6#comment:4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;sudo -i
mysql
mysql&amp;gt; CREATE DATABASE stage;
  Query OK, 1 row affected (0.01 sec)
mysql&amp;gt; GRANT ALL ON stage.* to 'stage'@'crin4' identified by 'XXX' ' REQUIRE SSL;
  Query OK, 0 rows affected (0.04 sec)
mysql&amp;gt; CREATE DATABASE dev;
  Query OK, 1 row affected (0.02 sec)
mysql&amp;gt; GRANT ALL ON dev.* to 'dev'@'crin4' identified by 'XXX' REQUIRE SSL;
  Query OK, 0 rows affected (0.00 sec)
mysql&amp;gt; FLUSH PRIVILEGES;
  Query OK, 0 rows affected (0.07 sec)
&lt;/pre&gt;&lt;p&gt;
Edit the firewall on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; to allow MySQL connections from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;, add the following to &lt;tt&gt;/etc/iptables/rules.v4&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;-A INPUT -p tcp -s 93.95.228.222 --dport 3306 -j ACCEPT
&lt;/pre&gt;&lt;p&gt;
Reload the firewall on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; and check:
&lt;/p&gt;
&lt;pre class="wiki"&gt;iptables-restore &amp;lt; /etc/iptables/rules.v4
iptables -L | grep crin4
  ACCEPT     tcp  --  crin4                anywhere             tcp dpt:mysql
&lt;/pre&gt;&lt;p&gt;
Check what MySQL package are installed on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;aptitude search mysql | grep ^i
i A libdbd-mysql-perl               - Perl5 database interface to the MySQL data
i A libmysqlclient18                - MySQL database client library
i   mysql-client-5.5                - MySQL database client binaries
i A mysql-common                    - MySQL database common files, e.g. /etc/mys
i   php5-mysql                      - MySQL module for php5
&lt;/pre&gt;&lt;p&gt;
Install these MySQL packages on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;aptitude install libdbd-mysql-perl libmysqlclient18 mysql-client-5.5 mysql-common php5-mysql
&lt;/pre&gt;&lt;p&gt;
Check the MySQL connection on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;mysql -ustage -p stage
mysql -udev -p dev
&lt;/pre&gt;&lt;p&gt;
That works, the &lt;tt&gt;dev&lt;/tt&gt; and &lt;tt&gt;stage&lt;/tt&gt; passwords, which will be needed for the &lt;tt&gt;settings.php&lt;/tt&gt; files for the sites, have been saved in &lt;tt&gt;/root/mysql.txt&lt;/tt&gt; on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt; (they are also, for now, available in &lt;tt&gt;/root/.mysql_history&lt;/tt&gt; on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt;).
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 15 Jul 2015 11:44:12 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:31</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:31</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.17&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;3.97&lt;/em&gt; to &lt;em&gt;4.14&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
The total time for this ticket, as of the last comment, &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:30" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:30&lt;/a&gt;, stood at 3h 58m, before I started work on the server yesterday, &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:23" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:23&lt;/a&gt;, the total time on this ticket stood at 1h 17m, so the total worked since then was 2h 41m, once this ticket is included I have almost reached the underestimate of 3 hours in total.
&lt;/p&gt;
&lt;p&gt;
I think the main tasks remaining are:
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Configure &lt;tt&gt;nginx&lt;/tt&gt; (this has been started, see &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:25" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:25&lt;/a&gt;)
&lt;/li&gt;&lt;li&gt;Configure &lt;tt&gt;memcache&lt;/tt&gt;
&lt;/li&gt;&lt;li&gt;Configure &lt;tt&gt;php5-fpm&lt;/tt&gt;
&lt;/li&gt;&lt;li&gt;Configure the firewall, &lt;tt&gt;iptables&lt;/tt&gt; and &lt;tt&gt;fail2ban&lt;/tt&gt;
&lt;/li&gt;&lt;li&gt;Document the setup of the server
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
How would you like me to proceed?
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 15 Jul 2015 12:25:46 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:32</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:32</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.23&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;4.14&lt;/em&gt; to &lt;em&gt;4.37&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
One possible issue with the &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt; server is disk space, it doesn't have room for two full copies of the live site, so far we have 13G of free space:
&lt;/p&gt;
&lt;pre class="wiki"&gt;df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/dm-0        15G  1.2G   13G   9% /
udev             10M     0   10M   0% /dev
tmpfs            99M  4.4M   95M   5% /run
tmpfs           248M     0  248M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           248M     0  248M   0% /sys/fs/cgroup
/dev/sda1       236M   33M  191M  15% /boot
&lt;/pre&gt;&lt;p&gt;
The live site is 20G:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /var/www/drupal/
912K    ./misc
2.3M    ./includes
108K    ./profiles
84K     ./scripts
452K    ./stats
19G     ./sites
127M    ./owncloud_old
672K    ./themes
11M     ./modules
16K     ./.idea
381M    ./.git
20G     .
&lt;/pre&gt;&lt;p&gt;
19G of the 20G is in &lt;tt&gt;sites/default/files&lt;/tt&gt;, a couple of options:
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;If it is essential that both the stage and dev sites have a full copy of all the files then an aditional 30G of disk space will be needed, this would require the server to jump from a 512M RAM VPS to a 1536M RAM VPS (which comes with 48G of disk space), this would cost 3 times as much per month, see &lt;a class="ext-link" href="https://1984hosting.com/product/vps/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://1984hosting.com/product/vps/&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;Use the live &lt;tt&gt;sites/default/files&lt;/tt&gt; directory for the dev and stage sites, this could be done various ways, Fuse/SFTP mounting the live date on the dev server (I don't like this idea as it would enable the live site files to be deleted from the dev server) or setting up &lt;tt&gt;nginx&lt;/tt&gt; so that requests for anything in &lt;tt&gt;sites/default/files&lt;/tt&gt; on stage or dev is reverse proxied to the live server, this makes more sense as it would provide the functionality without introducing an additional risk of data loss.
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
The two options above will need to be discussed with Code Positive. I can't think of a good reason not to do something like the second option suggested above, but there might be other options I haven't thought of.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 15 Jul 2015 12:32:28 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:33</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:33</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.03&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;4.37&lt;/em&gt; to &lt;em&gt;4.4&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Gillian / Jenny since yesterday, from &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:23" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:23&lt;/a&gt; to &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:32" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:32&lt;/a&gt;, I have worked 3h 5m on this ticket so I'm stopping work on it until you advise me how you would like me to proceed.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Fri, 17 Jul 2015 11:18:35 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:34</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:34</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;1.41&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;4.4&lt;/em&gt; to &lt;em&gt;5.81&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Continuing settings things up...
&lt;/p&gt;
&lt;h2 id="MySQL"&gt;MySQL&lt;/h2&gt;
&lt;p&gt;
Add &lt;tt&gt;/var/www/.my.cnf&lt;/tt&gt; files for &lt;tt&gt;www-data&lt;/tt&gt; user:
&lt;/p&gt;
&lt;pre class="wiki"&gt;[client]
host=crin1
ssl-cipher=DHE-RSA-AES256-SHA
ssl-ca=/etc/ssl/cacert/cacert.pem
ssl-cert=/etc/ssl/cacert/crin1_cert.pem
ssl-key=/etc/ssl/cacert/crin1_yassl_privatekey.pem
&lt;/pre&gt;&lt;p&gt;
So &lt;tt&gt;drush&lt;/tt&gt; can be run as &lt;tt&gt;www-data&lt;/tt&gt; user.
&lt;/p&gt;
&lt;h2 id="robots.txt"&gt;robots.txt&lt;/h2&gt;
&lt;p&gt;
Create a &lt;tt&gt;/var/www/html/robots.txt&lt;/tt&gt; file containing:
&lt;/p&gt;
&lt;pre class="wiki"&gt;User-agent: *
Disallow: /
&lt;/pre&gt;&lt;p&gt;
And add this to all the server blocks in the Nginx config files in &lt;tt&gt;/etc/nginx/sites-available&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;        # this site isn't be be indexed
        location = /robots.txt {
                alias /var/www/html/;
        }
&lt;/pre&gt;&lt;p&gt;
And comment:
&lt;/p&gt;
&lt;pre class="wiki"&gt;        #location = /robots.txt {
        #        allow all;
        #        log_not_found off;
        #        access_log off;
        #}
&lt;/pre&gt;&lt;p&gt;
This should ensure search engines don't index the dev server.
&lt;/p&gt;
&lt;h2 id="HTTPS"&gt;HTTPS&lt;/h2&gt;
&lt;p&gt;
Generate a chained cert for Nginx as done on &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/8#comment:7" title="task: Install phpMyAdmin on crin1 and enable encrypted connections from crin2 (closed: fixed)"&gt;ticket:8#comment:7&lt;/a&gt;
&lt;/p&gt;
&lt;pre class="wiki"&gt;mv /root/crin4_* /etc/ssl/cacert/
cat crin4_cert.pem &amp;gt; crin4_cert.chained.pem
cat cacert.pem &amp;gt;&amp;gt; crin4_cert.chained.pem
chown root:www-data crin4_cert.chained.pem
&lt;/pre&gt;&lt;h2 id="Nginx"&gt;Nginx&lt;/h2&gt;
&lt;p&gt;
Disable the default site and enable the dev site:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /etc/nginx/sites-enabled/
rm default
ln -s ../sites-available/dev.crin.org 00-dev.crin.org
service nginx configtest
  [FAIL] Testing nginx configuration: failed!
&lt;/pre&gt;&lt;p&gt;
In the &lt;tt&gt;/var/log/nginx/error.log&lt;/tt&gt; we have:
&lt;/p&gt;
&lt;pre class="wiki"&gt;2015/07/17 10:26:46 [emerg] 30660#0: open() "/etc/nginx/gzip" failed (2: No such file or directory) in /etc/nginx/sites-enabled/00-dev.crin.org:13
&lt;/pre&gt;&lt;p&gt;
So copying that files from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;scp /etc/nginx/gzip crin4:/etc/nginx/
&lt;/pre&gt;&lt;p&gt;
Testing again:
&lt;/p&gt;
&lt;pre class="wiki"&gt;002:system library:fopen:No such file or directory:fopen('/etc/ssl/cacert/crin4.crin.org.chained.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
&lt;/pre&gt;&lt;p&gt;
Fix the paths:
&lt;/p&gt;
&lt;pre class="wiki"&gt;        ssl_certificate  /etc/ssl/cacert/crin4_cert.chained.pem;
        ssl_certificate_key  /etc/ssl/cacert/crin4_privatekey.pem;
        ssl_dhparam /etc/ssl/cacert/dhparam.pem;
&lt;/pre&gt;&lt;p&gt;
Test again:
&lt;/p&gt;
&lt;pre class="wiki"&gt;2015/07/17 10:35:43 [emerg] 31689#0: BIO_new_file("/etc/ssl/cacert/dhparam.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/ssl/cacert/dhparam.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
&lt;/pre&gt;&lt;p&gt;
Generate the file:
&lt;/p&gt;
&lt;pre class="wiki"&gt;openssl dhparam 2058 -out /etc/ssl/cacert/dhparam.pem
&lt;/pre&gt;&lt;p&gt;
Test again:
&lt;/p&gt;
&lt;pre class="wiki"&gt;2015/07/17 10:42:14 [emerg] 32250#0: zero size shared memory zone "uploads"
&lt;/pre&gt;&lt;p&gt;
On &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; we have &lt;tt&gt;/etc/nginx/conf.d/upload_progress.conf&lt;/tt&gt; containing:
&lt;/p&gt;
&lt;pre class="wiki"&gt;upload_progress uploads 100m;
&lt;/pre&gt;&lt;p&gt;
So that files was copied over:
&lt;/p&gt;
&lt;pre class="wiki"&gt;scp conf.d/upload_progress.conf crin4:/etc/nginx/conf.d/
&lt;/pre&gt;&lt;p&gt;
And the configtest passes:
&lt;/p&gt;
&lt;pre class="wiki"&gt;service nginx configtest
[ ok ] Testing nginx configuration:.
&lt;/pre&gt;&lt;p&gt;
So, restarting:
&lt;/p&gt;
&lt;pre class="wiki"&gt;service nginx restart
&lt;/pre&gt;&lt;p&gt;
Seem OK but the &lt;tt&gt;/robots.txt&lt;/tt&gt; file is a 404, trying &lt;a class="ext-link" href="https://stackoverflow.com/questions/12590413/fallback-to-default-shared-file-in-nginx"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;this suggestion&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;location = /robots.txt {
    #expires 30d;
    #add_header Cache-Control public;
    try_files /robots.txt @shared;
}
location @shared {
    root /var/www/html;
}
&lt;/pre&gt;&lt;p&gt;
That still doesn't work, in the logs:
&lt;/p&gt;
&lt;pre class="wiki"&gt;==&amp;gt; /var/log/nginx/dev.crin.org.error.log &amp;lt;==
2015/07/17 11:03:15 [error] 1866#0: *3 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 93.95.228.222, server: dev.crin.org, request: "GET /robots.txt/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "dev.crin.org", referrer: "http://dev.crin.org/"
==&amp;gt; /var/log/nginx/dev.crin.org.access.log &amp;lt;==
93.95.228.222 - - [17/Jul/2015:11:03:15 +0000] "GET /robots.txt/ HTTP/1.1" 404 47 "http://dev.crin.org/" "Mozilla/5.0 (X11; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0"
&lt;/pre&gt;&lt;p&gt;
So the request for &lt;tt&gt;/robots.txt&lt;/tt&gt; is being passed to &lt;tt&gt;php5-fpm&lt;/tt&gt; and I'm not sure why...
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Fri, 17 Jul 2015 12:04:40 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:35</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:35</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.1&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;5.81&lt;/em&gt; to &lt;em&gt;5.91&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
It appears my browser was caching a redirect from &lt;tt&gt;/robots.txt&lt;/tt&gt; to &lt;tt&gt;/robots.txt/&lt;/tt&gt; -- the following works when testing in another browser:
&lt;/p&gt;
&lt;pre class="wiki"&gt;        # this site isn't be be indexed
         location = /robots.txt {
                root /var/www/html;
        }
&lt;/pre&gt;&lt;p&gt;
Also busting the cache with a query string works: &lt;a class="ext-link" href="http://dev.crin.org/robots.txt?123"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://dev.crin.org/robots.txt?123&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Fri, 17 Jul 2015 21:40:30 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:36</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:36</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.62&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;5.91&lt;/em&gt; to &lt;em&gt;6.53&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;h2 id="Drush"&gt;Drush&lt;/h2&gt;
&lt;p&gt;
Installing the same version as on the live server, see &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/6#comment:7" title="task: Migrate Drupal site from GreenQloud (closed: fixed)"&gt;ticket:6#comment:7&lt;/a&gt;
&lt;/p&gt;
&lt;pre class="wiki"&gt;sudo -i
cd /usr/local/src
wget https://github.com/drush-ops/drush/archive/master.zip
unzip master.zip
cd /usr/local/bin/
ln -s ../src/drush-master/drush
mkdir /root/.drush
cp /usr/local/src/drush-master/examples/example.drushrc.php /root/.drush/drushrc.php
mkdir /var/www/.drush
cp /usr/local/src/drush-master/examples/example.drushrc.php /var/www/.drush/drushrc.php
chown -R www-data:www-data /var/www/.drush
cd /usr/local/src
aptitude install curl
curl -sS https://getcomposer.org/installer | php
  #!/usr/bin/env php
  All settings correct for using Composer
  Downloading...
  Composer successfully installed to: /usr/local/src/composer.phar
  Use it: php composer.phar
mv composer.phar /usr/local/bin/composer
aptitude install git
cd /usr/local/src/drush-master
composer install
  Loading composer repositories with package information
  Installing dependencies (including require-dev) from lock file
    - Installing d11wtq/boris (v1.0.10)
      Downloading: 100%
    - Installing pear/console_table (1.2.1)
      Downloading: 100%
    - Installing symfony/var-dumper (v2.7.1)
      Downloading: 100%
    - Installing phpdocumentor/reflection-docblock (2.0.4)
      Downloading: 100%
    - Installing phpunit/php-token-stream (1.4.3)
      Downloading: 100%
    - Installing symfony/yaml (v2.7.1)
      Downloading: 100%
    - Installing sebastian/version (1.0.6)
      Downloading: 100%
    - Installing sebastian/global-state (1.0.0)
      Downloading: 100%
    - Installing sebastian/recursion-context (1.0.0)
      Downloading: 100%
    - Installing sebastian/exporter (1.2.0)
      Downloading: 100%
    - Installing sebastian/environment (1.2.2)
      Downloading: 100%
    - Installing sebastian/diff (1.3.0)
      Downloading: 100%
    - Installing sebastian/comparator (1.1.1)
      Downloading: 100%
    - Installing phpunit/php-text-template (1.2.1)
      Downloading: 100%
    - Installing doctrine/instantiator (1.0.5)
      Downloading: 100%
    - Installing phpunit/phpunit-mock-objects (2.3.4)
      Downloading: 100%
    - Installing phpunit/php-timer (1.0.6)
      Downloading: 100%
    - Installing phpunit/php-file-iterator (1.4.0)
      Downloading: 100%
    - Installing phpunit/php-code-coverage (2.1.6)
      Downloading: 100%
    - Installing phpspec/prophecy (v1.4.1)
      Downloading: 100%
    - Installing phpunit/phpunit (4.7.5)
      Downloading: 100%
    - Installing symfony/process (v2.4.5)
      Downloading: 100%
  pear/console_table suggests installing pear/Console_Color2 (&amp;gt;=0.1.2)
  symfony/var-dumper suggests installing ext-symfony_debug ()
  phpdocumentor/reflection-docblock suggests installing dflydev/markdown (~1.0)
  phpdocumentor/reflection-docblock suggests installing erusev/parsedown (~1.0)
  sebastian/global-state suggests installing ext-uopz (*)
  phpunit/php-code-coverage suggests installing ext-xdebug (&amp;gt;=2.2.1)
  phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
  Generating autoload files
&lt;/pre&gt;&lt;h2 id="TestDrupalInstall"&gt;Test Drupal Install&lt;/h2&gt;
&lt;pre class="wiki"&gt;chown www-data:www-data /var/www/dev/
su - www-data -s /bin/bash
cd dev/
drush dl drupal
mv drupal*/* .
mv drupal*/.htaccess .
mv drupal*/.gitignore .
rmdir drupal*
drush site-install --account-name=$USERNAME --account-pass=$PASSWD_DRUPAL --account-mail=$EMAIL --site-name=$SITENAME --db-prefix=d7_ --db-url=mysql://$USERNAME:$PASSWD@localhost/$USERNAME
  You are about to create a /var/www/dev/sites/default/settings.php file and DROP all tables in your 'dev' database. Do you want to continue? (y/n): y
  Starting Drupal installation. This takes a while. Consider using the --notify global option.       [ok]
  exception 'Exception' with message 'PHP extensions: Disabled                                       [error]
  Drupal requires you to enable the PHP extensions in the following list (see the &amp;lt;a
  href="http://drupal.org/requirements"&amp;gt;system requirements page&amp;lt;/a&amp;gt; for more information):&amp;lt;div
  class="item-list"&amp;gt;&amp;lt;ul&amp;gt;&amp;lt;li class="first last"&amp;gt;gd&amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;' in /var/www/dev/includes/install.core.inc:773
aptitude install php5-gd
&lt;/pre&gt;&lt;p&gt;
I then completed the install using the web interface, the &lt;tt&gt;settings.php&lt;/tt&gt; file had to be manually edited for the certificate paths etc:
&lt;/p&gt;
&lt;pre class="wiki"&gt;$databases = array(
  'default' =&amp;gt;
  array (
    'default' =&amp;gt;
    array (
      'database' =&amp;gt; 'dev',
      'username' =&amp;gt; 'dev',
      'password' =&amp;gt; 'XXX',
      'host' =&amp;gt; 'crin1',
      'port' =&amp;gt; '',
      'driver' =&amp;gt; 'mysql',
      'prefix' =&amp;gt; '',
      'pdo' =&amp;gt; array(
           PDO::MYSQL_ATTR_SSL_KEY =&amp;gt; '/etc/ssl/cacert/crin1_yassl_privatekey.pem',
           PDO::MYSQL_ATTR_SSL_CERT =&amp;gt; '/etc/ssl/cacert/crin1_cert.pem',
           PDO::MYSQL_ATTR_SSL_CA =&amp;gt; '/etc/ssl/cacert/cacert.pem',
        ),
    ),
  ),
);
&lt;/pre&gt;&lt;p&gt;
And the site is working: &lt;a class="ext-link" href="https://dev.crin.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://dev.crin.org/&lt;/a&gt; so once the Exim configuration is in place a copy of the live site and it's database should be able to be run.
&lt;/p&gt;
&lt;p&gt;
There are still some tasks to be done, the list in &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:31" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:31&lt;/a&gt; and some others like install scripts for some of the Munin plugins.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Fri, 17 Jul 2015 23:45:52 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:37</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:37</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;1.66&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;6.53&lt;/em&gt; to &lt;em&gt;8.19&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;h2 id="Munin"&gt;Munin&lt;/h2&gt;
&lt;p&gt;
Copy scripts from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; to a new &lt;tt&gt;/var/www/localhost&lt;/tt&gt; directory:
&lt;/p&gt;
&lt;pre class="wiki"&gt;rsync -av /var/www/localhost/ crin4:/var/www/localhost/
&lt;/pre&gt;&lt;p&gt;
Enable the Nginx config:
&lt;/p&gt;
&lt;pre class="wiki"&gt;/etc/nginx/sites-enabled
ln -s ../sites-available/localhost 30-localhost
service nginx configtest
  [ ok ] Testing nginx configuration:.
service nginx restart
&lt;/pre&gt;&lt;p&gt;
Test the Munin plugins:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /etc/munin/plugins/
munin-run phpfpm_average
  php_average.value 40937472
munin-run phpfpm_connections
  accepted.value U
munin-run phpfpm_memory
  ram.value 81874944
munin-run phpfpm_processes
  php_processes.value 2
munin-run phpfpm_status
  idle.value U
  active.value U
  total.value U
&lt;/pre&gt;&lt;p&gt;
Fixing the ones outputting &lt;tt&gt;U&lt;/tt&gt;, edit &lt;tt&gt;/etc/php5/fpm/pool.d/www.conf&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;;pm.status_path = /status
pm.status_path = /status
&lt;/pre&gt;&lt;p&gt;
Restart &lt;tt&gt;php5-fpm&lt;/tt&gt; and test again:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /etc/munin/plugins/
munin-run phpfpm_connections
  accepted.value 1
munin-run phpfpm_status
  idle.value 1
  active.value 1
  total.value 2
php_opcache_memoryusage
  mem_used.value 5468264
  mem_free.value 61640600
  mem_wasted.value 0
  oom_restarts.value 0
  hash_restarts.value 0
  manual_restarts.value 0
munin-run php_opcache_restarts
  mem_used.value 5468264
  mem_free.value 61640600
  mem_wasted.value 0
  oom_restarts.value 0
  hash_restarts.value 0
  manual_restarts.value 0
munin-run memcached_bytes
  no (Cache::Memcached not found)
&lt;/pre&gt;&lt;p&gt;
Install some perl modules, see &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/10#comment:8" title="defect: Install Munin server and clients (closed: fixed)"&gt;ticket:10#comment:8&lt;/a&gt;
&lt;/p&gt;
&lt;pre class="wiki"&gt;aptitude install libcache-memcached-perl
munin-run memcached_rates
  memcache_cache_hits.value 0
  memcache_cache_misses.value 0
  memcache_cmd_get.value 0
  memcache_cmd_set.value 0
  memcache_total_connections.value 6
  memcache_total_items.value 0
munin-run memcached_bytes
  memcache_bytes_read.value 14
  memcache_bytes_written.value 1098
munin-run memcached_counters
  memcache_bytes_allocated.value 0
  memcache_curr_connections.value 5
  memcache_curr_items.value 0
&lt;/pre&gt;&lt;h2 id="Solr"&gt;Solr&lt;/h2&gt;
&lt;p&gt;
Following &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/6#comment:8" title="task: Migrate Drupal site from GreenQloud (closed: fixed)"&gt;ticket:6#comment:8&lt;/a&gt;
&lt;/p&gt;
&lt;pre class="wiki"&gt;aptitude install libsolr-java solr-tomcat solr-common
&lt;/pre&gt;&lt;p&gt;
Edit &lt;tt&gt;solr.crin4.crin.org&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;# default virtual server
server {
        # listen for ipv4
        # http://nginx.org/en/docs/http/ngx_http_core_module.html#listen
        listen   80;
        # server name and server aliases
        # http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name
        server_name solr.crin4.crin.org;
        # Prevent access to any files starting with a dot, like .htaccess
        # or text editor temp files
        location ~ /\. {
                access_log off;
                log_not_found off;
                deny all;
        }
        # Prevent access to tmp files created by vim
        location ~ .~$ {
                return 403;
        }
        # this site isn't be be indexed
        location = /robots.txt {
                root /var/www/html;
        }
        location / {
                rewrite ^/(.*)$ https://solr.crin4.crin.org/$1? permanent;
        }
}
# HTTPS server
#
server {
        #listen   4430;
        listen  443 ssl spdy;
        server_name solr.crin4.crin.org;
        access_log  /var/log/nginx/solr.crin.org.ssl_access.log;
        error_log   /var/log/nginx/solr.crin.org.ssl_error.log notice;
        ssl  on;
        ssl_certificate  /etc/ssl/cacert/crin4_cert.chained.pem;
        ssl_certificate_key  /etc/ssl/cacert/crin4_privatekey.pem;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;
        ssl_prefer_server_ciphers on;
        #add_header Strict-Transport-Security max-age=31536000;
        # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
        add_header X-Frame-Options SAMEORIGIN;
        # this site isn't be be indexed
        location = /robots.txt {
                root /var/www/html;
        }
        location / {
                proxy_set_header X-Forwarded-Host $host;
                proxy_set_header X-Forwarded-Server $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass http://127.0.0.1:8080/;
                satisfy any;
                deny all;
                auth_basic "Solr Admin";
                auth_basic_user_file /var/www/.htpasswd;
        }
}
&lt;/pre&gt;&lt;p&gt;
Enable and test:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /etc/nginx/sites-enabled
ln -s ../sites-available/solr.crin4.crin.org 20-solr.crin4.crin.org
service nginx configtest
  [ ok ] Testing nginx configuration:.
service nginx restart
&lt;/pre&gt;&lt;p&gt;
Create a username / passwd for the Solr admin interface:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /var/www/
aptitude install apache2-utils
htpasswd -c .htpasswd dev
&lt;/pre&gt;&lt;h2 id="iptablesandfail2ban"&gt;iptables and fail2ban&lt;/h2&gt;
&lt;p&gt;
Following &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/2" title="task: Set up firewall and fail2ban to stop brute force ssh attacks (closed: fixed)"&gt;ticket:2&lt;/a&gt;
&lt;/p&gt;
&lt;pre class="wiki"&gt;aptitude install iptables-persistent fail2ban
&lt;/pre&gt;&lt;p&gt;
Copy config files from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;scp /etc/iptables/rules.v4 crin4:/etc/iptables/
scp /etc/fail2ban/jail.local crin4:/etc/fail2ban/
iptables-restore &amp;lt; /etc/iptables/rules.v4
service fail2ban restart
iptables -L
  Chain INPUT (policy ACCEPT)
  target     prot opt source               destination
  fail2ban-ssh  tcp  --  anywhere             anywhere             multiport dports ssh
             all  --  anywhere             crin2
  ACCEPT     all  --  anywhere             anywhere
  REJECT     all  --  anywhere             loopback/8           reject-with icmp-port-unreachable
  ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
  ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
  ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https
  ACCEPT     tcp  --  crin1                anywhere             tcp dpt:munin
  DROP       tcp  --  anywhere             anywhere             tcp dpt:munin
  ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ssh
  ACCEPT     icmp --  anywhere             anywhere             icmp echo-request
  LOG        all  --  anywhere             anywhere             limit: avg 5/min burst 5 LOG level debug prefix "iptables denied: "
  REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable
  Chain FORWARD (policy ACCEPT)
  target     prot opt source               destination
  REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable
  Chain OUTPUT (policy ACCEPT)
  target     prot opt source               destination
             all  --  crin2                anywhere
  ACCEPT     all  --  anywhere             anywhere
  Chain fail2ban-ssh (1 references)
  target     prot opt source               destination
  RETURN     all  --  anywhere             anywhere
&lt;/pre&gt;&lt;h2 id="Munin1"&gt;Munin&lt;/h2&gt;
&lt;p&gt;
Checked all the graphs and everything is working: &lt;a class="ext-link" href="https://munin.crin.org/munin/crin.org/crin4.crin.org/index.html"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://munin.crin.org/munin/crin.org/crin4.crin.org/index.html&lt;/a&gt;
&lt;/p&gt;
&lt;h2 id="Nginx"&gt;Nginx&lt;/h2&gt;
&lt;p&gt;
Configure Enoc, &lt;tt&gt;/etc/nginx/sites-available/enoc.dev.crin.org&lt;/tt&gt; and &lt;tt&gt;/etc/nginx/sites-available/enoc.stage.crin.org&lt;/tt&gt;, the DNS will need setting up for these.
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="http://enoc.dev.crin.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://enoc.dev.crin.org/&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;&lt;a class="ext-link" href="http://enoc.stage.crin.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://enoc.stage.crin.org/&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
Setting up a reverse proxy so files don't have to be copied across, this should still work with locally uploaded files as it first tries for a local files and then does a reverse proxy if it is not found:
&lt;/p&gt;
&lt;pre class="wiki"&gt;        # reverse proxy for files
        location /sites/default/files {
                try_files   $uri @proxy_to_live;
        }
        location @proxy_to_live {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_redirect off;
                proxy_pass   http://www.crin.org$uri;
        }
&lt;/pre&gt;&lt;p&gt;
This failed with the following in the Nginx log:
&lt;/p&gt;
&lt;pre class="wiki"&gt;2015/07/17 23:24:06 [error] 12969#0: *1 no resolver defined to resolve www.crin.org, client: XX.XX.XX.XX, server: dev.crin.org, request: "GET /sites/default/files/what_we_do.jpg HTTP/1.1", host: "dev.crin.org"
&lt;/pre&gt;&lt;p&gt;
The answer was to add a DNS server to &lt;tt&gt;/etc/nginx/nginx.conf&lt;/tt&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;        resolver 93.95.224.28;
&lt;/pre&gt;&lt;p&gt;
And now we have a file reversed proxied and a local file:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="https://dev.crin.org/sites/default/files/what_we_do.jpg"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://dev.crin.org/sites/default/files/what_we_do.jpg&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;&lt;a class="ext-link" href="https://dev.crin.org/sites/default/files/logo.gif"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://dev.crin.org/sites/default/files/logo.gif&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
So that means the issue flagged up in &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#comment:32" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#comment:32&lt;/a&gt; is resolved -- &lt;tt&gt;sites/default/files&lt;/tt&gt; doesn't need to be copied for each site.
&lt;/p&gt;
&lt;p&gt;
The &lt;tt&gt;dev.crin.org&lt;/tt&gt; was copied to &lt;tt&gt;stage.crin.org&lt;/tt&gt; and edited, &lt;tt&gt;s/dev/stage/&lt;/tt&gt; and &lt;tt&gt;s/ default_server//&lt;/tt&gt; and enabled:
&lt;/p&gt;
&lt;pre class="wiki"&gt;mkdir /var/www/stage
cd /etc/nginx/sites-enabled
ln -s ../sites-available/stage.crin.org 05-stage.crin.org
service nginx configtest
  [ ok ] Testing nginx configuration:.
service nginx restart
&lt;/pre&gt;&lt;p&gt;
And although there is no test Drupal install the reverse proxy is fine:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="https://stage.crin.org/sites/default/files/what_we_do.jpg"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://stage.crin.org/sites/default/files/what_we_do.jpg&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
That means that the only big task left for me, I think, is documenting how the server is set up at &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Tasks for Code Positive:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Exim config
&lt;/li&gt;&lt;li&gt;Solr, I haven't done anything to the files in &lt;tt&gt;/etc/solr/&lt;/tt&gt; -- you should probably start by copying the files from &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Sun, 19 Jul 2015 19:04:33 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:38</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:38</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;1&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;8.19&lt;/em&gt; to &lt;em&gt;9.19&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;h2 id="Drupalstags.crin.org"&gt;Drupal stags.crin.org&lt;/h2&gt;
&lt;p&gt;
Test Drupal install for &lt;a class="ext-link" href="https://stage.crin.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://stage.crin.org/&lt;/a&gt;
&lt;/p&gt;
&lt;pre class="wiki"&gt;sudo -i
chown www-data:www-data /var/www/stage/ -R
su - www-data -s /bin/bash
cd stage
drush dl drupal
mv drupal*/* .
mv drupal*/.htaccess .
mv drupal*/.gitignore .
rmdir drupal*
drush site-install --account-name=$USERNAME --account-pass=$PASSWD_DRUPAL --account-mail=$EMAIL --site-name=$SITENAME --db-prefix=d7_ --db-url=mysql://$USERNAME:$PASSWD@localhost/$USERNAME
&lt;/pre&gt;&lt;p&gt;
Again the &lt;tt&gt;settings.php&lt;/tt&gt; file needed manually editing as per &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/23#TestDrupalInstall" title="defect: Development and staging environment (closed: fixed)"&gt;ticket:23#TestDrupalInstall&lt;/a&gt;
&lt;/p&gt;
&lt;h2 id="Documentation"&gt;Documentation&lt;/h2&gt;
&lt;p&gt;
I have made a start at documenting the server at &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt; and I think it is read for Code Positive to do some work on it:
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;There are &lt;a class="ext-link" href="https://dev.crin.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://dev.crin.org/&lt;/a&gt; and ​&lt;a class="ext-link" href="https://stage.crin.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://stage.crin.org/&lt;/a&gt; sites set up with a default Drupal 7 install, once Exim has been configured these can be replaced with copies of the site (backup the &lt;tt&gt;settings.php&lt;/tt&gt; file first). If you want to test these sites use drush to generate a login, &lt;tt&gt;cd /var/www/dev ; drush uli&lt;/tt&gt;.
&lt;/li&gt;&lt;li&gt;Note that &lt;tt&gt;sites/default/files&lt;/tt&gt; shouldn't be copied onto &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt; as there isn't disk space for it, Ngnix reverse proxies this path to the live server is a file isn't found locally.
&lt;/li&gt;&lt;li&gt;Solr hasn't been configured, but it is installed.
&lt;/li&gt;&lt;li&gt;Exim hasn't been configured, but it is installed.
&lt;/li&gt;&lt;li&gt;It would be easiest to copy the database on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; as the root user has root access to MySQL, there isn't (intentionally) root MySQL access to the live MySQL server from the dev server.
&lt;/li&gt;&lt;li&gt;The live servers, &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt; and &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; have ssh access to &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt; but not the other way around.
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
Let me know if anything else needs doing.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Sun, 19 Jul 2015 19:17:40 GMT</pubDate>
      <title>component changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:39</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:39</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;component&lt;/strong&gt;
                changed from &lt;em&gt;drupal&lt;/em&gt; to &lt;em&gt;crin4&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 20 Jul 2015 10:25:30 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:40</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:40</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.15&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;9.19&lt;/em&gt; to &lt;em&gt;9.34&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
I omitted to &lt;tt&gt;chown mori:mori /home/mori/.ssh/authorized_keys&lt;/tt&gt; so &lt;tt&gt;ssh&lt;/tt&gt; access wasn't working, this has been fixed for &lt;tt&gt;mori&lt;/tt&gt; and &lt;tt&gt;peter&lt;/tt&gt; and I have updated the documentation at &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4#sshaccess"&gt;wiki:Crin4#sshaccess&lt;/a&gt;.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>mori</dc:creator>

      <pubDate>Mon, 20 Jul 2015 11:26:18 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:41</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:41</guid>
      <description>
        &lt;p&gt;
Hi Chris,
&lt;/p&gt;
&lt;p&gt;
We are changing the directory structure of the code to fulfil our requirements around deployment and maintenance. As a result, the nginx config needs to be updated to accommodate this change:
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Current structure:&lt;/strong&gt;
Prod: &lt;tt&gt;/var/www/drupal/&lt;/tt&gt;
Dev / Stage: &lt;tt&gt;/var/www/[dev|stage]/&lt;/tt&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;New structure&lt;/strong&gt;
Prod: &lt;tt&gt;/var/www/drupal/docroot}/&lt;/tt&gt;
Dev / Stage: &lt;tt&gt;/var/www/[dev|stage]/docroot/&lt;/tt&gt;
&lt;/p&gt;
&lt;p&gt;
Can you please make the above changes?
&lt;/p&gt;
&lt;p&gt;
Also for consistency, can you rename the prod's webroot name from 'drupal' to 'prod'?
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 20 Jul 2015 11:55:38 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:42</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:42</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.3&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;9.34&lt;/em&gt; to &lt;em&gt;9.64&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Updating the directory structure on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
We don't need the site to be available at &lt;a class="ext-link" href="https://crin2.crin.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://crin2.crin.org/&lt;/a&gt; so remove this site:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /etc/nginx/sites-enabled
rm 10-crin2.crin.org.conf
&lt;/pre&gt;&lt;p&gt;
Edit &lt;tt&gt;/etc/nginx/sites-available/drin.org&lt;/tt&gt; and &lt;tt&gt;/etc/nginx/sites-available/enoc.crin.org&lt;/tt&gt;changing:
&lt;/p&gt;
&lt;pre class="wiki"&gt;1,$s;/drupal;/drupal/docroot;gc
&lt;/pre&gt;&lt;p&gt;
Stop Nginx and move the site:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /var/www/
mkdir prod
service nginx stop
mv drupal/ prod/docroot/
service nginx start
service php5-fpm restart
service memcached restart
&lt;/pre&gt;&lt;p&gt;
There is a problem with this, most pages on the live site are now 404's and I don't know why, eg:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="https://www.crin.org/en/home/what-we-do"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://www.crin.org/en/home/what-we-do&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
So I think I'll have to undo these changes if I can't find the answer quickly.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 20 Jul 2015 11:58:12 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:43</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:43</guid>
      <description>
        &lt;p&gt;
Fixed.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jenny</dc:creator>

      <pubDate>Mon, 20 Jul 2015 12:00:10 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:44</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:44</guid>
      <description>
        &lt;pre class="wiki"&gt;Hi guys,
Our website isn't working. It's coming up with the message file not found.
Is this connected to work you are doing?
Thanks.
Jenny
Sent from my iPhone
&amp;gt; On 20 Jul 2015, at 12:26, CRIN Trac &amp;lt;trac@trac.crin.org&amp;gt; wrote:
&amp;gt;
&amp;gt; #23: Development and staging environment
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt;                 Reporter:  chris   |                Owner:  chris
&amp;gt;                     Type:  defect  |               Status:  accepted
&amp;gt;                 Priority:  major   |            Milestone:  Maintenance
&amp;gt;                Component:  crin4   |              Version:
&amp;gt;               Resolution:          |             Keywords:
&amp;gt; Estimated Number of Hours:  0       |  Add Hours to Ticket:  0
&amp;gt;                Billable?:  1       |          Total Hours:  9.34
&amp;gt; ------------------------------------+-----------------------------------
&amp;gt;
&amp;gt; Comment (by mori):
&amp;gt;
&amp;gt; Hi Chris,
&amp;gt;
&amp;gt; We are changing the directory structure of the code to fulfil our
&amp;gt; requirements around deployment and maintenance. As a result, the nginx
&amp;gt; config needs to be updated to accommodate this change:
&amp;gt;
&amp;gt; '''Current structure:'''
&amp;gt; Prod: {{{/var/www/drupal/}}}
&amp;gt; Dev / Stage: {{{/var/www/[dev|stage]/}}}
&amp;gt;
&amp;gt;
&amp;gt; '''New structure'''
&amp;gt; Prod: {{{/var/www/drupal/docroot}/}}}
&amp;gt; Dev / Stage: {{{/var/www/[dev|stage]/docroot/}}}
&amp;gt;
&amp;gt;
&amp;gt; Can you please make the above changes?
&amp;gt;
&amp;gt; Also for consistency, can you rename the prod's webroot name from 'drupal'
&amp;gt; to 'prod'?
&amp;gt;
&amp;gt; --
&amp;gt; Ticket URL: &amp;lt;https://trac.crin.org/trac/ticket/23#comment:41&amp;gt;
&amp;gt; CRIN Trac &amp;lt;https://trac.crin.org/trac&amp;gt;
&amp;gt; Trac project for CRIN website and servers.
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 20 Jul 2015 12:09:57 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:45</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:45</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.25&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;9.64&lt;/em&gt; to &lt;em&gt;9.89&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Sorry for the brief downtime, it is now fixed and the live site has been tested.
&lt;/p&gt;
&lt;p&gt;
This regex was wrong:
&lt;/p&gt;
&lt;pre class="wiki"&gt;1,$s;/drupal;/drupal/docroot;gc
&lt;/pre&gt;&lt;p&gt;
It should have been:
&lt;/p&gt;
&lt;pre class="wiki"&gt;1,$s;/drupal;/prod/docroot;gc
&lt;/pre&gt;&lt;p&gt;
On &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /var/www
mv dev docroot
mkdir dev
mv docroot/ dev/
mv stage/ docroot
mkdir stage
mv docroot/ stage/
&lt;/pre&gt;&lt;p&gt;
Edit the Ngnix config and restart services, test the sites:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="https://dev.crin.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://dev.crin.org/&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;&lt;a class="ext-link" href="https://stage.crin.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://stage.crin.org/&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>mori</dc:creator>

      <pubDate>Mon, 20 Jul 2015 12:18:52 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:46</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:46</guid>
      <description>
        &lt;p&gt;
Hi Chris, please install &lt;tt&gt;screen&lt;/tt&gt; on Crin4. Thanks in advance for your help.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 20 Jul 2015 12:29:17 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:47</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:47</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.05&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;9.89&lt;/em&gt; to &lt;em&gt;9.94&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:46" title="Comment 46"&gt;mori&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
please install &lt;tt&gt;screen&lt;/tt&gt; on Crin4.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Done.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>mori</dc:creator>

      <pubDate>Mon, 20 Jul 2015 13:52:21 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:48</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:48</guid>
      <description>
        &lt;p&gt;
Hi Chris, do you have admin access to CRIN's bitbucket account (&lt;a class="ext-link" href="https://bitbucket.org/crin"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://bitbucket.org/crin&lt;/a&gt; ) by any chance? If you don't, never mind. If you do, I would like a deployment key to be added to the Bitbucket account. (The origin of the repository cloned on Crin2 is not what we'll be using moving forward.)
&lt;/p&gt;
&lt;p&gt;
Also I've created a user 'bitbucket' on Crin2 and am planning to grant the user read-only access to the repo. If you have alternative suggestions please let me know.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Mon, 20 Jul 2015 14:33:38 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:49</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:49</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.04&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;9.94&lt;/em&gt; to &lt;em&gt;9.98&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:48" title="Comment 48"&gt;mori&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
do you have admin access to CRIN's bitbucket account (&lt;a class="ext-link" href="https://bitbucket.org/crin"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://bitbucket.org/crin&lt;/a&gt; ) by any chance?
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
I'm afraid not, I didn't even know it existed.
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
Also I've created a user 'bitbucket' on Crin2 and am planning to grant the user read-only access to the repo. If you have alternative suggestions please let me know.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Sounds fine.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>mori</dc:creator>

      <pubDate>Mon, 20 Jul 2015 21:25:56 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:50</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:50</guid>
      <description>
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:22" title="Comment 22"&gt;chris&lt;/a&gt;:
&lt;/p&gt;
&lt;p&gt;
I've added 'env.php' to all three environments to check if the env vars are working. Unfortunately it doesn't seem like they are working. Can you please check the setting? Or is there anything wrong with my code?
&lt;/p&gt;
&lt;p&gt;
The file can be found at: &lt;tt&gt;/var/www/[environment]/docroot/env.php&lt;/tt&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 21 Jul 2015 10:17:37 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:51</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:51</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.25&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;9.98&lt;/em&gt; to &lt;em&gt;10.23&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:50" title="Comment 50"&gt;mori&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
Or is there anything wrong with my code?
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
You had &lt;tt&gt;ENV_VAR&lt;/tt&gt; not &lt;tt&gt;SITE_ENV&lt;/tt&gt;, I have edited the dev file:
&lt;/p&gt;
&lt;pre class="wiki"&gt;&amp;lt;?php
if (!empty($_SERVER['ENV_VAR'])) {
  print 'environment: ' . $_SERVER['ENV_VAR'];
}
else {
  print 'not defined';
}
echo ' &amp;lt;p&amp;gt;Server: ' . $_SERVER["SITE_ENV"] . '&amp;lt;/p&amp;gt;' ;
//phpinfo();
?&amp;gt;
&lt;/pre&gt;&lt;p&gt;
Results here:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="https://dev.crin.org/env.php"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://dev.crin.org/env.php&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
I debugged it via &lt;tt&gt;phpinfo();&lt;/tt&gt;.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>mori</dc:creator>

      <pubDate>Tue, 21 Jul 2015 11:22:31 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/23#comment:52</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:52</guid>
      <description>
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:51" title="Comment 51"&gt;chris&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
You had ENV_VAR not SITE_ENV
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Ah, of course... Thanks Chris.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 21 Jul 2015 11:25:47 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:53</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:53</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.03&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;10.23&lt;/em&gt; to &lt;em&gt;10.26&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Replying to &lt;a class="ticket" href="https://trac.crin.org/trac/ticket/23#comment:52" title="Comment 52"&gt;mori&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote class="citation"&gt;
&lt;p&gt;
Thanks Chris.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
No problem, I have also linked the comments about this from the wiki page: &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4#Envvars"&gt;wiki:Crin4#Envvars&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Thu, 07 Jan 2016 12:14:21 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>https://trac.crin.org/trac/ticket/23#comment:54</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/23#comment:54</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;accepted&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>