Adapt Gemfile and doc/index.rbx to rack. Installing needed bundles with Ruby 2.3 via /usr/local/bin/bundle install --path vendor/bundle
. Starting it using /usr/local/bin/bundle exec ruby doc/index.rbx
. Copying etc/config.yml to ~/git/steinwies.ch/etc
.
Added the call method to to src/util/app.rb. Now it displays the index page, but hangs afterwards unless I insert a binding.pry statement just before the last statement in the call method. Also the URL is not parsed correctly. Also the CSS is not loaded. Also the content-type is not set correctly to text/html;charset=UTF-8
. Adding a doc/config.ru to be
After debugging this problem with httpfox, if shows clearly, that GET /steinwies.css HTTP/1.1
via the URL http://resources/steinwies.css fails. Must correct the way how rack and sbsm interact to return a the complete URI.
While trying to debug this problem, I did set a binding.pry statement in the htmlgrid/lib/link.rb. This throws an error, as pry i not available. Starting bin/steinwies process also via bundle exec and not via daemontools.
Installing Apache passenger with the help of the following tutorial: https://www.phusionpassenger.com/library/install/apache/install/oss/rubygems_rvm/
Created a /etc/apache2/modules.d/22_mod_passenger.conf with the following content:
LoadModule passenger_module /home/niklaus/git/steinwies.ch/vendor/ruby/2.3.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /home/niklaus/git/steinwies.ch/vendor/ruby/2.3.0/gems/passenger-5.0.30 PassengerDefaultRuby /usr/local/bin/ruby231 </IfModule>
Removed obsolete /usr/local/bin/passenger of April 2016
Resuming: steps were
Now creating a new /etc/apache2/vhosts.d/steinwies_rack.conf. The apache server now does now start, but gives the following error for Steinwies.
==> log/error_log <== [Mon Oct 10 13:04:57 2016] [error] mod_ruby: error in ruby [Mon Oct 10 13:04:57 2016] [error] mod_ruby: /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/basic_specification.rb:62:in `file?': Insecure operation - file? (SecurityError) [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/basic_specification.rb:62:in `block (2 levels) in contains_requirable_file?' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/basic_specification.rb:62:in `each' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/basic_specification.rb:62:in `any?' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/basic_specification.rb:62:in `block in contains_requirable_file?' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/basic_specification.rb:60:in `each' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/basic_specification.rb:60:in `any?' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/basic_specification.rb:60:in `contains_requirable_file?' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:68:in `block in require' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:67:in `each' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:67:in `find' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:67:in `require' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /var/www/steinwies.ch/doc/index.rbx:4:in `<top (required)>' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/1.9.1/apache/ruby-run.rb:53:in `load' [Mon Oct 10 13:04:57 2016] [error] mod_ruby: from /usr/local/lib/ruby/1.9.1/apache/ruby-run.rb:53:in `handler'
Configuration for Steinwies is Attach:steinwies_rack.conf.txt.
Stopped the Apache web server and added the following conf file /etc/nginx/sites-enabled/steinwies_rack
. Attach:steinwies_rack.txt. Restarted nginx and now I get the Umlaut correctly, but still failures to load the css. (The page is shown only after a timeout of about 120 seconds)
Umlauts are correct now.
Zeno added the proxy module to Apache. Stopped nginx and restarted Apache with the changed config. This seems to work.
<VirtualHost *:80> Servername steinwies.ngiger.ch ServerAlias www.steinwies.ngiger.ch *.steinwies.ngiger.ch DirectoryIndex index.html index.rbx DocumentRoot /var/www/steinwies.ch/doc ProxyPass / http://127.0.0.1:9191/ ProxyPassReverse / http://127.0.0.1:9191/ ErrorLog "|/usr/sbin/cronolog -l /var/www/steinwies.ch/log/error_log /var/www/steinwies.ch/log/%Y/%m/%d/error_log" CustomLog "|/usr/sbin/cronolog -l /var/www/steinwies.ch/log/access_log /var/www/steinwies.ch/log/%Y/%m/%d/access_log" combined </VirtualHost>
Found the culprint for the missing css_link. In lookandfeel.rb _collect_resource uses the empty @session.server_name variable. Must set this variable correctly. This is done.
Apache proxypass work now. But calling steinwies.ngiger.ch now returns text/plain instead of html and I see, that loading the favicon.ico failed.
After some hard debugging found out that an exception in the drb-process did not get displayed correctly. Now i see a nice backtrace like
NoMethodError at / undefined method `bytesize' for nil:NilClass Ruby /usr/local/lib/ruby/2.3.0/cgi/core.rb: in out, line 353 Web GET steinwies.ngiger.ch/ Traceback (innermost first) /usr/local/lib/ruby/2.3.0/cgi/core.rb: in out options["length"] = content.bytesize.to_s... /home/niklaus/git/sbsm/lib/sbsm/request.rb: in drb_process @cgi.out(headers) {... /home/niklaus/git/sbsm/lib/sbsm/request.rb: in process drb_process()
Saved work with commits to branches rack:
Must fix tomorrow the problem, that text/plain is returned insted of text/html.
See also: http://dev.ywesee.com/Apache/ModProxy. Apache config /etc/conf.d/apache2
has the following line for gentoo:
APACHE2_OPTS="-D RUBY -D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PROXY -D PROXY_HTML"
Afterwards sudo emerge =apache-2.2.31
. Confirmed using sudo updatedb &&locate mod_proxy.so