1.安装软件包
-
apt-get update
-
apt-get install redmine
-
apt-get install apache2 libapache2-mod-passenger
2.配置apache和passenger
-
By default, passenger runs as 'nobody', so you'll need to fix that.
-
vi /etc/apache2/mods-available/passenger.conf
-
-
PassengerDefaultUser www-data
-
PassengerRoot /usr
-
PassengerRuby /usr/bin/ruby
-
-
-
-
vi /etc/apache2/conf.d/security
-
Change ServerTokens OS to read ServerTokens Prod
-
-
-
vi /etc/apache2/sites-available/manager
-
-
RailsEnv production
-
ServerName todu.me
-
ServerAdmin q_0_0_p@163.com
-
-
DocumentRoot /var/www/manager/redmine/public
-
-
RailsBaseURI /var/www/manager/redmine
-
PassengerResolveSymlinksInDocumentRoot on
-
Options -MultiViews
-
AllowOverride all
-
Order allow,deny
-
allow from all
-
-
-
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
-
-
AllowOverride None
-
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
-
Order allow,deny
-
Allow from all
-
-
-
ErrorLog ${APACHE_LOG_DIR}/error.log
-
-
-
# Possible values include: debug, info, notice, warn, error, crit,
-
# alert, emerg.
-
LogLevel warn
-
-
-
CustomLog ${APACHE_LOG_DIR}/manager-access.log combined
-
3.下载redmine2.5.2
因为ubuntu自带redmine版本太低,为了使用redmine的新版本,从官网下载。
-
mkdir -p /var/www/manager/
-
wget
-
tar zxvf redmine-2.5.2.tar.gz -C /var/www/manager/
-
cd /var/www/manager/
-
ln -s redmine-2.5.2 redmine
4.配置redmine安装依赖。
chown -R git:git redmine
su - git
cd redmine
sudo gem install bundler # gem 是ruby上的安装包管理软件
cd config
cp database.yml.example database.yml
-
vi database.yml
-
production:
-
adapter: sqlite3
-
database: db/redmine.sqlite3
-
encoding: utf8
bundle install --without development test # bundle 是一个自动安装方式
-
An error occurred while installing mysql2 (0.3.16), and Bundler cannot continue.
-
apt-get install libmysqlclient-dev
-
An error occurred while installing rmagick (2.13.2), and Bundler cannot continue.
-
apt-get install libmagickwand-dev
-
An error occurred while installing sqlite3 (1.3.9), and Bundler cannot continue.
-
apt-get install libsqlite3-dev
bundle show [package name]
rake generate_secret_token
RAILS_ENV=production rake db:migrate #建立数据表, rake相当于ruby上的make
RAILS_ENV=production rake redmine:load_default_data #设置语言
mkdir -p tmp tmp/pdf public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
5.运行redmine,重启apache服务。
service apache2 restart
ruby script/rails server webrick -e production
浏览器里打开
admin:admin
参考链接:
redmine官方安装文档
阅读(1360) | 评论(0) | 转发(0) |