Ticket #691 (closed task: fixed)

Opened 3 years ago

Last modified 2 years ago

Upgrade Wagn hosting for patterns site

Reported by: chris Owned by: chris
Priority: major Milestone: Maintenance
Component: Wagn Keywords:
Cc: ed Estimated Number of Hours: 0.0
Add Hours to Ticket: 0 Billable?: yes
Total Hours: 10.1

Description (last modified by chris) (diff)

The http://patterns.transitionresearchnetwork.org/ site is running using a development set up and the webrick server falls over every now and then, so the plan is to upgrade to a production style setup.

References:

Change History

comment:1 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 2.0
  • Status changed from new to accepted
  • Description modified (diff)
  • Total Hours changed from 0.0 to 2.0

The instructions at:

Are for Apache, this pages is linked for non-Apache servers:

And that page links to:

Which redirects to:

And from there the instructions can be found:

Following these instructions:

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
  Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.C1h2y7GLRv --trustdb-name /etc/apt//trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-squeeze-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-squeeze-stable.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-wheezy-automatic.gpg --keyring /etc/apt/trusted.gpg.d//debian-archive-wheezy-stable.gpg --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
  gpg: requesting key AC40B2F7 from hkp server keyserver.ubuntu.com
  gpg: key AC40B2F7: public key "Phusion Automated Software Signing (Used by automated tools to sign software packages) <auto-software-signing@phusion.nl>" imported
  gpg: no ultimately trusted keys found
  gpg: Total number processed: 1
  gpg:               imported: 1  (RSA: 1)
apt-get install apt-transport-https ca-certificates
  The following NEW packages will be installed:
    apt-transport-https

Then /etc/apt/sources.list.d/passenger.list was created, containing:

# http://www.modrails.com/documentation/Users%20guide%20Nginx.html#install_on_debian_ubuntu
# /trac/ticket/691
# Debian 7
deb https://oss-binaries.phusionpassenger.com/apt/passenger wheezy main

Then:

chown root:root /etc/apt/sources.list.d/passenger.list
chmod 600 /etc/apt/sources.list.d/passenger.list

Check that we are running nginx-extras:

aptitude search nginx | grep ^i
  i   nginx                           - small, powerful, scalable web/proxy server
  i   nginx-common                    - small, powerful, scalable web/proxy server
  i   nginx-full                      - nginx web/proxy server (standard version) 

We are not so:

aptitude install nginx-extras 
  The following NEW packages will be installed:
    nginx-extras{b} 
  0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  Need to get 601 kB of archives. After unpacking 1347 kB will be used.
  The following packages have unmet dependencies:
   nginx-full : Conflicts: nginx-extras but 1.2.1-2.2+wheezy2 is to be installed.
   nginx-extras : Depends: nginx-common (= 1.2.1-2.2+wheezy2) but 1.4.4-1~bpo70+1 is installed.
                  Depends: liblua5.1-0 but it is not going to be installed.
                  Depends: libperl5.14 (>= 5.14.2) but it is not going to be installed.
                  Conflicts: nginx-full but 1.4.4-1~bpo70+1 is installed.
  The following actions will resolve these dependencies:
  
       Keep the following packages at their current version:
  1)     nginx-extras [Not Installed]                       
  
  Accept this solution? [Y/n/q/?] n
  The following actions will resolve these dependencies:
  
       Remove the following packages:                                                        
  1)     nginx                                                                               
  2)     nginx-full                                                                          
  
       Install the following packages:                                                       
  3)     liblua5.1-0 [5.1.5-4 (stable)]                                                      
  4)     libperl5.14 [5.14.2-21+deb7u1 (stable)]                                             
  
       Downgrade the following packages:                                                     
  5)     nginx-common [1.4.4-1~bpo70+1 (now, wheezy-backports) -> 1.2.1-2.2+wheezy2 (stable)]

Oh dear...

We want to install this package:

So /etc/apt/preferences.d/backports.pref was edited to add nginx-extras:

Package: nginx nginx-common nginx-full nginx-extras
Pin: release o=backports
Pin-Priority: 990

And then:

aptitude update; aptitude install nginx-extras
  The following NEW packages will be installed:
    nginx-extras{b} 
  The following packages are RECOMMENDED but will NOT be installed:
    passenger 
  0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  Need to get 1009 kB of archives. After unpacking 2592 kB will be used.
  The following packages have unmet dependencies:
   nginx-full : Conflicts: nginx-extras but 1:1.4.4-2.4.0.37~wheezy1 is to be installed.
   nginx-extras : Depends: nginx-common (= 1:1.4.4-2.4.0.37~wheezy1) but 1.4.4-1~bpo70+1 is installed.
                  Depends: liblua5.1-0 but it is not going to be installed.
                  Depends: libperl5.14 (>= 5.14.2) but it is not going to be installed.
                  Conflicts: nginx-full but 1.4.4-1~bpo70+1 is installed.
  The following actions will resolve these dependencies:
  
       Keep the following packages at their current version:
  1)     nginx-extras [Not Installed]                       
  

That isn't exactly what we want, so:

aptitude install liblua5.1-0 libperl5.14  

Try again:

aptitude install nginx-extras
The following NEW packages will be installed:
  nginx-extras{b} 
The following packages are RECOMMENDED but will NOT be installed:
  passenger 
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1009 kB of archives. After unpacking 2592 kB will be used.
The following packages have unmet dependencies:
 nginx-full : Conflicts: nginx-extras but 1:1.4.4-2.4.0.37~wheezy1 is to be installed.
 nginx-extras : Depends: nginx-common (= 1:1.4.4-2.4.0.37~wheezy1) but 1.4.4-1~bpo70+1 is installed.
                Conflicts: nginx-full but 1.4.4-1~bpo70+1 is installed.
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     nginx-extras [Not Installed]                       

But we want nginx-extras (1.4.4-1~bpo70+1) so:

install nginx-extras=1.4.4-1~bpo70+1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  nginx-doc
The following packages will be REMOVED:
  nginx nginx-full
The following NEW packages will be installed:
  nginx-extras
0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
Need to get 664 kB of archives.
After this operation, 391 kB of additional disk space will be used.
Do you want to continue [Y/n]? 

That's more like it!

Install and restart Nginx:

/etc/init.d/nginx start
  [ ok ] Starting nginx: nginx.

Now back to the instructions and:

aptitude install passenger
  The following NEW packages will be installed:
    crash-watch{a} gdb{a} gdbserver{a} libcurl3{a} libev4{a} libpython2.7{a} passenger passenger-dev{a} 
    passenger-doc{a} ruby-daemon-controller{a} ruby-rack{a} 
  0 packages upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
  Need to get 12.5 MB of archives. After unpacking 51.1 MB will be used.

This created /etc/nginx/nginx.conf.dpkg-dist, so comparing this with the live config:

cd /etc/nginx
diff nginx.conf nginx.conf.dpkg-dist | vim -
  3c3
  < pid /var/run/nginx.pid;
  ---
  > pid /run/nginx.pid;
  19c19
  <       keepalive_timeout 240;
  ---
  >       keepalive_timeout 65;
  23,24d22
  <       # needed for the redirects
  <       server_names_hash_max_size 2048;
  29,32c27
  <       #default_type application/octet-stream;
  <       #default_type text/plain; 
  <         default_type text/html;
  <         charset utf-8;
  ---
  >       default_type application/octet-stream;
  41,51c36,56
  <       # geoip
  <       # http://piwik.org/faq/how-to/#faq_166
  <       geoip_country  /etc/nginx/geoip/GeoIP.dat;
  <       geoip_city     /etc/nginx/geoip/GeoIPCity.dat;
  < 
  <         # ssl
  <       ssl_session_cache shared:SSL:10m;
  < 
  <       ## FastCGI cache zone definition.
  <       # https://github.com/perusio/piwik-nginx
  <       include fastcgi_cache_zone.conf;
  ---
  >       ##
  >       # Gzip Settings
  >       ##
  > 
  >       gzip on;
  >       gzip_disable "msie6";
  > 
  >       # gzip_vary on;
  >       # gzip_proxied any;
  >       # gzip_comp_level 6;
  >       # gzip_buffers 16 8k;
  >       # gzip_http_version 1.1;
  >       # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  > 
  >       ##
  >       # nginx-naxsi config
  >       ##
  >       # Uncomment it if you installed nginx-naxsi
  >       ##
  > 
  >       #include /etc/nginx/naxsi_core.rules;
  53,54c58,65
  <       ## Include the cache map to decide when or not when to cache.
  <       include map_cache_piwik.conf;
  ---
  >       ##
  >       # nginx-passenger config
  >       ##
  >       # Uncomment it if you installed nginx-passenger
  >       ##
  >       
  >       #passenger_root /usr;
  >       #passenger_ruby /usr/bin/ruby;


