http://hirooka.pro/?p=1139
http://www.tuicool.com/articles/nU7bQz
本文是安装 redmine 2.3
手动安装 ruby 1.9.3
手动安装 passenger 4.0.0
手动安装 redmine 2.3
在手动安装 passenger 4.0 时,会提示缺少一些库,按提示将对应的库安装即可编译
如:
Checking for Curl development headers with SSL support
Cannot find the `curl-config` command.
解决办法
sudo apt-get install libcurl3-dev
首先,先把感觉需要的软件都事先安装上
$ sudo apt-get install libyaml-dev libncurses5-dev libgdbm-dev libssl-dev libyaml-dev libreadline-dev tk-dev zlib1g-dev libmysqld-dev libmagickwand-dev apache2-threaded-dev
DB使用MySQL、WEB服务器使用Apache时,需要是现状下述软件。
$ sudo apt-get install apache2 mysql-server php5-mysql php5 php5-cgi libapache2-mod-php5 php5-common php-pear
Ruby
下载Ruby
编译Ruby
$ wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
$ tar zxvf ruby-1.9.3-p392.tar.gz
$ cd ruby-1.9.3-p392
$ ./configure
$ make
$ sudo make install
安装完成后确认版本信息
安装bundler
$ sudo /usr/local/bin/gem install bundler --no-rdoc --no-ri
MySQL
设定MySQL
$ cd /etc/mysql/conf.d/
$ sudo vi characterset.cnf
设定内容
[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
重启MySQL
$ sudo service mysql restart
确认MySQL文字编码
mysql> show variables like 'character_set%';
执行结果:
+
| Variable_name | Value |
+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+
8 rows in set (0.01 sec)
制作数据库
做成Redmine的Mysql数据库和用户。
例:
mysql> create database db_redmine default character set utf8;
mysql> grant all on db_redmine.* to user_redmine@localhost identified by 'password';
mysql> flush privileges;
mysql> exit;
Redmine
下载Redmine
Redmine解压、配置
$ wget http://rubyforge.org/frs/download.php/76867/redmine-2.3.0.tar.gz
$ tar zxvf redmine-2.3.0.tar.gz
$ sudo mv redmine-2.3.0 /usr/local/
$ sudo ln -s /usr/local/redmine-2.3.0 /usr/local/redmine
设置数据库连结
做成database.yml
$ cd /usr/local/redmine/config
$ vi database.yml
内容例:
production:
adapter: mysql2
database: db_redmine
host: localhost
username: user_redmine
password: password
encoding: utf8
安装Gem
$ cd /usr/local/redmine
$ bundle install --without development test postgresql sqlite
Redmine的初始设定以及数据库表的做成
$ bundle exec rake generate_secret_token
$ RAILS_ENV=production bundle exec rake db:migrate
安装Passenger
$ sudo gem install passenger --no-rdoc --no-ri
安装Passenger的Apache使用模块
$ sudo /usr/local/bin/passenger-install-apache2-module
注:这里和预想不一致,由于默认安装的Passenger为4.05(原文为3.0.19)安装的 版本过高。需要手工安装ssl,按照安装提示apt-get即可。
Apache
添加Passenger的设定信息
制作Apache需要使用的Passenger设定文件
$ sudo vi /etc/apache2/conf.d/passenger.conf
注:设定内容需要按学号下述命令输出结果来设定
passenger-install-apache2-module --snippet
为Redmine执行来配置Apache上的Passenger
$ sudo chown -R www-data:www-data /usr/local/redmine-2.3.0
$ sudo ln -s /usr/local/redmine/public /var/www/hoge
在/etc/apache2/conf.d/passenger.conf 最后一行添加下述内容
$ sudo vi /etc/apache2/conf.d/passenger.conf
RailsBaseURI /hoge
重启Apache
$ sudo /etc/init.d/apache2 restart
尝试远程访问
http://(IP地址)/hoge/ 如果现实Redmine的话,表示安装完成。
安装完Redmine之后
请根据需要做各种设定,但无论如何最少也要修改admin的密码,
同时修改用户登录为无效、同时选择需要认证的检查。