ref: http://ioriy2k.pe.kr/archives/4762
0. root 권한으로 설치.
1. apache + mysql 설치
tasksel 을 이용해서 설치한다.
LAMP server : Linux Apache Mysql Php
apache 와 mysql 만 필요하지만 기본 패키지로 설치
2. redmine 설치
$ apt-get install redmine redmine-mysql
이후 아래 화면 에서 "예' 선택 ( dbconfig-common 을 이용해서 mysql 을 선택합니다. )
mysql db file 위치 : /var/lib/mysql/redmine_default
db name : redmine_default
db id : redmine_default
redmine db config : /etc/redmine/default/database.yml
dbconfig-common config : /etc/dbconfig-common/redmine/instances/default.conf
redmine root : /usr/share/redmine
apache DocumentRoot 아래에 redmine 을 link 합니다.
$ ln -s /usr/share/redmine/public /var/www/html/redmine
apache 에 ruby 연동모듈 passenger 를 설치합니다.
$ apt-get install libapache2-mod-passenger
passenger 설정
$ vi /etc/apache2/mods-available/passenger.conf
==> 아래 빨간줄 추가
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
PassengerDefaultRuby /usr/bin/ruby
PassengerDefaultUser www-data
</IfModule>
$ apt-get install ruby-bundler
$ cd /usr/share/redmine
$ bundle install
3. apache config
$ cd /etc/apache2/sites-available
$ cp 000-default.conf redmine.conf
$ vi redmine.conf
==> 아래 빨간줄 추가
...
...
<Directory /var/www/html/redmine>
RailsBaseURI /redmine
PassengerResolveSymlinksInDocumentRoot on
</Directory>
</VirtualHost>
$ a2dissite 000-default
$ a2ensite redmine
$ service apache2 restart
5. redmine 접속
최초 id : admin/admin
5.1. 접속후 오른쪽 상단 "내 계정" 메뉴에서 비밀번호를 수정 합니다.
5.2. 왼쪽 상단 "관리" -> "설정" 에서 "일반" 탭에서 첨부파일이나 저장소 인코딩을 "utf-8.euc-kr" 으로 수정합니다.
5.3 "인증" 탭에서 "인증이 필요함" 을 체크 합니다.
6. git 설치
7. Enable apache module
8. apache config
$ cd /etc/apache2/sites-available
$ vi git.conf
==> 아래 복사
# /git location for users
# Git Smart HTTP configuration
#From the Remine.pm patch file for git-smart-http:
ScriptAliasMatch "(?x)^/git/(.*/(HEAD | info/refs | objects/(info/[^/]+ | [0-9a-f]{2}/[0-9a-f]{38} | pack/pack-[0-9a-f]{40}\.(pack|idx)) | git-(upload|receive)-pack))$" /usr/lib/git-core/git-http-backend/$1
SetEnv GIT_PROJECT_ROOT /var/opt/redmine/git
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
PerlLoadModule Apache2::Redmine
<Location /git>
Order allow,deny
# Sample configuration
# Allow from 192.168.30.0/24 #Retrict Git access to local network
Allow from all
Satisfy all
AuthType Basic
AuthName "git repositories"
Require valid-user
PerlAccessHandler Apache::Authn::Redmine::access_handler
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
## for mysql
RedmineDSN "DBI:mysql:database=redmine_default;host=localhost"
RedmineDbUser "redmine_default"
RedmineDbPass "****"
RedmineGitSmartHttp yes
</Location>
9. git 저장소용 폴더 생성
$ mkdir -p /var/opt/redmine/git
$ chown www-data:www-data /var/opt/redmine/git
10. redmine 에서 git 을 접근할때 Perl 을 이용합니다. 아래 설치및 파일 link
$ apt-get install libapache-dbi-perl libapache2-mod-perl2
$ ln -sf /usr/share/redmine/extra/svn/Redmine.pm /usr/lib/perl5/Apache/Redmine.pm
$ ln -sf /usr/share/redmine/extra/svn/Redmine.pm /usr/lib/perl5/Apache2/Redmine.pm
11. redmine 에서 git 저장소를 생성할수있는 plugin 설치
ref : http://projects.andriylesyuk.com/project/redmine/scm-creator
$ apt-get install subversion
$ cd /usr/share/redmine
$ mkdir plugins
$ cd plugins
$ svn co http://svn.s-andy.com/scm-creator redmine_scm
$ export RAILS_ROOT=/usr/share/redmine
$ cd /usr/share/redmine
$ rake redmine:plugins:migrate RAILS_ENV=production
Migrating redmine_scm (SCM Creator)...
== AddRepositoriesCreatedWithScm: migrating ==================================
-- add_column(:repositories, :created_with_scm, :boolean, {:default=>false, :null=>false})
-> 0.1249s
== AddRepositoriesCreatedWithScm: migrated (0.1262s) =========================
$ cd /usr/share/redmine/config
$ vi scm.yml
==> 아래 복사
production:
deny_delete: false
auto_create: true
force_repository: false
pre_create: /usr/local/bin/pre-create.sh
post_create: /usr/local/bin/post-create.sh
pre_delete: /usr/local/bin/pre-delete.sh
post_delete: /usr/local/bin/post-delete.sh
max_repos: 0
only_creator: false
allow_add_local: false
allow_pickup: false
git:
path: /var/opt/redmine/git
git: /usr/bin/git
options: --bare
url: http://192.168.30.99/git
update_server_info: true
git_ext: true
append: trunk
development:
Note. 아래 에러 발생시
ActionController::RoutingError (No route matches [GET] "/plugin_assets/redmine_scm/javascripts/scm_utils_jquery.js"):
$ cd /usr/share/redmine/public
$ mkdir plugin_assets
$ chown -R www-data:www-data plugin_assets
$ chmod -R 755 plugin_assets
$ cd /var/www/html/redmine/plugin_assets
$ ln -s /usr/share/redmine/plugins/redmine_scm/assets redmine_scm
$ a2ensite git
$ service apache2 restart
Agile Plugin
http://www.redmine.org/plugins/redmine_agile
download : http://redminecrm.com/projects/agile/pages/1
install : http://redminecrm.com/projects/agile/pages/2
$ cd /var/www/html/redmine/plugin_assets
$ ln -s /usr/share/redmine/plugins/redmine_agile/assets redmine_agile