The key differences here are:

>       #passenger_root /usr;
>       #passenger_ruby /usr/bin/ruby;

So these lines were added and Ngnix restarted and to see that passanger is running:

passenger-memory-stats
  Version: 4.0.37
  Date   : 2014-03-03 13:26:04 +0000
  ------------- Apache processes -------------
  *** WARNING: The Apache executable cannot be found.
  Please set the APXS2 environment variable to your 'apxs2' executable's filename, or set the HTTPD environment variable to your 'httpd' or 'apache2' executable's filename.
  
  
  ---------- Nginx processes -----------
  PID    PPID   VMSize    Private  Name
  --------------------------------------
  25430  1      158.3 MB  0.2 MB   nginx: master process /usr/sbin/nginx
  25433  25430  158.3 MB  1.5 MB   nginx: worker process
  25436  25430  158.3 MB  1.3 MB   nginx: worker process
  25440  25430  158.3 MB  1.1 MB   nginx: worker process
  25443  25430  158.3 MB  0.5 MB   nginx: worker process
  ### Processes: 5
  ### Total private dirty RSS: 4.67 MB
  
  
  --- Passenger processes ---
  
  ### Processes: 0
  ### Total private dirty RSS: 0.00 MB

According to the instructions:

You should see the web server processes as well as a number of Phusion Passenger processes (e.g. PassengerWatchdog, PassengerHelperAgent).

But we don't... so, looking at:

The first suggestion is to check the /var/log/nginx/error.log and we have this in it:

2014/03/03 13:25:26 [emerg] 27589#0: unknown directive "passenger_root" in /etc/nginx/nginx.conf:70

One suggestion is to delete all the ngnix config and reinstall:

Also:

I think the issues might be cause by the fact that we are running Ngnix from backports, for now I have commented out these directoves:

        #passenger_root /usr;
        #passenger_ruby /usr/bin/ruby;

