Difference between revisions of "User:Woozle/Redmine/2"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to: navigation, search
(2020-02-13: progress)
(2020-02-13)
Line 597: Line 597:
 
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/mysql2-0.5.3/gem_make.out
 
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/mysql2-0.5.3/gem_make.out
 
</pre>
 
</pre>
Looking at mkmf.log, the key seems to be lines ending in "-------------------- {{arg|yes|no}}", where the first and only "no" line is:
+
Looking at mkmf.log, the key seems to be lines ending in "-------------------- {{arg|yes/no}}", where the first and only "no" line is:
 
  find_library: checking for -lmysqlclient... -------------------- no
 
  find_library: checking for -lmysqlclient... -------------------- no
 
So presumably I need to install lmysqlclient. (From apt, I hope?)
 
So presumably I need to install lmysqlclient. (From apt, I hope?)
Line 614: Line 614:
 
</pre>
 
</pre>
 
...and all appears right with the world.
 
...and all appears right with the world.
 +
 +
Now what error do we get?
 +
<blockquote>[Thu Feb 13 19:19:58.871510 2020] [cgi:error] [pid 28015] [client 107.15.53.219:7649] AH01215: /var/lib/gems/2.5.0/gems/yard-0.9.24/lib/yard/config.rb:95:in `expand_path': couldn't find login name -- expanding `~' (ArgumentError): /home/vbzo/domains/rm.vbz.ovh/public_html/dispatch.fcgi</blockquote>

Revision as of 20:32, 13 February 2020

2020-02-09

Redmine: download

The download/install instructions suggest strongly that using subversion is the best way to upgrade --

svn co https://svn.redmine.org/redmine/branches/4.0-stable redmine-4.0

...and then cd to the redmine-4.0 folder which that creates, and:

svn update

I think this assumes I'm working with an already-configured instance, though, so I should look at the installation guide before trying the svn update.

On further reflection, I realized that I should probably be installing v4.1, in spite of the example:

svn co http://svn.redmine.org/redmine/branches/4.1-stable/ redmine-4.1

That seemed to work too.

Ruby

It looked like the packaged version of Ruby (2.5.1p57 (2018-03-29 revision 63029)) would be ok -- Redmine 4.1 wants Ruby 2.3, 2.4, 2.5, or 2.6 and Rails 5.2 -- so I did that.

Rails

