Snorby in CentOS 6.5

snorby_newHi, this is me again. This time I’m offering an update of my old post about how to install Snorby on CentOS as some readers have found some errors and problems. Though I’ve created this post for CentOS 6.5, this article may help you also if you’re trying to install Snorby on CentOS 6.4.

Now it’s easier to use wkhtmltopdf and I’ve also added a section to make the installation of ruby cleaner. Ok let’s start!

First, we’re installing some packages and we’re also going to install the EPEL repository.

yum install
yum groupinstall "Development Tools"
yum install openssl-devel readline-devel libxml2-devel libxslt-devel mysql mysql-devel mysql-libs mysql-server urw-fonts libX11-devel libXext-devel fontconfig-devel libXrender-devel unzip wget xorg-x11-server-Xvfb libyaml libyaml-devel gdbm-devel tcl-devel db4-devel libffi-devel 

Now we are going to download and compile ImageMagick.

cd /opt
tar xvfz ImageMagick.tar.gz
cd ImageMagick-*
make install
ldconfig /usr/local/lib

OK, time for wkhtmltopdf. In the past I had problems with the static version, that’s why I decided to compile it. The latest version works fine for me. Visit and download the latest wkhtmltopdf for your Linux architecture 32 bits or 64 bits. I’m using the 64 bits version.

cd /opt
tar xvf wkhtmltox-linux-amd64_0.12.0-03c001d.tar.xz
ln -s /opt/wkhtmltox/lib/ /usr/local/lib64/
ln -s /opt/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
ldconfig /usr/local/lib64

Thanks to this article I’ve used the instructions to create the rpm package for Ruby 1.9.3

cd /root
wget -P rpmbuild/SOURCES
wget -P rpmbuild/SPECS
rpmbuild -bb rpmbuild/SPECS/ruby19.spec
yum localinstall /root/rpmbuild/RPMS/x86_64/ruby-1.9.3p484-1.el6.x86_64.rpm

Now we’re going to install bundler and Snorby

cd /opt
gem install bundler
wget -O --no-check-certificate
cd snorby-master

I’ve created an empty database for Snorby and I’ve configured a user with permissions for that database:

# mysql -u root -p 
Enter password: 
mysql> create database snorby; 
Query OK, 1 row affected (0.14 sec) 
mysql> grant all privileges on snorby.* to snorby@localhost identified by 'snorby'; 
Query OK, 0 rows affected (0.06 sec) 

We’ve to create a database.yml config file and edit it. We’ll add the database password, the name of the database and the MySQL server hostname or IP address:

cp config/database.yml.example config/database.yml

//This is the content of my file
snorby: &snorby 
 adapter: mysql 
 username: snorby 
 password: "snorby" 
 host: localhost

OK, I hope you’re following and you’ve no errors so far. Edit the Gemfile file and follow these instructions:

Change: gem 'rake', '0.9.2' to gem 'rake', '> 0.9.2' 
Add: gem 'thin' after gem 'json' so it shows like this:
gem 'json', '~> 1.7' 
gem 'thin' 
Comment the gem 'thin' line inside the group(:development) using a #. The files will look like this:

group(:development) do 
        gem "letter_opener" 
#  gem 'thin' 

Add: gem 'orm_adapter' after gem 'netaddr' so it shows like this:
gem 'netaddr','~> 1.5.0' 
gem 'orm_adapter'

We’re close. Edit the Gemfile.lock file.