Switching to the Wheezy version of Nginx (1.2 rather than 1.4, so we will lose things like spdy.

mv /etc/apt/preferences.d/backports.pref /etc/apt/backports.pref.bak
mv /etc/apt/sources.list.d/backports.list /etc/apt/backports.list.bak
aptitude update
apt-get install nginx-extras=1.2.1-2.2+wheezy2 nginx-common=1.2.1-2.2+wheezy2
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  The following package was automatically installed and is no longer required:
    init-system-helpers
  Use 'apt-get autoremove' to remove it.
  The following packages will be DOWNGRADED:
    nginx-common nginx-extras
  0 upgraded, 0 newly installed, 2 downgraded, 0 to remove and 0 not upgraded.
  Need to get 675 kB of archives.
  After this operation, 145 kB disk space will be freed.

  Configuration file `/etc/nginx/nginx.conf'
   ==> Modified (by you or by a script) since installation.
   ==> Package distributor has shipped an updated version.
     What would you like to do about it ?  Your options are:
      Y or I  : install the package maintainer's version
      N or O  : keep your currently-installed version
        D     : show the differences between the versions
        Z     : start a shell to examine the situation
   The default action is to keep your current version.
  *** nginx.conf (Y/I/N/O/D/Z) [default=N] ? N

  Configuration file `/etc/nginx/fastcgi_params'
   ==> Modified (by you or by a script) since installation.
   ==> Package distributor has shipped an updated version.
     What would you like to do about it ?  Your options are:
      Y or I  : install the package maintainer's version
      N or O  : keep your currently-installed version
        D     : show the differences between the versions
        Z     : start a shell to examine the situation
   The default action is to keep your current version.
  *** fastcgi_params (Y/I/N/O/D/Z) [default=N] ? N

On restarting Nginx we have these errors in the logs:

2014/03/03 14:11:28 [alert] 768#0: epoll_ctl(1, 0) failed (1: Operation not permitted)
2014/03/03 14:11:28 [alert] 768#0: failed to register channel handler while initializing push module worker (1: Operation not permitted)
2014/03/03 14:11:28 [alert] 763#0: cache manager process 768 exited with fatal code 2 and cannot be respawned
2014/03/03 14:11:28 [alert] 769#0: epoll_ctl(1, 0) failed (1: Operation not permitted)
2014/03/03 14:11:28 [alert] 769#0: failed to register channel handler while initializing push module worker (1: Operation not permitted)

But the server is running...

So the passenger config was uncommented in /etc/nginx/nginx.conf:

        passenger_root /usr;
        passenger_ruby /usr/bin/ruby;

But then Nginx wouldn't restart:

/etc/init.d/nginx restart
  Restarting nginx: nginx: [emerg] unknown directive "passenger_root" in /etc/nginx/nginx.conf:70
  nginx: configuration file /etc/nginx/nginx.conf test failed

So those lines were commented out again.

Uninstalling and reinstalling was tried:

aptitude remove passenger passenger-dev passenger-doc
  The following packages will be REMOVED:  
    crash-watch{u} init-system-helpers{u} libcurl3{u} libev4{u} passenger passenger-dev passenger-doc 
    ruby-daemon-controller{u} ruby-rack{u} 
  0 packages upgraded, 0 newly installed, 9 to remove and 2 not upgraded.
  Need to get 0 B of archives. After unpacking 41.1 MB will be freed.
  Do you want to continue? [Y/n/?] Y

aptitude install passenger passenger-dev passenger-doc
  The following NEW packages will be installed:
    crash-watch{a} libcurl3{a} libev4{a} passenger passenger-dev passenger-doc 
    ruby-daemon-controller{a} ruby-rack{a} 
  0 packages upgraded, 8 newly installed, 0 to remove and 2 not upgraded.
  Need to get 0 B/8679 kB of archives. After unpacking 41.0 MB will be used.
  Do you want to continue? [Y/n/?] y

And the config was uncommented and tested:

/etc/init.d/nginx configtest
  Testing nginx configuration: nginx: [emerg] unknown directive "passenger_root" in /etc/nginx/nginx.conf:70
  nginx: configuration file /etc/nginx/nginx.conf test failed

So one way forward would be to:

  1. Backup /etc/nginx:
mkdir /root/nginx
rsync -av /etc/nginx /root/nginx
  1. Uninstall and delete the config:
aptitude remove nginx-extras nginx-common passenger passenger-dev passenger-doc
rm -rf /etc/nginx
  1. Reinstall:
aptitude install nginx-extras nginx-common passenger passenger-dev passenger-doc
  1. Backup the new config and reinstall the old config:
/etc/init.d/nginx stop
mv /etc/nginx /root/nginx.new
mkdir /etc/nginx
rsync -av /root/nginx /etc/nginx

Then diff the configs to try to find the differences.

This would be best done late at night when less people are using sites on the server, I'll try to do this tonight.

comment:2 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.1
  • Total Hours changed from 2.0 to 2.1

So, there is actually a passanger version of Nginx:

a-up
  About to upgrade nginx-common/wheezy nginx-extras/wheezy
  The following packages will be upgraded: 
    nginx-common nginx-extras 
  2 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  Need to get 1087 kB of archives. After unpacking 1250 kB will be used.
  Do you want to continue? [Y/n/?] y

Then uncomment the following lines in /etc/nginx/nginx.conf:

        passenger_root /usr;
        passenger_ruby /usr/bin/ruby;

Test and restart:

/etc/init.d/nginx configtest
  [ ok ] Testing nginx configuration:[....] nginx:.
/etc/init.d/nginx restart   
  [....] Restarting nginx: nginxnginx: [alert] Unable to start the Phusion Passenger watchdog because its executable (/usr/buildout/agents/PassengerWatchdog) does not exist. This probably means that your Phusion Passenger installation is broken or incomplete, or that your 'passenger_root' directive is set to the wrong value. Please reinstall Phusion Passenger or fix your 'passenger_root' directive, whichever is applicable. (-1: Unknown error)
  . ok 

So, re-comment and restart... More work needed...

Last edited 3 years ago by chris (previous) (diff)

comment:3 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 1.5
  • Total Hours changed from 2.1 to 3.6

So nginx-extras from Phusion has replaced the nginx-extras from Debian backports:

dpkg --status nginx-extras
  Package: nginx-extras
  Status: install ok installed
  Priority: extra
  Section: httpd
  Installed-Size: 2531
  Maintainer: Phusion <info@phusion.nl>
  Architecture: amd64
  Source: nginx
  Version: 1:1.4.4-2.4.0.37~wheezy1
  Provides: httpd, nginx
  Depends: nginx-common (= 1:1.4.4-2.4.0.37~wheezy1), perl (>= 5.14.2-21+deb7u1), perlapi-5.14.2, libc6 (>= 2.11), libexpat1 (>= 2.0.1), libgcc1 (>= 1:4.1.1), libgd2-noxpm (>= 2.0.36~rc1~dfsg) | libgd2-xpm (>= 2.0.36~rc1~dfsg), libgeoip1 (>= 1.4.8+dfsg), liblua5.1-0, libpam0g (>= 0.99.7.1), libpcre3 (>= 8.10), libperl5.14 (>= 5.14.2), libssl1.0.0 (>= 1.0.1), libstdc++6 (>= 4.6), libxml2 (>= 2.7.4), libxslt1.1 (>= 1.1.25), zlib1g (>= 1:1.2.0)
  Recommends: passenger (>= 4.0.37), passenger (<< 4.0.38)
  Suggests: nginx-doc (= 1:1.4.4-2.4.0.37~wheezy1)
  Conflicts: nginx-full, nginx-light, nginx-naxsi
  Description: nginx web/proxy server (extended version)
   Nginx ("engine X") is a high-performance web and reverse proxy server
   created by Igor Sysoev. It can be used both as a standalone web server
   and as a proxy to reduce the load on back-end HTTP or mail servers.
   .
   This package provides a version of nginx with the standard modules, plus
   extra features and modules such as the Perl module, which allows the
   addition of Perl in configuration files.
   .
   STANDARD HTTP MODULES: Core, Access, Auth Basic, Auto Index, Browser,
   Charset, Empty GIF, FastCGI, Geo, Gzip, Headers, Index, Limit Requests,
   Limit Zone, Log, Map, Memcached, Proxy, Referer, Rewrite, SCGI,
   SPDY, Split Clients, SSI, Upstream, User ID, UWSGI.
   .
   OPTIONAL HTTP MODULES: Addition, Debug, Embedded Perl, FLV, GeoIP,
   Gzip Precompression, Image Filter, IPv6, MP4, Random Index, Real IP,
   Secure Link, SSL, Stub Status, Substitution, WebDAV, XSLT.
   .
   MAIL MODULES: Mail Core, IMAP, POP3, SMTP, SSL.
   .
   THIRD PARTY MODULES: Auth PAM, Chunkin, DAV Ext, Echo, Embedded Lua,
   Fancy Index, HttpHeadersMore, HTTP Substitution Filter, http push,
   Nginx Development Kit, Upload module, Upload Progress,
   Upstream Fair Queue, Phusion Passenger.
  Homepage: http://nginx.net

Now to configure it...

It looks like we are best off creating a new site and then copying data into is:

So...

mkdir /web/patterns.transitionresearchnetwork.org
chown www-data:www-data /web/patterns.transitionresearchnetwork.org
su - www-data -s /bin/bash
cd /web/patterns.transitionresearchnetwork.org
gem install wagn

That didn't do anything... so following:

git clone https://github.com/wagn/wagn.git
  Cloning into 'wagn'...
  remote: Reusing existing pack: 75927, done.
  remote: Counting objects: 127, done.
  remote: Compressing objects: 100% (126/126), done.
  remote: Total 76054 (delta 6), reused 0 (delta 0)
  Receiving objects: 100% (76054/76054), 40.17 MiB | 1.05 MiB/s, done.
  Resolving deltas: 100% (54954/54954), done.
cd wagn
bundle install --without postgres:memcache:test:debug:development:assets
  Fetching gem metadata from http://rubygems.org/.........
  Fetching gem metadata from http://rubygems.org/..
  Resolving dependencies...
  
  Errno::EACCES: Permission denied - /web/.bundler
  An error occurred while installing rake (10.1.1), and Bundler cannot continue.
  Make sure that `gem install rake -v '10.1.1'` succeeds before bundling.

So as root:

mkdir /web/.bundler
chown www-data:www-data /web/.bundler

And try the above again:

bundle install --without postgres:memcache:test:debug:development:assets
  Fetching gem metadata from http://rubygems.org/.........
  Fetching gem metadata from http://rubygems.org/..
  Resolving dependencies...
  
  We trust you have received the usual lecture from the local System
  Administrator. It usually boils down to these three things:
  
      #1) Respect the privacy of others.
      #2) Think before you type.
      #3) With great power comes great responsibility.
  
  Enter your password to install the bundled RubyGems to your system: 

OK, so the command does need to be run as root...

sudo -i
cd /web/patterns.transitionresearchnetwork.org/wagn/
bundle install --without postgres:memcache:test:debug:development:assets
  Fetching gem metadata from http://rubygems.org/.........
  Fetching gem metadata from http://rubygems.org/..
  Resolving dependencies...
  Installing rake (10.1.1) 
  Installing i18n (0.6.9) 
  Installing multi_json (1.8.4) 
  Installing activesupport (3.2.16) 
  Using builder (3.0.4) 
  Installing activemodel (3.2.16) 
  Using erubis (2.7.0) 
  Using journey (1.0.4) 
  Using rack (1.4.5) 
  Using rack-cache (1.2) 
  Using rack-test (0.6.2) 
  Using hike (1.2.3) 
  Using tilt (1.4.1) 
  Using sprockets (2.2.2) 
  Installing actionpack (3.2.16) 
  Installing mime-types (1.25.1) 
  Using polyglot (0.3.3) 
  Using treetop (1.4.15) 
  Using mail (2.5.4) 
  Installing actionmailer (3.2.16) 
  Installing arel (3.0.3) 
  Installing tzinfo (0.3.38) 
  Installing activerecord (3.2.16) 
  Installing activeresource (3.2.16) 
  Installing airbrake (3.1.15) 
  Using bundler (1.3.5) 
  Using climate_control (0.0.3) 
  Installing cocaine (0.5.3) 
  Using coderay (1.1.0) 
  Using htmlentities (4.3.1) 
  Installing json (1.8.1) 
  Using systemu (2.5.2) 
  Using macaddr (1.6.1) 
  Installing mysql2 (0.3.14) 
  Using paperclip (2.8.0) 
  Using rack-ssl (1.3.3) 
  Using rdoc (3.12.2) 
  Using thor (0.18.1) 
  Installing railties (3.2.16) 
  Installing rails (3.2.16) 
  Installing recaptcha (0.3.6) 
  Using rmagick (2.13.2) 
  Using ruby-prof (0.12.2) 
  Installing rubyzip (1.1.0) 
  Gem::InstallError: rubyzip requires Ruby version >= 1.9.2.
  An error occurred while installing rubyzip (1.1.0), and Bundler cannot continue.
  Make sure that `gem install rubyzip -v '1.1.0'` succeeds before bundling.

So...

gem install rubyzip -v '1.1.0'
  Fetching: rubyzip-1.1.0.gem (100%)
  Successfully installed rubyzip-1.1.0
  1 gem installed
  Installing ri documentation for rubyzip-1.1.0...
  Installing RDoc documentation for rubyzip-1.1.0...

Check the ruby version:

aptitude search ruby | grep ^i
i   libmysql-ruby                   - Transitional package for ruby-mysql       
id  libmysql-ruby1.8                - Transitional package for ruby-mysql       
i A libruby1.8                      - Libraries necessary to run Ruby 1.8       
i A libruby1.9.1                    - Libraries necessary to run Ruby 1.9.1     
i A ruby-daemon-controller          - Library for robust daemon management      
i   ruby-mysql                      - MySQL module for Ruby                     
i A ruby-rack                       - Modular Ruby webserver interface          
i A ruby1.8                         - Interpreter of object-oriented scripting l
i A ruby1.8-dev                     - Header files for compiling extension modul
i   ruby1.9.1                       - Interpreter of object-oriented scripting l
i   ruby1.9.1-dev                   - Header files for compiling extension modul
i   rubygems                        - package management framework for Ruby libr
id  rubygems1.8                     - Transitional package for rubygems         

So, following:

ruby -v
  ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
aptitude install ruby-switch
ruby-switch --list
  ruby1.8
  ruby1.9.1
aptitude install ruby1.9.3       
  The following NEW packages will be installed:
    libdrm-intel1{a} libdrm-nouveau1a{a} libdrm-radeon1{a} libdrm2{a} libgl1-mesa-dri{a} libgl1-mesa-glx{a} libglapi-mesa{a} libpciaccess0{a} libruby1.9.1-dbg{a} libtcltk-ruby1.9.1{a} 
    libx11-xcb1{a} libxaw7{a} libxcb-glx0{a} libxcb-shape0{a} libxmu6{a} libxss1{a} libxtst6{a} libxv1{a} libxxf86dga1{a} libxxf86vm1{a} ri1.9.1{a} ruby1.9.1-examples{a} ruby1.9.1-full{a} 
    ruby1.9.3 tcl8.5{a} tk8.5{a} x11-utils{a} xbitmaps{a} xterm{a} 
  0 packages upgraded, 29 newly installed, 0 to remove and 0 not upgraded.
  Need to get 37.4 MB of archives. After unpacking 129 MB will be used.
  Do you want to continue? [Y/n/?] y
ruby-switch --list
  ruby1.8
  ruby1.9.1

This is because:

This package depends on the ruby1.9.1 package, and provides compatibility symbolic links from 1.9.3 executables and manual pages to their 1.9.1 counterparts.

https://packages.debian.org/wheezy/ruby1.9.3

Trying the command again:

bundle install --without postgres:memcache:test:debug:development:assets
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Resolving dependencies....
Using rake (10.1.1) 
Using i18n (0.6.9) 
Using multi_json (1.8.4) 
Using activesupport (3.2.16) 
Using builder (3.0.4) 
Using activemodel (3.2.16) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.3) 
Using tilt (1.4.1) 
Using sprockets (2.2.2) 
Using actionpack (3.2.16) 
Using mime-types (1.25.1) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.5.4) 
Using actionmailer (3.2.16) 
Using arel (3.0.3) 
Using tzinfo (0.3.38) 
Using activerecord (3.2.16) 
Using activeresource (3.2.16) 
Using airbrake (3.1.15) 
Using bundler (1.3.5) 
Using climate_control (0.0.3) 
Using cocaine (0.5.3) 
Using coderay (1.1.0) 
Using htmlentities (4.3.1) 
Using json (1.8.1) 
Using systemu (2.5.2) 
Using macaddr (1.6.1) 
Using mysql2 (0.3.14) 
Using paperclip (2.8.0) 
Using rack-ssl (1.3.3) 
Using rdoc (3.12.2) 
Using thor (0.18.1) 
Using railties (3.2.16) 
Using rails (3.2.16) 
Using recaptcha (0.3.6) 
Using rmagick (2.13.2) 
Using ruby-prof (0.12.2) 
Installing rubyzip (1.1.0) 
Gem::InstallError: rubyzip requires Ruby version >= 1.9.2.
An error occurred while installing rubyzip (1.1.0), and Bundler cannot continue.
Make sure that `gem install rubyzip -v '1.1.0'` succeeds before bundling.

