先安装 ruby包管理器
-
curl -sSL | bash -s stable
安装完成后需要 source /etc/profile.d/rvm.sh
查看官方版本需求
Redmine version
|
Supported Ruby versions
|
Rails version used
|
current trunk
|
ruby 1.9.3, 2.0.0, 2.1, 2.2
|
Rails 4.2
|
3.0
|
ruby 1.9.3, 2.0.0, 2.1, 2.2
|
Rails 4.2
|
2.6
|
ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1, 2.2, jruby-1.7.6
|
Rails 3.2
|
先查看版本
-
rvm list known
-
# MRI Rubies
-
[ruby-]1.8.6[-p420]
-
[ruby-]1.8.7[-head] # security released on head
-
[ruby-]1.9.1[-p431]
-
[ruby-]1.9.2[-p330]
-
[ruby-]1.9.3[-p551]
-
[ruby-]2.0.0[-p648]
-
[ruby-]2.1[.8]
-
[ruby-]2.2[.4]
-
[ruby-]2.3[.0]
-
[ruby-]2.2-head
安装2.2版本
rvm install 2.2
安装完成后使用
rvm use 2.2
然后使用 ruby -v 查看ruby的版本
接着 安装rails
gem install rails -V
在安装过程中
可能会出现
ERROR
: While executing gem ... (Gem::RemoteFetcher::FetchError)
-
gem sources --remove https://rubygems.org/
-
gem sources -a https://ruby.taobao.org/
-
gem sources -l
替换掉源
安装完成后使用
rails -v 查看版本信息
Rails 4.2.5 应该可以吧 --。
-
git clone https://github.com/redmine/redmine
然后跟着官网的来
先
-
gem install bundler
-
bundle install --without development test
第二部可能出现
An error occurred while installing rmagick (2.15.4), and Bundler cannot continue. Make sure that `gem install rmagick -v '2.15.4'` succeeds before bundling.
-
apt-get install imagemagick libmagickcore-dev libmagickwand-dev
剩下的就跟着
其他错误按照上面的提示应该就好了
-
https://www.redmine.org/projects/redmine/wiki/RedmineInstall
在redmine 目录下用以下代码 且能够正常访问
-
bundle exec rails server webrick -e production
在apache配置
必须要先安装passenger
-
passenger-install-apache2-module
期间却少模块 可以安装他的说明
最后会有类似这样的代码
-
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.2.4/gems/passenger-5.0.23/buildout/apache2/mod_passenger.so
-
<IfModule mod_passenger.c>
-
PassengerRoot /usr/local/rvm/gems/ruby-2.2.4/gems/passenger-5.0.23
-
PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.2.4/wrappers/ruby
-
</IfModule
复制到记事本上面去 后面配置 apache 会用到
a2enconf passenger
然后就在 touch /etc/apache2/sites-enabled/redmine.conf 里面配置就好了 这个文件是从sites-available 做的软链接
-
ServerName redmine.domain.com
-
-
<VirtualHost *:443>
-
ServerAdmin admin@domain.com
-
ServerName redmine.domain.com
-
-
-
DocumentRoot /opt/redmine/current/public/
-
-
## Passenger Configuration
-
## Details at http://www.modrails.com/documentation/Users%20guide%20Apache.html
-
-
PassengerMinInstances 6
-
PassengerMaxPoolSize 20
-
RailsBaseURI /
-
PassengerAppRoot /opt/redmine/current
-
-
# Speeds up spawn time tremendously -- if your app is compatible.
-
# RMagick seems to be incompatible with smart spawning
-
RailsSpawnMethod smart
-
-
# Keep the application instances alive longer. Default is 300 (seconds)
-
PassengerPoolIdleTime 1000
-
-
# Keep the spawners alive, which speeds up spawning a new Application
-
# listener after a period of inactivity at the expense of memory.
-
RailsAppSpawnerIdleTime 3600
-
-
# Additionally keep a copy of the Rails framework in memory. If you're
-
# using multiple apps on the same version of Rails, this will speed up
-
# the creation of new RailsAppSpawners. This isn't necessary if you're
-
# only running one or 2 applications, or if your applications use
-
# different versions of Rails.
-
PassengerMaxPreloaderIdleTime 0
-
-
# Just in case you're leaking memory, restart a listener
-
# after processing 5000 requests
-
PassengerMaxRequests 5000
-
-
# only check for restart.txt et al up to once every 5 seconds,
-
# instead of once per processed request
-
PassengerStatThrottleRate 5
-
-
# If user switching support is enabled, then Phusion Passenger will by default run the web application as the owner if the file config/environment.rb (for Rails apps) or config.ru (for Rack apps). This option allows you to override that behavior and explicitly set a user to run the web application as, regardless of the ownership of environment.rb/config.ru.
-
PassengerUser www-data
-
PassengerGroup www-data
-
-
# By default, Phusion Passenger does not start any application instances until said web application is first accessed. The result is that the first visitor of said web application might experience a small delay as Phusion Passenger is starting the web application on demand. If that is undesirable, then this directive can be used to pre-started application instances during Apache startup.
-
PassengerPreStart https://localhost
-
-
<Directory /opt/redmine/current/public/>
-
Options +Indexes +FollowSymLinks -MultiViews
-
AllowOverride All
-
<IfVersion < 2.3 >
-
Order allow,deny
-
Allow from all
-
</IfVersion>
-
<IfVersion >= 2.3>
-
Require all granted
-
</IfVersion>
-
</Directory>
-
-
AddOutputFilter DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css
-
BrowserMatch ^Mozilla/4 gzip-only-text/html
-
BrowserMatch ^Mozilla/4.0[678] no-gzip
-
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
-
-
-
ErrorLog ${APACHE_LOG_DIR}/redmine.error.log
-
LogLevel warn
-
CustomLog ${APACHE_LOG_DIR}/redmine.access.log combined
-
ServerSignature Off
-
-
</VirtualHost>
阅读(2811) | 评论(0) | 转发(0) |