Change the line rake (0.9.2) to rake (

We need a snorby_config.yml. Then you can edit thing like the domain for your Snorby installation. You have more information about configuration in Snorby’s official page.

cp config/snorby_config.yml.example config/snorby_config.yml

Let’s install Snorby. If installation is successful we’ll launch it using the thin server (thanks for the tip Mephux and of course thank you for Snorby)

bundle install
rake snorby:setup
rails server thin -e production

If everything is fine you’ll have Snorby listening on, if you want to open the port use this iptables rule (adjust it for your needs of course 🙂 )

iptables -I INPUT -p tcp --dport 3000 -m state --state=NEW,ESTABLISHED,RELATED -j ACCEPT

And that’s it! Snorby is showing the login (user: password: snorby) and the export to PDF function is working for me. I’ll try to offer more information about Snorby in the future.

Thank you Parvez and W.White for your comments and please let me know if you find errors.



18 thoughts on “Snorby in CentOS 6.5

  1. W. White says:

    Thank me for my comment…..No, thank you for writing this awesome article. I can login the interface. I still have to configure Barnyard2 on my pfSense to write to the MySQL DB but just the fact that I can get the packages installed and login successfully on the first go around totally made my day. Much appreciated!!! I’ll keep you posted when I have my setup totally configured or if I need to pick your brain.


  2. morteza says:

    hi admin
    when I run bundle install see this error
    Bundler::GemspecError: Could not read gem at /usr/lib64/ruby/gems/1.9.1/cache/selenium-webdriver-2.31.0.gem. It may be corrupted.
    An error occurred while installing selenium-webdriver (2.31.0), and Bundler cannot continue.
    Make sure that `gem install selenium-webdriver -v ‘2.31.0’` succeeds before bundling.


    • n40lab says:

      I know little about Ruby, sorry. Have you tried to execute the suggested command: gem install selenium-webdriver -v ‘2.31.0’? Maybe it’s just a problem with the ruby version, did you install the version I suggested in the post?



  3. Ed says:

    After modifying the Snorby Gemfile, Gemfile.lock, config/snorby_config.yml, and config/database.yml files, When I run bundle install I get

    fatal: HTTP request failed
    Retrying git clone ‘’ “/usr/local/lib/ruby/gems/1.9.1/cache/bundler/git/snorby_cas_authenticatable-4d557bf2e5955e3502ea202f9a5172c903186bff” –bare –no-hardlinks due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git clone ‘’ “/usr/local/lib/ruby/gems/1.9.1/cache/bundler/git/snorby_cas_authenticatable-4d557bf2e5955e3502ea202f9a5172c903186bff” –bare –no-hardlinks` in directory /opt/snorby-master has failed.



    • n40lab says:

      I assume you’re trying to use the git version of Snorby, is that right? I’ve tried to execute the following command: git clone and I can clone the github repository, maybe were you facing a network connection problem temporarily?

      If you are following my steps and you’re using the Snorby stable version check if there’s a typo in the Gemfile, Gemfile.lock, config/snorby_config.yml, or config/database.yml. If you still have problems let me know and I’d try to send you my files…

      I’m sorry you’re facing problems,



  4. Ed says:

    if I try the –deployment flag…….

    bundle install –deployment

    You are trying to install in deployment mode after changing
    your Gemfile. Run `bundle install` elsewhere and add the
    updated Gemfile.lock to version control.

    You have added to the Gemfile:
    * source: (at master)
    * source: (at rails3)
    * source: (at master)
    * rake (> 0.9.2)
    * orm_adapter

    You have deleted from the Gemfile:
    * source: (at master)
    * source: (at master)
    * source: (at rails3)
    * rake (= 0.9.2)

    You have changed in the Gemfile:
    * devise_cas_authenticatable from ` (at master)` to `no specified source`
    * ezprint from ` (at rails3)` to `no specified source`
    * delayed_job_data_mapper from ` (at master)` to `no specified source`

    I don’t really know Ruby, so I’m not sure how to trouble shoot. What did I do wrong?



  5. morteza says:

    Hi Admin
    when I run this command(rpmbuild -bb rpmbuild/SPECS/ruby19.spec) see this error in rpmbuild “error: File /root/rpmbuild/SOURCES/ruby-1.9.3-p545.tar.gz: No such file or directory”


  6. Procrastinator says:

    It works fine on CentOS 7.
    I’ve just replaced MySQL by MariaDB.

    yum -y install mariadb mariadb-devel mariadb-libs mariadb-server
    systemctl start mariadb
    systemctl enable mariadb

    Thank you so much !


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s