And Ruby 2.0 isn't in backports:

More research needed...

Last edited 3 years ago by chris (previous) (diff)

comment:4 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Total Hours changed from 3.6 to 3.85

I have signed up for a Wagn account with the following message:

Hi

I'm trying to install Wagn on Debian Wheezy with Phusion, I have it working with WEBrick and a Nginx reverse proxy at https://patterns.transitionresearchnetwork.org/ see the notes at /trac/wiki/TransitionResearchWagn but when following http://wagn.org/wagn_in_production I run up against:

Gem::InstallError: rubyzip requires Ruby version >= 1.9.2.

Debian Wheezy has Ruby 1.9.1, more info on this ticket /trac/ticket/691

All the best

Chris

When that come through I'll raise a ticket there -- could't find any existing references to this issue.

comment:5 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Total Hours changed from 3.85 to 4.1

This is the issue:

sudo -i
cd /web/patterns.transitionresearchnetwork.org/wagn
ruby -v 
  ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
bundle install --without postgres:memcache:test:debug:development:assets
  Fetching gem metadata from http://rubygems.org/.........
  Fetching gem metadata from http://rubygems.org/..
  Resolving dependencies....
  Using rake (10.1.1) 
  Using i18n (0.6.9) 
  Using multi_json (1.8.4) 
  Using activesupport (3.2.16) 
  Using builder (3.0.4) 
  Using activemodel (3.2.16) 
  Using erubis (2.7.0) 
  Using journey (1.0.4) 
  Using rack (1.4.5) 
  Using rack-cache (1.2) 
  Using rack-test (0.6.2) 
  Using hike (1.2.3) 
  Using tilt (1.4.1) 
  Using sprockets (2.2.2) 
  Using actionpack (3.2.16) 
  Using mime-types (1.25.1) 
  Using polyglot (0.3.3) 
  Using treetop (1.4.15) 
  Using mail (2.5.4) 
  Using actionmailer (3.2.16) 
  Using arel (3.0.3) 
  Using tzinfo (0.3.38) 
  Using activerecord (3.2.16) 
  Using activeresource (3.2.16) 
  Using airbrake (3.1.15) 
  Using bundler (1.3.5) 
  Using climate_control (0.0.3) 
  Using cocaine (0.5.3) 
  Using coderay (1.1.0) 
  Using htmlentities (4.3.1) 
  Using json (1.8.1) 
  Using systemu (2.5.2) 
  Using macaddr (1.6.1) 
  Using mysql2 (0.3.14) 
  Using paperclip (2.8.0) 
  Using rack-ssl (1.3.3) 
  Using rdoc (3.12.2) 
  Using thor (0.18.1) 
  Using railties (3.2.16) 
  Using rails (3.2.16) 
  Using recaptcha (0.3.6) 
  Using rmagick (2.13.2) 
  Using ruby-prof (0.12.2) 
  Installing rubyzip (1.1.0) 
  Gem::InstallError: rubyzip requires Ruby version >= 1.9.2.
  An error occurred while installing rubyzip (1.1.0), and Bundler cannot continue.
  Make sure that `gem install rubyzip -v '1.1.0'` succeeds before bundling.
gem install rubyzip -v '1.1.0'
  Successfully installed rubyzip-1.1.0
  1 gem installed
  Installing ri documentation for rubyzip-1.1.0...
  Installing RDoc documentation for rubyzip-1.1.0...
