CentOS6.5 yum安裝snorby
bundle exec rails server -e production
如果下列任何組件之一已經被安裝,請酌情忽略
1.Snort
參照CentOS6.5 安裝snort
2.GIT
系統內建
3.Ruby版本限制> 1.9.2
系統內建版本過低首先卸載掉,注意 必須是1.9.*版本
yum erase ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs
然後去ruby官網下載1.9.3版本Ruby 1.9.3-p547http://ruby.taobao.org/mirrors/ruby/
在此之前請安裝yaml
yum list libyaml*
安裝ruby
tar -zxvf ruby-1.9.3-p547.tar.gzcd ruby-1.9.3-p547./configuremake make install
4.Rails版本限制> 3.0.0
gem install rails -V
5.ImageMagick版本限制> 6.6.4
由於yum源版本過低,去官網ftp://ftp.imagemagick.org/pub/ImageMagick/linux/CentOS/x86_64/下載ImageMagick-6.8.9-7.x86_64.rpm
安裝之前卸載系統原有版本
yum erase ImageMagick
安裝基礎庫
yum install bzip2-devel freetype-devel libjpeg-devel libpng-devel libtiff-devel giflib-devel zlib-devel ghostscript-devel djvulibre-devel libwmf-devel jasper-devel libtool-ltdl-devel libX11-devel libXext-devel libXt-devel lcms-devel libxml2-devel librsvg2-devel OpenEXR-develyum --enablerepo=epel install jasper jasper-libs jasper-devel
由於rpm安裝ImageMagick會出現各種各樣的問題,缺少n多依賴包,現以源碼安裝ImageMagick,下載http://www.imagemagick.org/script/install-source.php#unix最新源碼包並安裝
tar xvzf ImageMagick.tar.gzcd ImageMagick-6.8.9-7./configuremakemake installldconfig /usr/local/lib
檢查是否安裝好
make check
6.安裝Wkhtmltopdf
去官網http://wkhtmltopdf.org下載最新版wkhtmltox-0.12.1_linux-centos6-amd64.rpm
rpm -ivh wkhtmltox-0.12.1_linux-centos6-amd64.rpm
7.進入正題,安裝snorby
git clone git://github.com/Snorby/snorby.gitcd snorbygem install bundlerbundle install
8.配置
vim config/database.yml
根據需求更改
# Snorby Database Configuration## Please set your database password/user below#snorby: &snorby adapter: mysql username: root password: 123123 host: localhostdevelopment: database: snorby <<: *snorbytest: database: snorby <<: *snorbyproduction: database: snorby <<: *snorby
配置snorby_config.yml
vi snorby_config.yml
development: domain: localhost:3000 wkhtmltopdf:/usr/local/bin/wkhtmltopdf mailer_sender: 'snorby@snorby.org' rules: - "/etc/snort/rules" - "/etc/snort/so_rules"test: domain: localhost:3000 wkhtmltopdf: /usr/local/bin/wkhtmltopdf mailer_sender: 'snorby@snorby.org'# Change the production configuration# for your environment.production: domain: 'demo.snorby.org' wkhtmltopdf: /usr/local/bin/wkhtmltopdf mailer_sender: 'snorby@snorby.org' rules: - "/etc/snort/rules/folder" - "/etc/snort/so_rules/folder"
vi script/rails
#!/usr/bin/env ruby 替換為#!/usr/local/bin/ruby
卸載掉一個i18n gem(版本號碼大的那個)
gem uninstall i18n
安裝
bundle exec rake snorby:setup
運行
bundle exec rails server -e production