Skip to content
afred edited this page Feb 13, 2014 · 25 revisions

Boston Local TV News Catalog

The Boston Local TV News Catalog is a Blacklight application.

  • Ruby on Rails
  • Blacklight (a rails engines plugin) for the User Interface
  • Solr (a java application, also ported to other languages) for the Search Engine

IMPORTANT NOTES ABOUT RUNNING ON PRODUCTION SERVER lsboslocal.wgbh.org

Starting up the webserver

Production is running with Passenger Apache module, which should start along with Apache. Rails should then automatically be running, as long as Passenger config is set correctly.

Restarting Jetty

The home page and the blog do not require jetty to be running. However, doing searches and viewing details pages require Solr, so all the Rails objets that interact with the Solr (namely Blacklight and RSolr) need to be able to access the Solr REST api being served out of jetty.

There are several ways to start jetty, but on Production, you have to do it like this:

  1. First, it's important that only 1 jetty process is running at a time, so be sure to stop all others:

    # this will print out all the jetty process. There really shouldn't be more than one, but if there are
    # and you still want to restart jetty, you need to kill them all.
    $ ps aux | grep jetty
    root      6488  0.6  6.6 701556 137304 ?       Sl   14:13   0:17 /usr/bin/java -Xms128M -Xmx256M -Djetty.home=/wgbh/http/bostonlocaltv2/blacklight-app/jetty -Djava.io.tmpdir=/tmp -jar /wgbh/http/bostonlocaltv2/blacklight-app/jetty/start.jar
    # The process id (pid) is the number in the 2nd column. Kill it with...
    $ kill 6488
    
  2. Once you are sure there are no other jetty processes running, restart it like this:

    $ sudo /sbin/service jetty-bostonlocaltv start
    

Do not use rake jetty:start or rake jetty:stop. These rake tasks come from a gem called jettywrapper, but we are not using it in production.

Jetty / Solr port number: Blacklight communicates with Solr through a REST api served by jetty on a specific port. That port is specified in jetty/etc/jetty.xml (at time of writing, port is 8181). Do not change this. The url and port that Blacklight uses to query Solr is specified in config/solr.yml at ruby production: url: http://lsboslocal.wgbh.org:8181/solr/production As long as these port numbers match, things should be ok. There is another file called config/jetty.yml, but you can ignore the settings here. Those are used by jettywrapper rake tasks, which we are not using in production.

Restarting Rails

Passenger will restart Rails when it detects a change in the modification time of the file tmp/restart.txt inside your Rails app. So to restart Rails, simply do:

```bash
$ cd /wgbh/http/bostonlocaltv2/blacklight-app
$ touch tmp/restart.txt
```

The next request made to the webserver will reload all of Rails, which will take a few moments longer than normal. But once Rails is reloaded, the app should perform as it normally does.

Topics