bundle install --without postgres:memcache:test:debug:development:assets
  Fetching gem metadata from http://rubygems.org/.........
  Fetching gem metadata from http://rubygems.org/..
  Resolving dependencies....
  Using rake (10.1.1) 
  Using i18n (0.6.9) 
  Using multi_json (1.8.4) 
  Using activesupport (3.2.16) 
  Using builder (3.0.4) 
  Using activemodel (3.2.16) 
  Using erubis (2.7.0) 
  Using journey (1.0.4) 
  Using rack (1.4.5) 
  Using rack-cache (1.2) 
  Using rack-test (0.6.2) 
  Using hike (1.2.3) 
  Using tilt (1.4.1) 
  Using sprockets (2.2.2) 
  Using actionpack (3.2.16) 
  Using mime-types (1.25.1) 
  Using polyglot (0.3.3) 
  Using treetop (1.4.15) 
  Using mail (2.5.4) 
  Using actionmailer (3.2.16) 
  Using arel (3.0.3) 
  Using tzinfo (0.3.38) 
  Using activerecord (3.2.16) 
  Using activeresource (3.2.16) 
  Using airbrake (3.1.15) 
  Using bundler (1.3.5) 
  Using climate_control (0.0.3) 
  Using cocaine (0.5.3) 
  Using coderay (1.1.0) 
  Using htmlentities (4.3.1) 
  Using json (1.8.1) 
  Using systemu (2.5.2) 
  Using macaddr (1.6.1) 
  Using mysql2 (0.3.14) 
  Using paperclip (2.8.0) 
  Using rack-ssl (1.3.3) 
  Using rdoc (3.12.2) 
  Using thor (0.18.1) 
  Using railties (3.2.16) 
  Using rails (3.2.16) 
  Using recaptcha (0.3.6) 
  Using rmagick (2.13.2) 
  Using ruby-prof (0.12.2) 
  Installing rubyzip (1.1.0) 
  Gem::InstallError: rubyzip requires Ruby version >= 1.9.2.
  An error occurred while installing rubyzip (1.1.0), and Bundler cannot continue.
  Make sure that `gem install rubyzip -v '1.1.0'` succeeds before bundling.

Others have had this issue:

But I can't find an answer...

Last edited 3 years ago by chris (previous) (diff)

comment:6 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.5
  • Total Hours changed from 4.1 to 4.6

The suggestion is:

  1. use rvm to manage your ruby versions. It's a powerful tool, and the more recent ruby versions have some genuine performance improvements that are worth having.
  1. if you expect to stay on top of upgrades (recommended!), it will be easiest if you start using the new wagn gem installation rather than the current git-based approach. We haven't been promoting that mechanism broadly yet, but we expect to put out 1.13 in a week or so, and will begin promoting it then. We're using it for all the sites we host, and it's already six or seven point releases past the master branch, so it's ready for prime time and has some valuable improvements. And this will really be the only supported mechanism moving forward. See docs about how to install on our develop branch on GitHub?.
  1. I would not recommend serving with Webrick if you're expecting any real traffic. The new gem installation mechanism makes Wagn much more like a standard rack app (with the one exception that you will need to symlink a public directory to the public directory in the gem; that's one wart we wanted to fix before promoting the gem), which in turn makes it much easier to serve with passenger.

I want to try to stick with the Debian version of Ruby if at all possible so as to make upgrades and updates easier.

So trying the gem install (which failed earlier, see ticket:691#comment:3):

sudo -i
cd /web/patterns.transitionresearchnetwork.org/
rm -rf *
gem install wagn

The above appears to do nothing, so making it more verbose:

gem install --verbose wagn

  ...
  
  Building native extensions.  This could take a while...
  ERROR:  Error installing wagn:
          ERROR: Failed to build gem native extension.
  
          /usr/bin/ruby1.9.1 extconf.rb
  checking for Ruby version >= 1.8.5... yes
  checking for gcc... yes
  checking for Magick-config... no
  Can't install RMagick 2.13.2. Can't find Magick-config in /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of
  necessary libraries and/or headers.  Check the mkmf.log file for more
  details.  You may need configuration options.
  
  Provided configuration options:
          --with-opt-dir
          --without-opt-dir
          --with-opt-include
          --without-opt-include=${opt-dir}/include
          --with-opt-lib
          --without-opt-lib=${opt-dir}/lib
          --with-make-prog
          --without-make-prog
          --srcdir=.
          --curdir
          --ruby=/usr/bin/ruby1.9.1
  
  
  Gem files will remain installed in /var/lib/gems/1.9.1/gems/rmagick-2.13.2 for inspection.
  Results logged to /var/lib/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out

So:

aptitude install ruby-rmagick librmagick-ruby

Trying again:

gem install --verbose wagn

  ...

  ERROR:  Error installing wagn:
          ERROR: Failed to build gem native extension.
  
          /usr/bin/ruby1.9.1 extconf.rb
  checking for Ruby version >= 1.8.5... yes
  checking for gcc... yes
  checking for Magick-config... no
  Can't install RMagick 2.13.2. Can't find Magick-config in /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of
  necessary libraries and/or headers.  Check the mkmf.log file for more
  details.  You may need configuration options.
  
  Provided configuration options:
          --with-opt-dir
          --without-opt-dir
          --with-opt-include
          --without-opt-include=${opt-dir}/include
          --with-opt-lib
          --without-opt-lib=${opt-dir}/lib
          --with-make-prog
          --without-make-prog
          --srcdir=.
          --curdir
          --ruby=/usr/bin/ruby1.9.1
  
  
  Gem files will remain installed in /var/lib/gems/1.9.1/gems/rmagick-2.13.2 for inspection.
  Results logged to /var/lib/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out

So:

aptitude install libmagick-dev

  The following NEW packages will be installed:
    graphicsmagick-libmagick-dev-compat libbz2-dev{a} libexif-dev{a} libexif12{a} libgraphics-magick-perl{a} libgraphicsmagick++1-dev{a} libgraphicsmagick++3{a} libgraphicsmagick1-dev{a} 
    libgraphicsmagick3{a} libjasper-dev{a} libjbig-dev{a} libjpeg8-dev{a} liblcms1-dev{a} libtiff4-dev{a} libtiffxx0c2{a} libwmf-dev{a} libxml2-dev{a} 

And, try again:

gem install --verbose wagn
  
  Building native extensions.  This could take a while...
  ERROR:  Error installing wagn:
          ERROR: Failed to build gem native extension.
  
          /usr/bin/ruby1.9.1 extconf.rb
  checking for Ruby version >= 1.8.5... yes
  checking for gcc... yes
  checking for Magick-config... yes
  
  Warning: Found a partial ImageMagick installation. Your operating system likely has some built-in ImageMagick libraries but not all of ImageMagick. This will most likely cause problems at both compile and runtime.
  Found partial installation at: /usr
  checking for ImageMagick version >= 6.4.9... yes
  checking for HDRI disabled version of ImageMagick... yes
  checking for stdint.h... yes
  checking for sys/types.h... yes
  checking for wand/MagickWand.h... no
  
  Can't install RMagick 2.13.2. Can't find MagickWand.h.
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of
  necessary libraries and/or headers.  Check the mkmf.log file for more
  details.  You may need configuration options.
  
  Provided configuration options:
          --with-opt-dir
          --without-opt-dir
          --with-opt-include
          --without-opt-include=${opt-dir}/include
          --with-opt-lib
          --without-opt-lib=${opt-dir}/lib
          --with-make-prog
          --without-make-prog
          --srcdir=.
          --curdir
          --ruby=/usr/bin/ruby1.9.1
  
  
  Gem files will remain installed in /var/lib/gems/1.9.1/gems/rmagick-2.13.2 for inspection.
  Results logged to /var/lib/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out

So:

aptitude install libmagickwand-dev
  
  The following NEW packages will be installed:
    gir1.2-rsvg-2.0{a} libcgraph5{a} libdjvulibre-dev{a} libgraphviz-dev{a} libgvpr1{a} libilmbase-dev{a} liblqr-1-0-dev{a} libmagickcore-dev{a} libmagickwand-dev libopenexr-dev{a} 
    librsvg2-dev{a} libxt-dev{a} 
  0 packages upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
  Need to get 4592 kB/5871 kB of archives. After unpacking 19.7 MB will be used.
  The following packages have unmet dependencies:
   graphicsmagick-libmagick-dev-compat : Conflicts: libmagickcore-dev but 8:6.7.7.10-5+deb7u2 is to be installed.
  The following actions will resolve these dependencies:
  
       Remove the following packages:       
  1)     graphicsmagick-libmagick-dev-compat
  
  
  
  Accept this solution? [Y/n/q/?] Y 
  
    gir1.2-rsvg-2.0{a} libcgraph5{a} libdjvulibre-dev{a} libgraphviz-dev{a} libgvpr1{a} libilmbase-dev{a} liblqr-1-0-dev{a} libmagickcore-dev{a} libmagickwand-dev libopenexr-dev{a} 
    librsvg2-dev{a} libxt-dev{a} 
  The following packages will be REMOVED:
    graphicsmagick-libmagick-dev-compat{a} libgraphics-magick-perl{u} libgraphicsmagick++1-dev{u} libgraphicsmagick++3{u} libgraphicsmagick1-dev{u} libgraphicsmagick3{u} 

  ...