I was never able to find actual instructions for installing Rails (unless you're serving from Windows or Mac for some reason), but a hint somewhere suggested that it could be installed with gem:

root@cloud1:~# gem install rails
Fetching: concurrent-ruby-1.1.5.gem (100%)
Successfully installed concurrent-ruby-1.1.5
Fetching: i18n-1.8.2.gem (100%)

HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.

If you are upgrading your Rails application from an older version of Rails:

Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.

If you are starting a NEW Rails application, you can ignore this notice.

For more info see:
https://github.com/svenfuchs/i18n/releases/tag/v1.1.0

Successfully installed i18n-1.8.2
Fetching: thread_safe-0.3.6.gem (100%)
Successfully installed thread_safe-0.3.6
Fetching: tzinfo-1.2.6.gem (100%)
Successfully installed tzinfo-1.2.6
Fetching: zeitwerk-2.2.2.gem (100%)
Successfully installed zeitwerk-2.2.2
Fetching: activesupport-6.0.2.1.gem (100%)
Successfully installed activesupport-6.0.2.1
Fetching: rack-2.2.1.gem (100%)
Successfully installed rack-2.2.1
Fetching: rack-test-1.1.0.gem (100%)
Successfully installed rack-test-1.1.0
Fetching: mini_portile2-2.4.0.gem (100%)
Successfully installed mini_portile2-2.4.0
Fetching: nokogiri-1.10.7.gem (100%)
Building native extensions. This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20200209-18711-ifi5p4.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.5.0/gems/nokogiri-1.10.7 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.7/gem_make.out

It took some puzzling to work out that the key part of that message was:

can't find header files for ruby at /usr/lib/ruby/include/ruby.h

...suggesting that the Ruby header files (presumably in the ruby-dev package) need to be installed.

Having installed them, we will try again...

root@cloud1:~# gem install rails
Building native extensions. This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20200209-10713-el6zi0.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** 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/$(RUBY_BASE_NAME)2.5
        --help
        --clean
        --use-system-libraries
        --enable-static
        --disable-static
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --enable-cross-build
        --disable-cross-build

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.7/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.5.0/gems/nokogiri-1.10.7 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.7/gem_make.out

Presumably we just need to install zlib... but searching for "zlib" in apt came up with several packages:

zlib1g compression library - runtime
zlib1g-dbg compression library - development
zlib1g-dev compression library - development
zlibc An on-fly auto-uncompressing C library
zopfli zlib (gzip, deflate) compatible compressor

Our first guess was zlib1g, but that was already installed. Searching for the error came up with a post by someone who had solved it with zlib1g-dev, so we tried that next... and it appears to have succeeded:

root@cloud1:~# gem install rails 
Building native extensions. This could take a while...
Successfully installed nokogiri-1.10.7
Fetching: crass-1.0.6.gem (100%)
Successfully installed crass-1.0.6
Fetching: loofah-2.4.0.gem (100%)
Successfully installed loofah-2.4.0
Fetching: rails-html-sanitizer-1.3.0.gem (100%)
Successfully installed rails-html-sanitizer-1.3.0
Fetching: rails-dom-testing-2.0.3.gem (100%)
Successfully installed rails-dom-testing-2.0.3
Fetching: builder-3.2.4.gem (100%)
Successfully installed builder-3.2.4
Fetching: erubi-1.9.0.gem (100%)
Successfully installed erubi-1.9.0
Fetching: actionview-6.0.2.1.gem (100%)
Successfully installed actionview-6.0.2.1
Fetching: actionpack-6.0.2.1.gem (100%)
Successfully installed actionpack-6.0.2.1
Fetching: activemodel-6.0.2.1.gem (100%)
Successfully installed activemodel-6.0.2.1
Fetching: activerecord-6.0.2.1.gem (100%)
Successfully installed activerecord-6.0.2.1
Fetching: globalid-0.4.2.gem (100%)
Successfully installed globalid-0.4.2
Fetching: activejob-6.0.2.1.gem (100%)
Successfully installed activejob-6.0.2.1
Fetching: mini_mime-1.0.2.gem (100%)
Successfully installed mini_mime-1.0.2
Fetching: mail-2.7.1.gem (100%)
Successfully installed mail-2.7.1
Fetching: actionmailer-6.0.2.1.gem (100%)
Successfully installed actionmailer-6.0.2.1
Fetching: nio4r-2.5.2.gem (100%)
Building native extensions. This could take a while...
Successfully installed nio4r-2.5.2
Fetching: websocket-extensions-0.1.4.gem (100%)
Successfully installed websocket-extensions-0.1.4
Fetching: websocket-driver-0.7.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed websocket-driver-0.7.1
Fetching: actioncable-6.0.2.1.gem (100%)
Successfully installed actioncable-6.0.2.1
Fetching: mimemagic-0.3.4.gem (100%)
Successfully installed mimemagic-0.3.4
Fetching: marcel-0.3.3.gem (100%)
Successfully installed marcel-0.3.3
Fetching: activestorage-6.0.2.1.gem (100%)
Successfully installed activestorage-6.0.2.1
Fetching: actionmailbox-6.0.2.1.gem (100%)
Successfully installed actionmailbox-6.0.2.1
Fetching: actiontext-6.0.2.1.gem (100%)
Successfully installed actiontext-6.0.2.1
Fetching: thor-1.0.1.gem (100%)
Successfully installed thor-1.0.1
Fetching: method_source-0.9.2.gem (100%)
Successfully installed method_source-0.9.2
Fetching: railties-6.0.2.1.gem (100%)
Successfully installed railties-6.0.2.1
Fetching: bundler-2.1.4.gem (100%)
Successfully installed bundler-2.1.4
Fetching: sprockets-4.0.0.gem (100%)
Successfully installed sprockets-4.0.0
Fetching: sprockets-rails-3.2.1.gem (100%)
Successfully installed sprockets-rails-3.2.1
Fetching: rails-6.0.2.1.gem (100%)
Successfully installed rails-6.0.2.1
Parsing documentation for nokogiri-1.10.7
Installing ri documentation for nokogiri-1.10.7
Parsing documentation for crass-1.0.6
Installing ri documentation for crass-1.0.6
Parsing documentation for loofah-2.4.0
Installing ri documentation for loofah-2.4.0
Parsing documentation for rails-html-sanitizer-1.3.0
Installing ri documentation for rails-html-sanitizer-1.3.0
Parsing documentation for rails-dom-testing-2.0.3
Installing ri documentation for rails-dom-testing-2.0.3
Parsing documentation for builder-3.2.4
Installing ri documentation for builder-3.2.4
Parsing documentation for erubi-1.9.0
Installing ri documentation for erubi-1.9.0
Parsing documentation for actionview-6.0.2.1
Installing ri documentation for actionview-6.0.2.1
Parsing documentation for actionpack-6.0.2.1
Installing ri documentation for actionpack-6.0.2.1
Parsing documentation for activemodel-6.0.2.1
Installing ri documentation for activemodel-6.0.2.1
Parsing documentation for activerecord-6.0.2.1
Installing ri documentation for activerecord-6.0.2.1
Parsing documentation for globalid-0.4.2
Installing ri documentation for globalid-0.4.2
Parsing documentation for activejob-6.0.2.1
Installing ri documentation for activejob-6.0.2.1
Parsing documentation for mini_mime-1.0.2
Installing ri documentation for mini_mime-1.0.2
Parsing documentation for mail-2.7.1
Installing ri documentation for mail-2.7.1
Parsing documentation for actionmailer-6.0.2.1
Installing ri documentation for actionmailer-6.0.2.1
Parsing documentation for nio4r-2.5.2
Installing ri documentation for nio4r-2.5.2
Parsing documentation for websocket-extensions-0.1.4
Installing ri documentation for websocket-extensions-0.1.4
Parsing documentation for websocket-driver-0.7.1
Installing ri documentation for websocket-driver-0.7.1
Parsing documentation for actioncable-6.0.2.1
Installing ri documentation for actioncable-6.0.2.1
Parsing documentation for mimemagic-0.3.4
Installing ri documentation for mimemagic-0.3.4
Parsing documentation for marcel-0.3.3
Installing ri documentation for marcel-0.3.3
Parsing documentation for activestorage-6.0.2.1
Installing ri documentation for activestorage-6.0.2.1
Parsing documentation for actionmailbox-6.0.2.1
Installing ri documentation for actionmailbox-6.0.2.1
Parsing documentation for actiontext-6.0.2.1
Installing ri documentation for actiontext-6.0.2.1
Parsing documentation for thor-1.0.1
Installing ri documentation for thor-1.0.1
Parsing documentation for method_source-0.9.2
Installing ri documentation for method_source-0.9.2
Parsing documentation for railties-6.0.2.1
Installing ri documentation for railties-6.0.2.1
Parsing documentation for bundler-2.1.4
Installing ri documentation for bundler-2.1.4
Parsing documentation for sprockets-4.0.0
Installing ri documentation for sprockets-4.0.0
Parsing documentation for sprockets-rails-3.2.1
Installing ri documentation for sprockets-rails-3.2.1
Parsing documentation for rails-6.0.2.1
Installing ri documentation for rails-6.0.2.1
Done installing documentation for nokogiri, crass, loofah, rails-html-sanitizer, rails-dom-testing, builder, erubi, actionview, actionpack, activemodel, activerecord, globalid, activejob, mini_mime, mail, actionmailer, nio4r, websocket-extensions, websocket-driver, actioncable, mimemagic, marcel, activestorage, actionmailbox, actiontext, thor, method_source, railties, bundler, sprockets, sprockets-rails, rails after 38 seconds
32 gems installed

2020-02-10

Redmine config

Looking through my main Redmine documentation, I saw mention of Redmine/rake, and the rake about command which reports on what Rails frameworks are available. I figured that if nothing else, Rails needs to be available.

root@cloud1:~# rake about
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)

