<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CRIN Trac: Ticket #31: Preparation for deployment to new prod</title>
    <link>https://trac.crin.org/trac/ticket/31</link>
    <description>&lt;p&gt;
Hi Chris,
&lt;/p&gt;
&lt;p&gt;
In order to run the CRIN production site under the new codebase, we need to go through a number of steps to set up and test the site. We need your help to accomplish this.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Overview:&lt;/strong&gt; (please execute each step once we request you to do so through the comment)
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Chris to create a new entry for the new prod site on CRIN2
&lt;/li&gt;&lt;li&gt;Chris to create a new database for the new prod site on CRIN1
&lt;/li&gt;&lt;li&gt;Code+ and CRIN to test the new prod site and sign off
&lt;/li&gt;&lt;li&gt;Chris to update the nginx config so the new prod serves as the working prod
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
&lt;strong&gt;Rationale of the go-live process&lt;/strong&gt;
Because of the reasons listed below, deploying the new code to the existing prod results in an extended period of downtime:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;repository too large: cloning takes 10+ minutes
&lt;/li&gt;&lt;li&gt;changes to directory structure requires the registry to be rebuilt
&lt;/li&gt;&lt;li&gt;the new deployment process needs testing
&lt;/li&gt;&lt;/ul&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/31</link>
    </image>
    <generator>Trac 1.0.2</generator>
    <item>
      
        <dc:creator>mori</dc:creator>

      <pubDate>Mon, 10 Aug 2015 15:37:52 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/31#comment:1</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/31#comment:1</guid>
      <description>
        &lt;p&gt;
Hi Chris,
&lt;/p&gt;
&lt;p&gt;
Can you please start with the first two items in the list
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;'Chris to create a new entry for the new prod site on CRIN2'
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
I've checked out the new codebase under  &lt;tt&gt;/var/www/newprod/docroot&lt;/tt&gt;. Please use it as the docroot of the new prod. The site should be accessible via &lt;tt&gt;newprod.crin.org&lt;/tt&gt;
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Chris to create a new database for the new prod site on CRIN1
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
Please create a new database &lt;tt&gt;newprod&lt;/tt&gt;, along with a new user and its password. Can you create a file in CRIN4:/home/mori/ and store the username and password in there?
&lt;/p&gt;
&lt;p&gt;
Thanks,
&lt;/p&gt;
&lt;p&gt;
Mori
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 11 Aug 2015 10:01:13 GMT</pubDate>
      <title>hours changed; totalhours set</title>
      <link>https://trac.crin.org/trac/ticket/31#comment:2</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/31#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.65&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                set to &lt;em&gt;0.65&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Sounds like a very sensible set of steps.
&lt;/p&gt;
&lt;p&gt;
Creating the database on &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;mysql&amp;gt; CREATE DATABASE newprod;
mysql&amp;gt; GRANT ALL ON newprod.* to 'newprod'@'crin2' identified by 'XXX' REQUIRE SSL;
mysql&amp;gt; FLUSH PRIVILEGES;
&lt;/pre&gt;&lt;p&gt;
Test the MySQL database and user 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;mysql -unewprod -p -hcrin1 newprod
&lt;/pre&gt;&lt;p&gt;
That works fine. DB details saved to &lt;tt&gt;/home/mori/newprod.txt&lt;/tt&gt; on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Creating the directory 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;mkdir -p /var/www/newprod/docroot/
&lt;/pre&gt;&lt;p&gt;
Copy live Nginx config:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /etc/nginx/sites-available
cp crin.org newprod.crin.org
&lt;/pre&gt;&lt;p&gt;
Change these lines for the port 80 config:
&lt;/p&gt;
&lt;pre class="wiki"&gt;        listen 80;
        #listen 80 default_server;
        #server_name www.crin.org;
        server_name newprod.crin.org;
        root /var/www/newprod/docroot;
        access_log /var/log/nginx/newprod.crin.org.access.log;
        error_log  /var/log/nginx/newprod.crin.org.error.log info;
        # login redirect
        location ~ /user {
                #rewrite ^/(.*)$ https://www.crin.org/$1? permanent;
                rewrite ^/(.*)$ https://newprod.crin.org/$1? permanent;
                #rewrite ^/(.*)$ https://$server_name/$1? permanent;
                #rewrite ^/(.*)$ https://crin.web1.crin.webarch.net/$1? permanent;
        }
#server {
#       listen 80;
#        server_name crin.org;
#
#        access_log /var/log/nginx/crin.org.access.log;
#        error_log  /var/log/nginx/crin.org.error.log info;
#
#        location / {
#               return      301 http://www.crin.org$request_uri;
#       }
#
#}
&lt;/pre&gt;&lt;p&gt;
And these for port 443:
&lt;/p&gt;
&lt;pre class="wiki"&gt;        #listen 443 ssl spdy default_server;
        listen 443 ssl spdy;
        server_name newprod.crin.org;
        #server_name www.crin.org;
        root /var/www/newprod/docroot;
        access_log /var/log/nginx/newprod.crin.org.ssl_access.log;
        error_log  /var/log/nginx/newprod.crin.org.ssl_error.log info;
#server {
#       listen 443 ssl spdy;
#        server_name crin.org;
#       return      301 https://www.crin.org$request_uri;
#        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/web1.crin.webarch.net.chained.pem;
#        #ssl_certificate_key  /etc/ssl/cacert/web1.crin.webarch.net.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;
#}
&lt;/pre&gt;&lt;p&gt;
Enable new config:
&lt;/p&gt;
&lt;pre class="wiki"&gt;cd /etc/nginx/sites-enabled
ln -s ../sites-available/newprod.crin.org 01-newprod.crin.org
&lt;/pre&gt;&lt;p&gt;
Test:
&lt;/p&gt;
&lt;pre class="wiki"&gt;service nginx configtest
Testing nginx configuration:.
&lt;/pre&gt;&lt;p&gt;
Add the new DNS entry.
&lt;/p&gt;
&lt;pre class="wiki"&gt;newprod 900 IN A 93.95.228.180
&lt;/pre&gt;&lt;p&gt;
This will take some time to propagate.
&lt;/p&gt;
&lt;p&gt;
Restart services 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;service nginx restart
service php5-fpm restart
&lt;/pre&gt;&lt;p&gt;
I think that is everything I need to do for the first two steps?
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>mori</dc:creator>

      <pubDate>Tue, 11 Aug 2015 15:24:25 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/31#comment:3</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/31#comment:3</guid>
      <description>
        &lt;p&gt;
Thanks Chris.
&lt;/p&gt;
&lt;p&gt;
Can you please add a new env var 'newprod' as well, if you haven't already?
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 11 Aug 2015 18:45:05 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/31#comment:4</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/31#comment:4</guid>
      <description>
        &lt;pre class="wiki"&gt;On Tue 11-Aug-2015 at 03:24:26PM -0000, CRIN Trac wrote:
&amp;gt;
&amp;gt;  Can you please add a new env var 'newprod' as well, if you haven't
&amp;gt;  already?
Have done now, sorry to have missed that earlier.
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Thu, 07 Jan 2016 12:13:48 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>https://trac.crin.org/trac/ticket/31#comment:5</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/31#comment:5</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&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>