Snorby




 * How to i ****nstall Snorby on Ubuntu 10.04 **
 * Start with a clean install of Ubuntu 10.04 Server. Of course: **

sudo apt-get update && sudo apt-get upgrade -y && sudo reboot (patch)

**Then install the following Debian Packages:**

sudo apt-get -y install git-core apache2-prefork-dev libapr1-dev libaprutil1-dev libopenssl-ruby ruby ruby1.8-dev rubygems mysql-server apache2 rake build-essential vim libcurl4-openssl-dev

**Install the following packes for ruby using gem to avoid some nasty conflicts**:

sudo gem install rubygems-update -v='1.4.2' sudo /var/lib/gems/1.8/bin/update_rubygems sudo gem install --no-rdoc --no-ri prawn -v 0.12.0 sudo gem install --no-rdoc --no-ri prawn -v 0.5.0.1 sudo gem install --no-rdoc --no-ri mysql sudo gem install --no-rdoc --no-ri passenger sudo gem install --no-rdoc --no-ri -v=2.3.2 rails sudo gem uninstall rake sudo gem install --no-rdoc --no-ri rake -v 0.8.7

**Symlink the Custom gems packages to the bin**

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">sudo ln -s /var/lib/gems/1.8/bin/pass* /usr/bin

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">**Create the database and grant privileges to the snorby user**

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">mysqladmin -u root -p create snorby <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">mysql -u root -p <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">mysql> CREATE USER 'snorby'@'localhost' IDENTIFIED BY 'password'; <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">mysql> GRANT ALL PRIVILEGES ON snorby.* TO 'snorby'@'localhost' WITH GRANT OPTION;

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">**Git Clone Snorby and move it into /var/www and configure the DB and E-Mail Conns.**

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">git clone git://github.com/mephux/Snorby.git

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">sudo mv Snorby/* /var/www/ <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">rm -rf Snorby/

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">sudo cp /var/www/config/database.yml.example /var/www/config/database.yml

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">sudo nano /var/www/config/database.yml

__<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">edit it to match your db info __

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">sudo cp /var/www/config/email.yml.example /var/www/config/email.yml

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">sudo nano /var/www/config/email.yml **(optional)**

__<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">edit it to match email params if you want them __

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">cd /var/www/

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">**Build Snorby**

sudo nano /var/www/Rakefile __add " require 'thread' "(without the double quotes) before "require 'rake'"__ <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">sudo rake snorby:setup RAILS_ENV=production

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">**Install Passenger for Apache**

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">sudo passenger-install-apache2-module <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">sudo nano /etc/apache2/apache2.conf

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">Add the following lines: (__follow the output of the passenger-install-apache2-module tool__)

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">PassengerRoot /var/lib/gems/1.8/gems/passenger-2.2.15

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">PassengerRuby /usr/bin/ruby1.8

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">**Modify the Apache config to support Passenger and Rails applications**

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">sudo nano /etc/apache2/sites-available/default

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">Modify the top portion of the default site to look like this:

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;"><VirtualHost *:80> <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">ServerAdmin webmaster@localhost

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">DocumentRoot /var/www/public <span style="font-family: 'Times New Roman','serif'; font-size: 16px;"><Directory /> <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">Options FollowSymLinks <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">AllowOverride None <span style="font-family: 'Times New Roman','serif'; font-size: 16px;"></Directory> <span style="font-family: 'Times New Roman','serif'; font-size: 16px;"><Directory /var/www/public> <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">PassengerAppRoot /var/www <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">RailsBaseURI / <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">Options Indexes FollowSymLinks <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">AllowOverride all <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">Options -Multiviews <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">Order allow,deny <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">allow from all <span style="font-family: 'Times New Roman','serif'; font-size: 16px;"></Directory>

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">Restart apache <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">/etc/init.d/apache2 restart

<span style="font-family: 'Times New Roman','serif'; font-size: 16px;">Login: Snorby <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">Password: admin
 * <span style="font-family: 'Times New Roman','serif'; font-size: 16px;">Default Credentials **