(See full trace by running task with --trace)

Okay, so maybe we need to be in Redmine's project folder...

root@cloud1:~# cd /home/vbzo/domains/rm.vbz.ovh/site/svn/redmine-4.1
root@cloud1:/home/vbzo/domains/rm.vbz.ovh/site/svn/redmine-4.1# rake about
Please configure your config/database.yml first
Could not find gem 'rails (= 5.2.4.1)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.

This feels a bit like skipping around arbitrarily, but maybe I should run bundle install at this point?

Part of the problem may be that I installed Rails 6, but Redmine is apparently configured to demand 5.2.4.1 and nothing else...

root@cloud1:/home/vbzo/domains/rm.vbz.ovh/site/svn/redmine-4.1# bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Please configure your config/database.yml first
Please configure your config/database.yml first
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.                                                                                      
The dependency ffi (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.                                                                                              
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching rake 13.0.1
Installing rake 13.0.1
Using concurrent-ruby 1.1.5
Fetching i18n 1.6.0
Installing i18n 1.6.0
Fetching minitest 5.14.0
Installing minitest 5.14.0
Using thread_safe 0.3.6
Using tzinfo 1.2.6
Fetching activesupport 5.2.4.1
Installing activesupport 5.2.4.1
Using builder 3.2.4
Using erubi 1.9.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.7
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.4.0
Using rails-html-sanitizer 1.3.0
Fetching actionview 5.2.4.1
Installing actionview 5.2.4.1
Using rack 2.2.1
Using rack-test 1.1.0
Fetching actionpack 5.2.4.1
Installing actionpack 5.2.4.1
Using nio4r 2.5.2
Using websocket-extensions 0.1.4
Using websocket-driver 0.7.1
Fetching actioncable 5.2.4.1
Installing actioncable 5.2.4.1
Using globalid 0.4.2
Fetching activejob 5.2.4.1
Installing activejob 5.2.4.1
Using mini_mime 1.0.2
Using mail 2.7.1
Fetching actionmailer 5.2.4.1
Installing actionmailer 5.2.4.1
Using method_source 0.9.2
Using thor 1.0.1
Fetching railties 5.2.4.1
Installing railties 5.2.4.1
Fetching actionpack-xml_parser 2.0.1
Installing actionpack-xml_parser 2.0.1
Fetching activemodel 5.2.4.1
Installing activemodel 5.2.4.1
Fetching arel 9.0.0
Installing arel 9.0.0
Fetching activerecord 5.2.4.1
Installing activerecord 5.2.4.1
Using mimemagic 0.3.4
Using marcel 0.3.3
Fetching activestorage 5.2.4.1
Installing activestorage 5.2.4.1
Fetching public_suffix 4.0.3
Installing public_suffix 4.0.3
Fetching addressable 2.7.0
Installing addressable 2.7.0
Fetching ast 2.4.0
Installing ast 2.4.0
Using bundler 2.1.4
Fetching regexp_parser 1.6.0
Installing regexp_parser 1.6.0
Fetching xpath 3.2.0
Installing xpath 3.2.0
Fetching capybara 3.25.0
Installing capybara 3.25.0
Fetching childprocess 3.0.0
Installing childprocess 3.0.0
Fetching css_parser 1.7.1
Installing css_parser 1.7.1
Fetching csv 3.1.2
Installing csv 3.1.2
Fetching docile 1.3.2
Installing docile 1.3.2
Fetching htmlentities 4.3.4
Installing htmlentities 4.3.4
Fetching jaro_winkler 1.5.4
Installing jaro_winkler 1.5.4 with native extensions
Fetching json 2.3.0
Installing json 2.3.0 with native extensions
Fetching mini_magick 4.9.5
Installing mini_magick 4.9.5
Fetching mocha 1.11.2
Installing mocha 1.11.2
Fetching net-ldap 0.16.2
Installing net-ldap 0.16.2
Fetching parallel 1.19.1
Installing parallel 1.19.1
Fetching parser 2.7.0.2
Installing parser 2.7.0.2
Fetching puma 3.12.2
Installing puma 3.12.2 with native extensions
Fetching ruby-openid 2.9.2
Installing ruby-openid 2.9.2
Fetching rack-openid 1.4.2
Installing rack-openid 1.4.2
Using sprockets 4.0.0
Using sprockets-rails 3.2.1
Fetching rails 5.2.4.1
Installing rails 5.2.4.1
Fetching rainbow 3.0.0
Installing rainbow 3.0.0
Fetching rbpdf-font 1.19.1
Installing rbpdf-font 1.19.1
Fetching rbpdf 1.20.1
Installing rbpdf 1.20.1
Fetching redcarpet 3.5.0
Installing redcarpet 3.5.0 with native extensions
Fetching request_store 1.4.1
Installing request_store 1.4.1
Fetching roadie 4.0.0
Installing roadie 4.0.0
Fetching roadie-rails 2.1.1
Installing roadie-rails 2.1.1
Fetching rouge 3.12.0
Installing rouge 3.12.0
Fetching ruby-progressbar 1.10.1
Installing ruby-progressbar 1.10.1
Fetching unicode-display_width 1.6.1
Installing unicode-display_width 1.6.1
Fetching rubocop 0.76.0
Installing rubocop 0.76.0
Fetching rubocop-performance 1.5.2
Installing rubocop-performance 1.5.2
Fetching rubocop-rails 2.3.2
Installing rubocop-rails 2.3.2
Fetching rubyzip 2.2.0
Installing rubyzip 2.2.0
Fetching selenium-webdriver 3.142.7
Installing selenium-webdriver 3.142.7
Fetching simplecov-html 0.10.2
Installing simplecov-html 0.10.2
Fetching simplecov 0.17.1
Installing simplecov 0.17.1
Fetching yard 0.9.24
Installing yard 0.9.24
Bundle complete! 30 Gemfile dependencies, 81 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from i18n:

HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.

Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.

For more info see:
https://github.com/svenfuchs/i18n/releases/tag/v1.1.0

I don't get why "installing your bundle as root will break this application for all non-root users on this machine", since as far as I can tell they're always installed as root-owned. The old install on cloud4, which was done with apt, has /var/lib/gems and all its contents owned by root, so I think that's the way it's supposed to be. Maybe the Gemfile gets root-owned? That'll get taken care of later when I re-chown the Redmine project folder (before trying to run it).

root@cloud1:~# cd /home/vbzo/domains/rm.vbz.ovh/site/svn/
root@cloud1:/home/vbzo/domains/rm.vbz.ovh/site/svn# ls -al
total 12
drwxr-xr-x  3 vbzo vbzo 4096 Feb 10 15:50 .
drwxr-xr-x  4 vbzo vbzo 4096 Feb  9 12:38 ..
drwxr-xr-x 18 root root 4096 Feb 10 15:36 redmine-4.1
root@cloud1:/home/vbzo/domains/rm.vbz.ovh/site/svn# chown -R vbzo:vbzo redmine-4.1

Redmine folder setup

Removing the original public_html folder because it's empty and I want to use Redmine's public folder for that. I could point Apache directly at <redmine folder>/public, but when given a choice I'll do things where reconfiguration does not require restarting anything.

root@cloud1:/home/vbzo/domains/rm.vbz.ovh/site/svn# cd redmine-4.1/
root@cloud1:/home/vbzo/domains/rm.vbz.ovh/site/svn/redmine-4.1# rmdir ../../../public_html/
root@cloud1:/home/vbzo/domains/rm.vbz.ovh/site/svn/redmine-4.1# ln -rs public ../../../public_html

2020-02-12

It remains unclear where Redmine (especially the new one) expects config files to be.

On cloud4 (old installation), configuration files are in /etc/redmine/default, which is linked from the main project folder:

/usr/share/redmine/instances/default/config

is a link to

/etc/redmine/default

-- but where is it set that Redmine expects to see instance-configuration folders in <redmine-folder>/instances? New Redmine doesn't have an instances folder.

Looking through the new install for anything that might be pointing at configuration files/folders, I found appveyor.yml, but that seems to be part of something called AppVeyor which is some kind of continuous-integration service (i.e. part of Redmine's development process) and not part of installing or running an instance.

Skipping around a bit -- when I try to access the instance, I get this error:

2020-02-12.screen.Forbidden error.png

This looked like an Apache error, so I checked Apache's error log and it seems to support this:

[Wed Feb 12 20:18:22.406987 2020] [autoindex:error] [pid 28388] [client 107.15.53.219:5345] AH01276: Cannot serve directory /home/vbzo/domains/rm.vbz.ovh/public_html/: No matching DirectoryIndex (index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive

I had changed the DirectoryIndex (in Apache's config for this domain) to dispatch.fcgi, which evidence suggests is what Redmine uses for an index file, but the error suggests that Apache is still looking for index.* files.

I thought I had restarted Apache after making that change but apparently I hadn't, because restarting it resulted in a different error:

2020-02-12.screen.Internal Server Error.png

Looking for evidence of how Apache is supposed to be configured for .fcgi files... The new Redmine comes with a file called htaccess.fcgi.example which one presumes is supposed to be renamed .htaccess (or maybe htaccess.fcgi? and how would that get invoked?) but there are no instructions.

In any case, that file contains the code:

<IfModule mod_fastcgi.c>
    AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
    AddHandler fcgid-script .fcgi
</IfModule>

Meanwhile, the site-config on cloud4 (old server) has this:

       Options +ExecCGI
       AddHandler cgi-script .fcgi
       DirectoryIndex dispatch.fcgi
       # RAILS-SPECIFIC STUFF
       
       RailsBaseURI /
       PassengerUser vbz-net

I copied those lines into the site-config on cloud1 (new server), but Apache didn't like them. Investigation revealed that RailsBaseURI is the first problem -- presumably Rails directives aren't being recognized because Apache needs a Rails module enabled.

Disabling those two lines for now leaves us with this in the Apache error log:

[Thu Feb 13 01:03:23.890549 2020] [cgi:error] [pid 5631] [client 107.15.53.219:55937] AH01215: Please configure your config/database.yml first: /home/vbzo/domains/rm.vbz.ovh/public_html/dispatch.fcgi

This is at least a clue towards the "where should the config files go" question.

At that point I copied the two .example files to new names:

  • configuration.yml.exampleconfiguration.yml
  • database.yml.exampledatabase.yml

I still don't know where they are supposed to go, but now maybe I have a test to see if they're in the right place? I've put the renamed copies in the same folder as the original example files.

2020-02-13

I'd imported the Redmine database earlier but not created a user for it; did that now, and configured database.yml with the appropriate credentials. I now get this error in Apache's log:

[Thu Feb 13 14:37:21.489459 2020] [cgi:error] [pid 1539] [client 107.15.53.219:29345] AH01215: /var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/resolver.rb:290:in `block in verify_gemfile_dependencies_are_found!': /home/vbzo/domains/rm.vbz.ovh/public_html/dispatch.fcgi [Thu Feb 13 14:37:21.489940 2020] [cgi:error] [pid 1539] [client 107.15.53.219:29345] AH01215: : Could not find gem 'mysql2 (~> 0.5.0)' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound): /home/vbzo/domains/rm.vbz.ovh/public_html/dispatch.fcgi

followed by what looks like an execution-stack trace.

I think this means I need to install the mysql2 gem, which I think I might know how to do.

I'm testing a theory about why gem sometimes complains about being run as root, so I ran it as root:

root@cloud1:/home/vbzo/domains/rm.vbz.ovh/site/svn/redmine-4.1# gem install mysql2
Fetching: mysql2-0.5.3.gem (100%)
Building native extensions. This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.5.0/gems/mysql2-0.5.3/ext/mysql2
/usr/bin/ruby2.5 -r ./siteconf20200213-8027-8ztdkh.rb extconf.rb
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_wait_for_single_fd()... yes
checking for -lmysqlclient... no
-----
mysql client is missing. You may need to 'sudo apt-get install libmariadb-dev', 'sudo apt-get install libmysqlclient-dev' or 'sudo yum install mysql-devel', and try again.
-----
*** 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/$(RUBY_BASE_NAME)2.5
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysql-config
        --without-mysql-config
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysqlclientlib
        --without-mysqlclientlib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/mysql2-0.5.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.5.0/gems/mysql2-0.5.3 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/mysql2-0.5.3/gem_make.out

Looking at mkmf.log, the key seems to be lines ending in "-------------------- <yes/no>", where the first and only "no" line is:

find_library: checking for -lmysqlclient... -------------------- no

So presumably I need to install lmysqlclient. (From apt, I hope?)

This article suggested that the package might be called libmysqlclient-dev, so I searched apt for "libmysql" and found default-libmysqlclient-dev, which I installed.

I then tried gem install again:

root@cloud1:/home/vbzo/domains/rm.vbz.ovh/site/svn/redmine-4.1# gem install mysql2
Building native extensions. This could take a while...
Successfully installed mysql2-0.5.3
Parsing documentation for mysql2-0.5.3
Installing ri documentation for mysql2-0.5.3
Done installing documentation for mysql2 after 0 seconds
1 gem installed

...and all appears right with the world.

Now what error do we get?

[Thu Feb 13 19:19:58.871510 2020] [cgi:error] [pid 28015] [client 107.15.53.219:7649] AH01215: /var/lib/gems/2.5.0/gems/yard-0.9.24/lib/yard/config.rb:95:in `expand_path': couldn't find login name -- expanding `~' (ArgumentError): /home/vbzo/domains/rm.vbz.ovh/public_html/dispatch.fcgi