Centos安装 Redmine
CentOS 安装 Redmine
http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Nginx_to_run_Redmine
- 安装 Ruby 解析器
- 获取:wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz
- tar xzvf ruby-2.2.2.tar.gz
- cd ruby-2.2.2
- ./configure -prefix=/alidata/server/ruby-2.2.2
- make && make install
- export PATH=/alidata/server/ruby-2.2.2/bin:$PATH
- vi /etc/profile ,末尾更新PATH路径
- 安装 Ruby on rails
- 安装: gem install rubygems-update
- gem install rubygems
- gem install rails 可以根据提示再安装缺少的相应包
- rails -v 可以查看版本
- 安装rake,安装bundler,过程中可能出现服务器解析问题, 需要多次重试。
- gem install rake
- gem install nokogiri /如果rails 安装出错,需要安装
- gem install bundler
- bundler install —without development
- 根据提示安装缺少的依赖包。
- gem install json
- gem install minitest
- gem install metaclass
- gem install mocha
- gem install multi_json
- gem install mysql2
- gem install net-ldap
- gem install protected_attributes
- gem install ruby-openid
- yum install ImageMagick
- yum install ImageMagick-devel
- PKG_CONFIG_PATH=/usr/local/lib/pkgconfig gem install rmagick
- bundle install —without development
- bundle install —without development test rmagick
- gem install puma
- bundle exec rake generate_secret_token
- 配置 Redmine
- 下载redmine:wget http://www.redmine.org/releases/redmine-3.0.2.tar.gz
- cd config
- cp database.yml.example database.yml
- vi database.yml
- 更改production 内相应数据库配置。保存退出
- 创建数据表:rake db:migrate RAILS_ENV=“production”
- 此处容易出错, 可以根据出错提示进行缺少包的安装。
- RAILS_ENV=production bundle exec rake db:migrate
- RAILS_ENV=production bundle exec rake db:migrate:load_default_data
- 启动服务:bundle exec ruby bin/rails server webrick -e production
- login:admin, password:admin
- 配置nginx
- 安装 passenger
- http://old.blog.phusion.nl/2011/04/14/phusion-passenger-3-0-7-released/
- gem install passenger
- passenger-install-nginx-module
- 出现:g++:internal compiler error:Killed(program cc1plus). please submit a full bug report;
- 解决办法:
- sudo dd if=/dev/zero of=/swapfile bs=1M count=512
- sudo mkswap /swapfile
- sudo swapon /swapfile
- After compiling,you may wish to
- sudo swapoff /swapfile
- sudo rm /swapfile
- 配置 nginx.conf
- http{
…
passenger_root /alidata/server/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/passenger-5.0.7;
passenger_ruby /alidata/server/ruby-2.2.2/bin/ruby;…
}
- http{
- 在 网站conf中配置:
- server {
listen 80;
server_name www.yourhost.com;
root /somewhere/public; # <— be sure to point to ‘public’!
passenger_enabled on;
}
- server {
- 重新启动nginx,nginx -s reload
- 启动Passenger,passenger start
- 安装 passenger
- 启动访问