项目

通用

个人资料

操作

如何在Debian上使用Ruby-on-Rails和Apache2 Passenger安装Redmine

基于 .bash_history 的文档。

aptitude install ruby libzlib-ruby rdoc irb

注意:仓库中的rubygems无法使用。我们从sourceforge下载gem。

cd /tmp
wget http://rubyforge.org/frs/download.php/70697/rubygems-1.3.7.zip
unzip rubygems-1.3.7.zip
cd rubygems-1.3.7
ruby setup.rb all
cd ..
rm -r rubygems-1.3.7 rubygems-1.3.7.zip
ln /usr/bin/gem1.8 /usr/bin/gem

gem install rails --include-dependencies
gem install rack -v 1.0.1

mysql -uroot -pyourpasswd

create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'my_password';
grant all privileges on redmine.* to 'redmine'@'localhost';
exit;

注意:对于5.2.0之前的MySQL,使用以下命令:
create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'my_password';
grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password';
exit;

cd /srv/www/htdocs
wget http://rubyforge.org/frs/download.php/70488/redmine-0.9.4.zip
unzip redmine-0.9.4.zip
rm redmine-0.9.4.zip
mv redmine-0.9.4 redmine

cd /srv/www/htdocs/redmine
cp config/database.yml.example config/database.yml
vi config/database.yml

production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: passwd
  encoding: utf8

cp config/email.yml.example config/email.yml
vi config/email.yml
注意:更多帮助请参考这里: http://redmineblog.com/articles/setup-redmine-to-send-email-using-gmail/

production:
  delivery_method: :smtp
  smtp_settings:
    tls: true
    address: "smtp.gmail.com" 
    port: '587'
    domain: "smtp.gmail.com" 
    authentication: :plain
    user_name: "[email protected]" 
    password: "your_password" 

aptitude install libapache2-mod-fastcgi libfcgi-ruby1.8
aptitude install libmysql-ruby libopenssl-ruby1.8

RAILS_ENV=production rake config/initializers/session_store.rb
rake generate_session_store
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data

aptitude install ruby-dev
gem install passenger
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/bin/passenger-install-apache2-module

注意:以下文件内容信息来自 ".../passenger-install-apache2-module"。

vi /etc/apache2/mods-available/passenger.load

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/ext/apache2/mod_passenger.so

vi /etc/apache2/mods-available/passenger.conf

PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.14                                                 
PassengerRuby /usr/bin/ruby1.8

a2enmod passenger

vi /etc/apache2/sites-available/default

<VirtualHost *:80>                                                                                         
  ServerName www.yourhost.com                                                                             
  DocumentRoot /srv/www/htdocs/redmine/public    # <-- be sure to point to 'public'!                                   
  <Directory /srv/www/htdocs/redmine/public>                                                                           
    AllowOverride all                            # <-- relax Apache security settings                                  
    Options -MultiViews                          # <-- MultiViews must be turned off                                   
  </Directory>                                                                                            
</VirtualHost>

cd /srv/www/htdocs/redmine
chmod -R 775 ./*
chown -R root:root ./*
mkdir tmp public/plugin_assets
chown -R nobody:nogroup files log tmp public/plugin_assets
chmod -R 775 files log tmp public/plugin_assets

/etc/init.d/apache2 restart

将Redmine放入文件夹

mkdir /srv/www/apps
mv /srv/www/htdocs/redmine /srv/www/apps/redmine
ln -s /srv/www/apps/redmine /srv/www/htdocs/redmine
vi /etc/apache2/sites-available/default

<VirtualHost *:80>
  ServerName www.yourhost.com
  DocumentRoot /srv/www/htdocs
  <Directory /srv/www/htdocs>
    AllowOverride all
    Options -MultiViews
  </Directory>

  RailsBaseURI /redmine
  <Directory /srv/www/htdocs/redmine>
    Options -MultiViews
  </Directory>                                                                                     
</VirtualHost>

/etc/init.d/apache2 restart

仓库

我使用了以下仓库
如果您使用的是Debian etch(稳定版),将lenny替换为etch。
您可以在以下位置找到更多仓库:
http://wiki.unixboard.de/index.php/Repositories_fuer_Debian_und_Derivate

vi /etc/apt/sources.list

deb http://ftp.de.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.de.debian.org/debian/ lenny main contrib non-free

deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free

deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free

deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free

Mischa The Evil 更新 大约14年前 · 4次修订