Skip to content

Ubuntu installer for RapidFTR web app (offline installation)

kishoreyekkanti edited this page Feb 4, 2013 · 1 revision

== How to create Ubuntu installer for RapidFTR

Note: To perform an offline installation, you would need to download all the dependencies first. That way, you will NOT require internet during installation. To download all dependencies execute the following steps. You MUST execute these commands on a BLANK/FRESH Ubuntu machine, so that the dependencies are NOT already present on the machine. Also both machine's architecture and os versions should be same as target because some of the dependencies might not get installed on the target machine. This is tested with Ubuntu 12.04 :

We make use of fpm tool (https://github.com/jordansissel/fpm) to create a .deb installer for RapidFTR.

  1. fpm requires that RapidFTR be copied into /usr/lib/ folder before creating the installer. This ensures that when the .deb file is created, it will install RapidFTR to /usr/lib/rapidftr folder on the target machine.

    cp -r /usr/lib/rapidftr

  2. Go into rapidftr folder. cd /usr/lib/rapidftr

  3. Download all the gems required under /usr/lib/rapidftr/vendor/bundle by executing the following two commands. Also need to install bundler gem under the same dir. Make sure bundler-1.2.3.gem is present under /usr/lib/rapidftr/vendor/bundle/ruby/1.8/cache/ dir.

    bundle install --path=/usr/lib/rapidftr/vendor/bundle/ gem install bundler --install-dir=/usr/lib/rapidftr/vendor/bundle/ruby/1.8/

  4. We need to configure Rails to serve static assets (Note: Needed for "Thin server"). Change the following config in the file /usr/lib/rapidftr/config/environment/production.rb.

    config.serve_static_assets = true

  5. Install fpm. Refer to instructions in this link: https://github.com/jordansissel/fpm.

  6. Create .deb file by executing the following command:

    fpm -s dir -t deb -n "rapidftr" -v -d couchdb -d openjdk-6-jdk -d ruby1.8 -d rubygems1.8 -d imagemagick -d thin --after-install /usr/lib/rapidftr/lib/ubuntu/debian/postinstall.sh --before-remove /usr/lib/rapidftr/lib/ubuntu/debian/before_remove.sh /usr/lib/rapidftr

  7. The .deb file should get created in the current directory (from where the fpm command was fired). If this debian file is installed with the apt (Advanced packaging tool) on networked machine, apt will fetch and install all the dependencies and install the application.

== How to install the RapidFTR .deb file on a target Ubuntu Machine:

=== STEPS TO DOWNLOAD DEPENDENCIES:

  1. Create a local directory on the machine

    mkdir dependencies cd dependencies

  2. Download the dependencies into the current folder

    apt-get --print-uris --yes install couchdb imagemagick openjdk-6-jdk ruby1.8 thin libssl0.9.8 rubygems1.8 libxslt-dev libxml2-dev | grep ^' | cut -d' -f2>/tmp/dependencies.txt

    wget -i /tmp/dependencies.txt

  3. Check all the dependencies are successfully downloaded and that there are no errors printed on console.

=== STEPS TO INSTALL RAPIDFTR OFFLINE

  1. Make sure you have the .deb file, and the dependencies available on the target machine. See steps above on how to download dependencies.

  2. Install the dependencies: If Ubuntu with same version as source machine (where the dependencies are downloaded) is newly installed on the target machine use the following, this might not work if 'apt' might not be updated on target machine, so might result in version conflict of some packages. :

    apt-get -o dir::cache::archives= install couchdb imagemagick openjdk-6-jdk ruby1.8 thin libssl0.9.8 rubygems1.8 libxslt-dev libxml2-dev

    or following commands will work in any scenario

    cd

    dpkg -i *.deb

  3. Install the .deb file

    dpkg -i

  4. RapidFTR should now be installed in /usr/lib/rapidftr/.

=== To stop or start the application

Once you install RapidFTR web app, rapidftrserver file gets created under /usr/bin/. You can run this command from any directory.

rapidftrserver {start|stop|restart}
Clone this wiki locally