-
Notifications
You must be signed in to change notification settings - Fork 225
Ubuntu 1.9.2 without RVM by Eric Peters
Let’s install Ruby 1.9.2 and Rails 3 stable on Ubuntu. I’m going to use just one Ruby version so I'm not going to use RVM (Ruby Version Manager) and this will be built from source. This is valid for Ubuntu 10.04, 32 bit. And possibly (not tested) on 64bit and older versions.
We are going to need to install required files to compile Ruby
sudo apt-get install gcc g++ build-essential libssl-dev libreadline5-dev zlib1g-dev linux-headers-generic libsqlite3-dev libxslt-dev libxml2-dev imagemagick libmysqlclient-dev libmagick9-dev
Now download Ruby 1.9.2 sources, unpack them and install:
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p0.tar.gz tar -xvzf ruby-1.9.2-p0.tar.gz cd ruby-1.9.2-p0/ ./configure --prefix=/usr/local/ruby & make && sudo make install
Add path to binary Ruby files. You need to add in the PATH variable that path - /usr/local/ruby/bin, should look something like this:
sudo gedit /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin"
Then run the source command for the file /etc/environment to apply changes.
source /etc/environment
Now check is Ruby installed properly: You should see something like this:''ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux] ''
ruby -v
Now create a symbolic link for ruby and gem program
sudo ln -s /usr/local/ruby/bin/ruby /usr/local/bin/ruby sudo ln -s /usr/local/ruby/bin/gem /usr/bin/gem
Ruby 1.9.2 is already includes Rubygems, so you do not have to install it.
Now install the required gem packages, including Rails 3.:
sudo gem install tzinfo builder memcache-client rack rack-test erubis mail text-format bundler thor i18n sqlite3-ruby sudo gem install rack-mount --version=0.4.0 sudo gem install rails --version 3.0.0
Check Rails version:
rails -v
You should see the version number 3.0.0. Otherwise, try to execute command source /etc/environment and enter rails -v command once again.
Create a directory for the snorby files and change to that directory, then download the latest bleeding edge release via git.
git clone git://github.com/Snorby/snorby.git
Install Gem Dependencies (we already installed bundler earlier)
bundle install
Run The Snorby Setup
rake snorby:setup
Note If you get the following error: No such file or directory - /root/snorby/tmp/snorby_packaged_uncompressed.js Create the following directories in the Snorby root dir: log/ & tmp/
mkdir log mkdir tmp
Edit The Snorby Configuration File, this should be self explanatory.
gedit snorby/config/snorby_config.yml
Edit The Snorby Mail Configurations
gedit snorby/config/initializers/mail_config.rb
One thing we have to check and make sure there is only one version of the i18n gem installed. We will want to remove the 0.5.0 version.
gem uninstall i18n Select gem to uninstall: 1. i18n-0.4.2 2. i18n-0.5.0 3. All versions > 2 Successfully uninstalled i18n-0.5.0
One more file to edit and we should be done. We need to edit snorby/script/rails and change the first line to match your enviroment: eg..
gedit script/rails
For my enviroment I replaced the first line
#!/usr/bin/env ruby
with
#!/usr/local/ruby/bin/ruby
Once all options have been configured we can now try and start it up. From the base Snorby dir run:
rails s
Make sure you start the Snorby Worker from the Administration page. Or if that fails to start the worker, we can start it by hand by a couple ways listed bellow.
ruby script/delayed_job start rails runner 'Snorby::Jobs::SensorCacheJob.new(false).perform; Snorby::Jobs::DailyCacheJob.new(false).perform'
or
rails c Loading development environment (Rails 3.0.3) irb(main):001:0>Snorby::Worker.start irb(main):002:0>Snorby::Jobs::SensorCacheJob.new(false).perform; irb(main):003:0>Snorby::Jobs::DailyCacheJob.new(false).perform
Note: If your sensor is not listed under sensors restart Snort and it should show up.