Ubuntu 10.04 + MySQL+ Nginx 安装与集成 Redmine 1.4

一、安装 mysql 
@linux:~$ sudo apt-get install mysql-server libmysqlclient-dev


二、安装 nginx(安装步骤进行至passenger nginx 模块时,发现可以先不着急安装nginx,彼时一起安装)
@linux:~$ sudo apt-get install nginx


三、安装ruby 1.8
@linux:~$ sudo apt-get install ruby1.8


四、安装 RubyGems 1.8.24
wget \
@linux:~$ tar -zxf ./rubygems-1.8.24.tgz 
@linux:~$ cd rubygems-1.8.24/
@linux:~/rubygems-1.8.24$ ruby ./setup.rb 


五、配置RubyGems(你懂的)
@linux:~$ gem sources --clear-all
@linux:~$ gem source --add
@linux:~$ gem sources --update


六、安装bundle
@linux:~/rubygems-1.8.24$ sudo gem install bundle


七、下载redmine 1.4
@linux:~$  git clone https://github.com/redmine/redmine.git -b 1.4-stable ./redmine_1.4
@linux:~$ sudo mv ./redmine_1.4/ /opt/
@linux:~$ cd /opt/redmine_1.4/
@linux:/opt/redmine_1.4$ rm ./.git -Rf


八、安装redmine 1.4 依赖包
#确保以下依赖包已经正常安装,以免反复
sudo apt-get install ruby1.8-dev libmagick9-dev libsqlite3-dev  libpq-dev
#其实使用mysql时这两个包 libsqlite3-dev  libpq-dev 并非必须,可以修改Gemfile来避免检查这两个包。
#如果将来希望使用“scrum-pm” 插件,在Redmine Gemfile中添加以下几行,是个好主意!
gem "googlecharts", :require => "gchart" gem "mini_magick"


@linux:/opt/redmine_1.4$ bundle install

Issue A:
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)How:
@linux:/opt/redmine_1.4$ sudo apt-get installruby1.8-dev 
Issue B:
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again withHow:
@linux:/opt/redmine_1.4$ sudo apt-get install libpq-dev
Issue C:
Can't install RMagick 2.13.1. Can't find Magick-config in ...How:
@linux:/opt/redmine_1.4$ sudo apt-get installlibmagick9-dev
Issue D: 
sqlite3.h is missing. Try 'port install sqlite3 +universal'How:
@linux:/opt/redmine_1.4$ sudo apt-get installlibsqlite3-dev

九、安装与配置redmine数据库
root@simba-laptop:/opt/redmine_1.4# mysql -u root -p
create database redmine character set utf8;  
create user 'redmine'@'localhost' identified by 'my_password';  
grant all privileges on redmine.* to 'redmine'@'localhost';  
root@simba-laptop:/opt/redmine_1.4# rake generate_session_store
root@simba-laptop:/opt/redmine_1.4# RAILS_ENV=production rake db:migrate

Issue A:
rake aborted!
no such file to load -- net/httpsHow:
root@simba-laptop:/opt/redmine_1.4#  apt-get install libopenssl-ruby1.8
@linux:/opt/redmine_1.4$ RAILS_ENV=production rake redmine:load_default_data


十、配置权限
@linux:/opt/redmine_1.4$ sudo useradd nginx -U
@linux:/opt/redmine_1.4$ sudo chown -R nginx:nginx files log tmp public/plugin_assets
@linux:/opt/redmine_1.4$ sudo chmod -R 755 files log tmp public/plugin_assets


十一、试运行
@linux:/opt/redmine_1.4$ su - nginx
$ bash
nginx@simba-laptop:/opt/redmine_1.4$ cd /opt/redmine_1.4/
nginx@simba-laptop:/$ cd /opt/redmine_1.4/
nginx@simba-laptop:/opt/redmine_1.4$ ruby script/server webrick -e production


十二、集成至Nginx
#安装passenger
@linux:/opt/redmine_1.4$ sudo gem install passenger

#确保以下依赖包已经正常安装,避免反复
@linux:/opt/redmine_1.4$ sudo apt-get install libcurl4-openssl-dev
@linux:/opt/redmine_1.4$ passenger-install-nginx-module 

Issue:看来不先安装Nginx也没问题:
Automatically download and install Nginx?

Nginx doesn't support loadable modules such as some other web servers do,
so in order to install Nginx with Passenger support, it must be recompiled.

Do you want this installer to download, compile and install Nginx for you?

1. Yes: download, compile and install Nginx for me. (recommended)
   The easiest way to get started. A stock Nginx 1.2.2 with Passenger
   support, but with no other additional third party modules, will be
   installed for you to a directory of your choice.

2. No: I want to customize my Nginx installation. (for advanced users)
   Choose this if you want to compile Nginx with more third party modules
   besides Passenger, or if you need to pass additional options to Nginx's
   'configure' script. This installer will  1) ask you for the location of
   the Nginx source code,  2) run the 'configure' script according to your
   instructions, and  3) run 'make install'.

Whichever you choose, if you already have an existing Nginx configuration file,
then it will be preserved.

Enter your choice (1 or 2) or press Ctrl-C to abort: 1

#开始自行下载、编译并安装Nginx,等待完成

#链接remine到 Nginx 默认主目录
@linux:~$ sudo ln -s /opt/redmine_1.4/public/ /var/www/redmine

#编辑Nginx配置文件
@linux:/opt$ sudo vim /opt/nginx/conf/nginx.conf
#参考配置如下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/cba5a4f9c783f0d29484d4f4e943e754.html