Trying again:

gem install --verbose wagn

And that worked!

Thanks to the help here:

So now the next stage...

comment:7 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 2.0
  • Total Hours changed from 4.6 to 6.6

After running gem install --verbose wagn, following, https://github.com/wagn/wagn/tree/develop the next step is:

cd /web/patterns.transitionresearchnetwork.org
wagn new patterns
        create  
        create  Rakefile
        create  mods
        create  mods/.gitkeep
        create  log
        create  log/.gitkeep
        create  files
        create  files/.gitkeep
        create  tmp
        create  Gemfile
        create  config.ru
        create  .gitignore
        create  config
        create  config/application.rb
        create  config/environment.rb
        create  config/boot.rb
        create  config/database.yml
        create  script
        create  script/wagn
           run  bundle install
  Fetching gem metadata from http://rubygems.org/...........
  Fetching additional metadata from http://rubygems.org/..
  Resolving dependencies...
  Using rake (10.1.1)
  Using i18n (0.6.9)
  Using multi_json (1.9.0)
  Using activesupport (3.2.16)
  Using builder (3.0.4)
  Using activemodel (3.2.16)
  Using erubis (2.7.0)
  Using journey (1.0.4)
  Using rack (1.4.5)
  Using rack-cache (1.2)
  Using rack-test (0.6.2)
  Using hike (1.2.3)
  Using tilt (1.4.1)
  Using sprockets (2.2.2)
  Using actionpack (3.2.16)
  Using mime-types (1.25.1)
  Using polyglot (0.3.4)
  Using treetop (1.4.15)
  Using mail (2.5.4)
  Using actionmailer (3.2.16)
  Using arel (3.0.3)
  Using tzinfo (0.3.38)
  Using activerecord (3.2.16)
  Using activeresource (3.2.16)
  Using airbrake (3.1.15)
  Using bundler (1.5.3)
  Using climate_control (0.0.3)
  Using cocaine (0.5.3)
  Using coderay (1.1.0)
  Using htmlentities (4.3.1)
  Using json (1.8.1)
  Using systemu (2.5.2)
  Using macaddr (1.6.1)
  Installing mysql2 (0.3.15)
  Using paperclip (2.8.0)
  Using rack-ssl (1.3.3)
  Using rdoc (3.12.2)
  Using thor (0.18.1)
  Using railties (3.2.16)
  Using rails (3.2.16)
  Using recaptcha (0.3.6)
  Using rmagick (2.13.2)
  Using rubyzip (1.1.0)
  Using sass (3.2.14)
  Using smartname (0.2.3)
  Using uuid (2.3.7)
  Using xmlscan (0.3.0)
  Using wagn (1.12.13)
  Your bundle is complete!
  Use `bundle show [gemname]` to see where a bundled gem is installed.

Next create a database for the new site:

sudo -i
mysql
mysql> CREATE DATABASE patterns;
mysql> GRANT USAGE ON patterns.* TO patterns@localhost IDENTIFIED BY 'XXXXXXXX'; 
mysql> GRANT ALL PRIVILEGES ON patterns.* TO patterns@localhost;
mysql> FLUSH PRIVILEGES;

Edit /web/patterns.transitionresearchnetwork.org/patterns/config/database.yml with the database details, this file suggests three databases, so creating the test and development databases:

sudo -i
mysql
mysql> CREATE DATABASE patterns_dev;
mysql> GRANT USAGE ON patterns_dev.* TO patterns@localhost IDENTIFIED BY 'XXXXXXXX'; 
mysql> GRANT ALL PRIVILEGES ON patterns_dev.* TO patterns@localhost;
mysql> CREATE DATABASE patterns_test;
mysql> GRANT USAGE ON patterns_test.* TO patterns@localhost IDENTIFIED BY 'XXXXXXXX'; 
mysql> GRANT ALL PRIVILEGES ON patterns_test.* TO patterns@localhost;
mysql> FLUSH PRIVILEGES;

And following the instructions in that file:

cd /web/patterns.transitionresearchnetwork.org/patterns
gem install mysql2
  Building native extensions.  This could take a while...
  Successfully installed mysql2-0.3.15
  1 gem installed
  Installing ri documentation for mysql2-0.3.15...
  Installing RDoc documentation for mysql2-0.3.15...
gem 'mysql2'
  ERROR:  While executing gem ... (RuntimeError)
    Unknown command mysql2

Not sure what this means... perhaps this is a PATH issue?

The next step:

cd /web/patterns.transitionresearchnetwork.org/patterns
rake wagn:create
  dropping
  creating
  loading schema
  -- create_table("card_references", {:force=>true})
     -> 0.9974s
  -- add_index("card_references", ["referee_id"], {:name=>"wiki_references_referenced_card_id"})
     -> 0.3672s
  -- add_index("card_references", ["referee_key"], {:name=>"wiki_references_referenced_name"})
     -> 0.4907s
  -- add_index("card_references", ["referer_id"], {:name=>"wiki_references_card_id"})
     -> 0.2266s
  -- create_table("card_revisions", {:force=>true})
     -> 0.0788s
  -- add_index("card_revisions", ["card_id"], {:name=>"revisions_card_id_index"})
     -> 0.2190s
  -- add_index("card_revisions", ["creator_id"], {:name=>"revisions_created_by_index"})
     -> 0.2308s
  -- create_table("cards", {:force=>true})
     -> 0.0992s
  -- add_index("cards", ["key"], {:name=>"cards_key_uniq", :unique=>true})
     -> 0.4615s
  -- add_index("cards", ["left_id"], {:name=>"index_cards_on_trunk_id"})
     -> 4.4474s
  -- add_index("cards", ["name"], {:name=>"cards_name_index"})
     -> 0.6360s
  -- add_index("cards", ["read_rule_id"], {:name=>"index_cards_on_read_rule_id"})
     -> 1.3626s
  -- add_index("cards", ["right_id"], {:name=>"index_cards_on_tag_id"})
     -> 0.3617s
  -- add_index("cards", ["type_id"], {:name=>"card_type_index"})
     -> 0.2495s
  -- create_table("schema_migrations_cards", {:id=>false, :force=>true})
     -> 0.1334s
  -- add_index("schema_migrations_cards", ["version"], {:name=>"unique_schema_migrations_cards", :unique=>true})
     -> 1.7714s
  -- create_table("sessions", {:force=>true})
     -> 0.5285s
  -- add_index("sessions", ["session_id"], {:name=>"sessions_session_id_index"})
     -> 0.1979s
  -- create_table("users", {:force=>true})
     -> 0.2313s
  -- initialize_schema_migrations_table()
     -> 0.7886s
  -- assume_migrated_upto_version(20130411210957, ["/var/lib/gems/1.9.1/gems/wagn-1.12.13/db/migrate"])
     -> 0.5099s
  -- assume_migrated_upto_version("20140110193325", ["/var/lib/gems/1.9.1/gems/wagn-1.12.13/db/migrate_cards"])
     -> 0.4850s
  loading bootstrap
  bootstrap load starting

