Debian下Redmine+Lighttpd安装部署(Linode VPS)
Redmine官方站点: http://www.redmine.org Redmine是基于RoR开发的Web项目管理应用,本次部署的是1.2.1版本。 1.安装ruby,rake…
apt-get update apt-get install ruby rake librmagick-ruby libmysql-ruby rubygems libfcgi-ruby1.8 libopenssl-ruby1.8
2.安装rails,rack(根据Redmine版本要求安装对应的版本包)
gem install rails -v=2.3.11 gem install rack -v=1.1.1
3.安装Redmine
wget http://rubyforge.org/frs/download.php/75099/redmine-1.2.1.zip unzip redmine-1.2.1.zip mv redmine-1.2.1 /var/www/redmine
4.MySQL配置 登陆mysql,执行如下命令,建立redmine数据库,用户名为redmine,密码为my_password:
grant all privileges on redmine.* to ‘redmine’@‘localhost’ identified by ‘my_password’;
5.Redmine配置 数据库配置:
cp /var/www/redmine/config/database.yml.example /var/www/redmine/config/database.yml nano /var/www/redmine/config/database.yml
database.yml内容根据你新建的数据库名称,mysql用户名,对应的密码进行修改:
production: adapter: mysql database: redmine host: localhost username: redmine password: my_password
然后执行如下命令:
rake generate_session_store RAILS_ENV=production rake db:migrate RAILS_ENV=production rake redmine:load_default_data adduser –disabled-password redmine cd /var/www/redmine mkdir tmp public/plugin_assets sudo chown -R redmine:redmine files log tmp public/plugin_assets sudo chmod -R 755 files log tmp public/plugin_assets
6.验证Redmine安装
ruby script/server webrick -e production
执行这条指令后,访问你安装机器的ip地址加3000端口号,例如: http://it580.com:3000 ,能看到Redmine界面即可,如果你想登陆一下,使用账号/密码为: admin/admin ,记得登陆后修改该用户的密码。 7.Lighttpd 配置 注意将redmine.it580.com 替换为你自己的域名
cp public/dispatch.fcgi.example public/dispatch.fcgi nano /etc/lighttpd/redmine.it580.com
redmine.it580.com文件内容如下:
$HTTP[“host”] == “redmine.it580.com” { server.document-root = “/var/www/redmine/public/” server.indexfiles = (“dispatch.fcgi”) server.error-handler-404 = “/dispatch.fcgi” url.rewrite-once = ( “^/(.\..+(?!html))$” => “$0”, “^/(.)\.(.*)“ => “$0”, ) fastcgi.server = ( “.fcgi” => ( “redmine” => ( “bin-path” => “/usr/bin/ruby /var/www/redmine/public/dispatch.fcgi”, “socket” => “/tmp/redmine.socket”, “min-procs” => 1, “max-procs” => 4, “idle-timeout” => 120, “check-local” => “disable”, “bin-environment” => (“RAILS_ENV” => “production”), ) ) ) }
再执行如下命令:
echo ‘include “redmine.it580.com”’ >> lighttpd.conf /etc/init.d/lighttpd reload
Lighttpd重载配置后,就可以利用你的域名直接访问Redmine了。 PS:如果你觉得Linode VPS不错,可以点击这里Linode VPS购买链接直接购买,你购买后我会得到一点返利。