So, now copy the data from the old site:

mkdir /web/patterns.transitionresearchnetwork.org/patterns/local
rsync -av /web/wagn/local/ /web/patterns.transitionresearchnetwork.org/patterns/local/

Insert the database:

mysqldump wagn > /tmp/wagn.sql
cat /tmp/wagn.sql | mysql patterns
rake wagn:migrate
migrating structure
migrating cards
  ==  CommonCssPatch: migrating =================================================
  ==  CommonCssPatch: migrated (0.6030s) ========================================
  
  ==  ResetAccountRequestType: migrating ========================================
  ==  ResetAccountRequestType: migrated (0.8829s) ===============================

Chown the site to match the user the webserver runs as:

chown www-data:www-data -R /web/patterns.transitionresearchnetwork.org/patterns

Configure Nginx with a basic config:

server {
        listen   80;
        server_name wagn-phusion.penguin.webarch.net;
        access_log  /var/log/nginx/wagn-phusion.access.log;
        error_log   /var/log/nginx/wagn-phusion.error.log   crit;
        root /web/patterns.transitionresearchnetwork.org/patterns;
        passenger_enabled on;
}

And restart Nginx and we have a 403 at:

So reading:

One suggestion, in that doc:

passenger-config --ruby-command 
passenger-config was invoked through the following Ruby interpreter:
  Command: /usr/bin/ruby1.9.1
  Version: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
  To use in Apache: PassengerRuby /usr/bin/ruby1.9.1
  To use in Nginx : passenger_ruby /usr/bin/ruby1.9.1
  To use with Standalone: /usr/bin/ruby1.9.1 /usr/bin/passenger start

The following Ruby interpreter was found first in $PATH:
  Command: /usr/bin/ruby
  Version: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
  To use in Apache: PassengerRuby /usr/bin/ruby
  To use in Nginx : passenger_ruby /usr/bin/ruby
  To use with Standalone: /usr/bin/ruby /usr/bin/passenger start

## Notes for RVM users
Do you want to know which command to use for a different Ruby interpreter? 'rvm use' that Ruby interpreter, then re-run 'passenger-config --ruby-command'.

So this was added to the Nginx config:

passenger_ruby /usr/bin/ruby;

But there is still a 403, so the Nginx log level was changed to 'info' but this didn't cause the logs to have any more information.

Perhaps this is a clue, there is this variable:

passenger_show_version_in_header on;

But this isn't in the headers:

GET / HTTP/1.1
Host: wagn-phusion.penguin.webarch.net
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:27.0) Gecko/20100101 Firefox/27.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Cache-Control: max-age=0

HTTP/1.1 403 Forbidden
Server: nginx/1.4.4
Date: Thu, 06 Mar 2014 11:55:57 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 168
Connection: keep-alive

Also we do now have a error massage appearing in the logs:

2014/03/06 11:55:57 [error] 7357#0: *20 directory index of "/web/patterns.transitionresearchnetwork.org/patterns/" is forbidden, client: XX.XX.XX.XX, server: wagn-phusion.penguin.webarch.net, request: "GET / HTTP/1.1", host: "wagn-phusion.penguin.webarch.net"

But I'm not sure what to try next so I'm about to post this to the Wagn site:

I have installed wagn, following the instructions at https://github.com/wagn/wagn/tree/develop but appear to have a problem with the Nginx config, I have this:

server {

listen 80;
server_name wagn-phusion.penguin.webarch.net;
access_log /var/log/nginx/wagn-phusion.access.log;
error_log /var/log/nginx/wagn-phusion.error.log info;
root /web/patterns.transitionresearchnetwork.org/patterns;
passenger_enabled on;
passenger_ruby /usr/bin/ruby;
passenger_show_version_in_header on;

}

However the front page is a 403:

http://wagn-phusion.penguin.webarch.net/

2014/03/06 11:55:57 [error] 7357#0: *20 directory index of "/web/patterns.transitionresearchnetwork.org/patterns/" is forbidden, client: XX.XX.XX.XX, server: wagn-phusion.penguin.webarch.net, request: "GET / HTTP/1.1", host: "wagn-phusion.penguin.webarch.net"

And note that the Nginx headers don't have the Phusion Passenger version string:

http://www.modrails.com/documentation/Users%20guide%20Nginx.html#_passenger_show_version_in_header_lt_on_off_gt

Server: nginx/1.4.4

But we do that the Phusion version of Nginx:

dpkg --status nginx-extras | grep Version
Version: 1:1.4.4-2.4.0.37~wheezy1

dpkg --status nginx-extras | grep Maintainer
Maintainer: Phusion <info@…>

So, I'm not sure what to try next, is there a Wagn Nginx Phusion Passenger config somewhere I could look at?

comment:8 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Total Hours changed from 6.6 to 6.85

I have added these lines to /etc/nginx/nginx.conf:

        passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
        passenger_ruby /usr/bin/ruby;

And restarted Nginx but this hasn't changed anything.

There is this suggestion:

touch /web/patterns.transitionresearchnetwork.org/patterns/tmp/restart.txt
chown www-data:www-data /web/patterns.transitionresearchnetwork.org/patterns/tmp/restart.txt
/etc/init.d/nginx restart

But that hasn't made any difference.

Following this suggestion I have added this line to /etc/nginx/nginx.conf:

       passenger_log_level 3;

But that hasn't resulted in any more information in the logs.

Following this suggestion:

export PASSENGER_TMPDIR=/web/patterns.transitionresearchnetwork.org/patterns/tmp
passenger-status
  ERROR: Phusion Passenger doesn't seem to be running.

But it does appear to be running:

passenger-memory-stats
Version: 4.0.37
Date   : 2014-03-06 12:53:47 +0000
------------- Apache processes -------------
*** WARNING: The Apache executable cannot be found.
Please set the APXS2 environment variable to your 'apxs2' executable's filename, or set the HTTPD environment variable to your 'httpd' or 'apache2' executable's filename.


---------- Nginx processes -----------
PID    PPID   VMSize    Private  Name
--------------------------------------
13758  1      167.3 MB  0.2 MB   nginx: master process /usr/sbin/nginx
13760  13758  167.3 MB  1.1 MB   nginx: worker process
13764  13758  167.3 MB  0.5 MB   nginx: worker process
13767  13758  167.3 MB  1.2 MB   nginx: worker process
13770  13758  167.3 MB  1.1 MB   nginx: worker process
### Processes: 5
### Total private dirty RSS: 4.16 MB


----- Passenger processes -----
PID    VMSize    Private  Name
-------------------------------
13740  89.4 MB   0.3 MB   PassengerWatchdog
13743  108.6 MB  0.3 MB   PassengerHelperAgent
13752  80.9 MB   0.9 MB   PassengerLoggingAgent
### Processes: 3
### Total private dirty RSS: 1.50 MB

I haven't found any help searching for "ERROR: Phusion Passenger doesn't seem to be running." and "Nginx".

Last edited 3 years ago by chris (previous) (diff)

comment:9 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.3
  • Total Hours changed from 6.85 to 7.15

Thanks to help from Ethan the site is now working:

The thing that was missing was a symlink:

cd /web/patterns.transitionresearchnetwork.org/patterns
ln -s `bundle show wagn`/public 

And to change the Nginx config to:

        root /web/patterns.transitionresearchnetwork.org/patterns/public;
        passenger_enabled on;

Outstanding is the config for serving the images.

comment:10 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Total Hours changed from 7.15 to 7.4

Sorting images and the mod:

cd /web/patterns.transitionresearchnetwork.org/patterns
rsync -av local/files/ files/
rsync -av local/mods/ mods/
rm -rf local

And the favicon:

cd public
wget http://www.transitionnetwork.org/favicon.ico

Now I think it's ready to be made live, once Tom has checked it.

Then the documentation will need updating wiki:TransitionResearchWagn

comment:11 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Total Hours changed from 7.4 to 7.65

I have switched the sites around, now the new site is available here:

And the old one here:

comment:12 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.35
  • Total Hours changed from 7.65 to 8.0

I have done some updating to the documentation at wiki:PenguinServer and wiki:TransitionResearchWagn but it could do with some information about how to upgrade Wagn, but until I do this I won't know the exact steps involved so that can probably wait.

Once Tom has confirmed that editing works OK on the new site then the old one can be deleted.

comment:13 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 1.5
  • Total Hours changed from 8.0 to 9.5

Testing the site at:

Generates a "A" rating but flags up a few issues for the HTTPS version of the site:

  • This site works only in browsers with SNI support. -- this is because the site doesn't have a dedicated IP address, this means the site won't work in some older browsers see Wikipedia.
  • Certification Paths: Path #2: Trusted - Extra download: UTN-USERFirst-Hardware -- this needs fixing.

A DH prime was generated:

sudo -i
cd /etc/ssl/transitionnetwork.org/
openssl dhparam 4096

And the result was saved as /etc/ssl/transitionnetwork.org/dhparam.pem and this was added to the /etc/nginx/nginx.conf file:

ssl_dhparam /etc/ssl/transitionnetwork.org/dhparam.pem;

To solve the cert path issue:

sudo -i
cd /etc/ssl/wagn
wget http://crt.usertrust.com/UTNAddTrustServer_CA.crt
openssl x509 -inform DER -in UTNAddTrustServer_CA.crt -out UTNAddTrustServer_CA.pem
cat wagn.pem > wagn.chained.pem.new
cat GandiStandardSSLCA.pem >> wagn.chained.pem.new
cat UTNAddTrustServer_CA.pem >> wagn.chained.pem.new
mv wagn.chained.pem wagn.chained.pem.old 
mv wagn.chained.pem.new wagn.chained.pem

Note that since we have a fairly new version of Nginx we can enable support for the draft 2 of SPDY protocol (but not the latest because we are not running Nginx 1.5.10 or greater) by adding spdy to the listen directive, this has been done for all the HTTPS sites on the server.

To track memory usage /etc/munin/plugin-conf.d/munin-node was updated:

[multips_memory]
env.names php5-fpm munin-node nginx mysqld tracd python PassengerHelper

This should result in the passenger memory usage showing up on this graph.

To get some further graphs, these munin-plugins-rails were installed:

gem install munin-plugins-rails
  Fetching: request-log-analyzer-1.12.10.gem (100%)
  Fetching: munin-plugins-rails-0.2.13.gem (100%)
  Successfully installed request-log-analyzer-1.12.10
  Successfully installed munin-plugins-rails-0.2.13
  2 gems installed
  Installing ri documentation for request-log-analyzer-1.12.10...
  unable to convert U+2501 from UTF-8 to US-ASCII for lib/request_log_analyzer/output/fixed_width.rb, skipping
  Installing ri documentation for munin-plugins-rails-0.2.13...
  Installing RDoc documentation for request-log-analyzer-1.12.10...
  unable to convert U+2501 from UTF-8 to US-ASCII for lib/request_log_analyzer/output/fixed_width.rb, skipping
  Installing RDoc documentation for munin-plugins-rails-0.2.13...
request-log-analyzer-munin install

The command to generate the dhparam.pem is still running and the munin stats will need checking later.

We now have a A+ at ssl labs.

Some updates have also been made to the wiki:SecurityInfo?version=17 page.

Last edited 3 years ago by chris (previous) (diff)

comment:14 Changed 3 years ago by chris

Note that the munin plugins need more work:

cd /etc/munin/plugins
munin-run munin_passenger_memory_stats
  Can't exec "/usr/local/bin/ruby": No such file or directory at /usr/share/perl5/Munin/Node/Service.pm line 263.
  # FATAL: Failed to exec.
munin-run munin_passenger_queue       
  Can't exec "/usr/local/bin/ruby": No such file or directory at /usr/share/perl5/Munin/Node/Service.pm line 263.
  # FATAL: Failed to exec.
munin-run munin_passenger_status
  Can't exec "/usr/local/bin/ruby": No such file or directory at /usr/share/perl5/Munin/Node/Service.pm line 263.
  # FATAL: Failed to exec.

comment:15 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Total Hours changed from 9.5 to 9.75

Sorting out the munin scripts from https://github.com/barttenbrinke/munin-plugins-rails

The files that were created in /etc/munin/plugin-conf.d were deleted and their content fixed and added to /etc/munin/plugin-conf.d/munin-node:

[munin_passenger_*]
user root
command /usr/bin/ruby %c
env.passenger_status '/usr/sbin/passenger-status'
env.passenger_memory_stats '/usr/sbin/passenger-memory-stats'
env.graph_category Passenger

But the scripts don't produce great results:

munin-run munin_passenger_memory_stats 
 
*** WARNING: The Apache executable cannot be found.
Please set the APXS2 environment variable to your 'apxs2' executable's filename, or set the HTTPD environment variable to your 'httpd' or 'apache2' executable's filename.
*** WARNING: The Apache executable cannot be found.
Please set the APXS2 environment variable to your 'apxs2' executable's filename, or set the HTTPD environment variable to your 'httpd' or 'apache2' executable's filename.
memory.value 74176266

munin-run munin_passenger_queue 
requests.value 

munin-run munin_passenger_status 
max.value 
running.value 
active.value 
sessions.value 0

I'm not sure these script are worth fixing so I have deleted them, I have done a quick search for "ngnix passenger munin" and not found and munin plugins that look any good so for now I think we will have to live wothout any passenger munin graphs.

comment:16 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.1
  • Total Hours changed from 9.75 to 9.85

The new passenger site is in /web/patterns.transitionresearchnetwork.org/ and the old WEBrick site is in /web/wagn/, it is using 300MB of space:

cd /web/wagn
du -h --max-depth=1
408K    ./test
392K    ./db
324K    ./app
176K    ./config
8.0K    ./.bundle
120K    ./features
28M     ./local
256K    ./lib
8.0K    ./.vim
209M    ./tmp
31M     ./.git
23M     ./log
7.0M    ./public
776K    ./spec
16K     ./script
760K    ./mods
12K     ./bin
300M    .

But 209M of this is tmp files, so these have been deleted:

rm -rf tmp/*

And it's now using 92M of space, this isn't really an issue, but I think it would be safe to now delete the old site once the users of the site have done some testing -- it doesn't appears to have been used much since the upgrade, see https://patterns.transitionresearchnetwork.org/recent

comment:17 Changed 3 years ago by ed

Ed: checking this for budgets work. This work took 10 hours. We have classed it as 'maintenance'. I think we need a new milesetone 'TRNRG' for this work as it falls outside of standard maintenance stuff and we've been covering it in the maintenance budget. TBC by Ed.

Chris - yes delete the old site!

comment:18 Changed 3 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.25
  • Total Hours changed from 9.85 to 10.1

Looking at https://patterns.transitionresearchnetwork.org/recent it's clear it's been used since the upgrade and there haven't been reports of problems so I agree it's safe to delete the old site:

rm -rf /web/wagn
rm /etc/nginx/sites-available/wagn

And the wagn user and group were deleted from /etc/passwd and /etc/group.

Think this is good to close now apart from the Trac Milestone issue?

comment:19 Changed 3 years ago by chris

  • Description modified (diff)

comment:20 Changed 3 years ago by chris

  • Description modified (diff)

comment:21 Changed 3 years ago by chris

This wiki page has been updated: wiki:TransitionResearchWagn and the old documentation on it has been archived to wiki:WagnWebrick.

comment:22 Changed 2 years ago by chris

  • Status changed from accepted to closed
  • Resolution set to fixed

Closing as this task has been completed.

Note: See TracTickets for help on using tickets.