#########################################################################################
# VMの構築
システム-マザーボード
	CD/DVD -> ハードディスク
システム-プロセッサー
	PAE/NXを有効化にチェック
ストレージ
	CD/DVDドライブに仮想ディスクをマウント
オーディオ
	オーディオを有効化のチェックを外す
ネットワーク
	アダプター1
		割り当て -> ホストオンリーアダプターに変更
	アダプター2
		ネットワークアダプターを有効化にチェック
		割り当て -> ブリッジアダプターに変更
#########################################################################################
# Ubuntu のインストール

#########################################################################################
#

sudo sh -c 'echo auto eth1 >> /etc/network/interfaces'
sudo sh -c 'echo iface eth1 inet dhcp >> /etc/network/interfaces'

# networking restart が効かない
sudo reboot

#########################################################################################
#

sudo apt-get update
sudo apt-get upgrade

#########################################################################################
#########################################################################################
#
#########################################################################################
#########################################################################################
#
#########################################################################################
redminever=redmine-2.5.2-1
wget https://bitnami.com/redirect/to/39065/bitnami-${redminever}-linux-x64-installer.run

chmod +x bitnami-${redminever}-linux-x64-installer.run

sudo ./bitnami-${redminever}-linux-x64-installer.run

Please choose an option [1] :
	→

Continue with installation? [Y/n]:
	→

PhpMyAdmin [Y/n] :
	→

Is the selection above correct? [Y/n]:
	→

Select a folder [/opt/redmine-2.5.2-1]:
	→

Your real name [User Name]:
	→

Email Address [user@example.com]:
	→

Login [user]:
	→

Password :
	→ bitnami

Please confirm your password :
	→ bitnami

Please choose an option [4] :
	→ 9

Do you want to configure mail support? [y/N]:
	→

Do you want to continue? [Y/n]:
	→ 

Launch Redmine application. [Y/n]:
	→ 

#########################################################################
# メールの設定
/opt/redmine/apps/redmine/htdocs/config/configuration.yml
#   email_delivery:
#     delivery_method: :sendmail
#########################################################################

sudo rm /opt/redmine

# インストール ディレクトリのシンボリック リンク
sudo ln -s /opt/${redminever} /opt/redmine

# 停止
sudo /opt/redmine/ctlscript.sh  stop

# subversionの起動を抑制(apache経由でアクセスさせるようにする)
sudo chmod -x /opt/redmine/subversion/scripts/ctl.sh

# スタートアップスクリプトの修正
sudo chmod -x /opt/redmine/subversion/scripts/ctl.sh

cat << EEOOFF | sudo tee  /etc/init.d/bitnami-redmine
#!/bin/sh
### BEGIN INIT INFO
# Provides:       bitnami-redmine
# Required-Start: $network $remote_fs
# Required-Stop:  $network $remote_fs
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
# Short-Description: BitNami Redmine Stack service
# Description: BitNami Redmine Stack service
### END INIT INFO

/opt/redmine/ctlscript.sh \$@
EEOOFF

sudo chmod +x /etc/init.d/bitnami-redmine 

sudo update-rc.d bitnami-redmine defaults

#########################################################################
# SubversionのRedmine認証
sudo sh -c 'echo Include \"/opt/redmine/apache2/conf/redmine.conf\" >> /opt/redmine/apache2/conf/httpd.conf'
 
cat << EEOOFF | sudo tee /opt/redmine/apache2/conf/redmine.conf
LoadModule perl_module modules/mod_perl.so
PerlLoadModule Apache::Authn::Redmine
   <Location /repos/svn>
    DAV svn
    SVNParentPath "/opt/redmine/repos/svn"
#    Order deny,allow
#    Deny form all
#    Satisfy any
 
#   PerlAccessHandler Apache::Authn::Redmine::access_handler
    PerlAuthenHandler Apache::Authn::Redmine::authen_handler
    AuthType Basic
    AuthName "SVN Repository"
    Require valid-user
    RedmineDSN "DBI:mysql:database=bitnami_redmine;host=localhost;mysql_socket=/opt/redmine/mysql/tmp/mysql.sock"

    RedmineDbUser "root"
    RedmineDbPass "bitnami"
  </Location>
  # Git
  SetEnv GIT_PROJECT_ROOT /opt/redmine/repos/git
  SetEnv GIT_HTTP_EXPORT_ALL
  ScriptAlias /repos/git/ /usr/libexec/git-core/git-http-backend/
  <Location /repos/git>
    AuthType Basic
    AuthName "Redmine Git Repository"
    Require valid-user

    PerlAccessHandler Apache::Authn::Redmine::access_handler
    PerlAuthenHandler Apache::Authn::Redmine::authen_handler

    RedmineDSN "DBI:mysql:database=bitnami_redmine;host=localhost;mysql_socket=/opt/redmine/mysql/tmp/mysql.sock"
    RedmineDbUser "root"
    RedmineDbPass "bitnami"
    RedmineGitSmartHttp yes
  </Location>
EEOOFF

sudo mkdir /opt/redmine/perl/lib/site_perl/5.16.3/x86_64-linux-thread-multi/Apache/Authn
sudo cp /opt/redmine/apps/redmine/htdocs/extra/svn/Redmine.pm /opt/redmine/perl/lib/site_perl/5.16.3/x86_64-linux-thread-multi/Apache/Authn/Redmine.pm

sudo mkdir -p /opt/redmine/repos/{svn,git}
sudo chown -R daemon:daemon /opt/redmine/repos


#########################################################################
sudo apt-get install unzip
#########################################################################
# plugin
# code_review	http://www.redmine.org/plugins/codereview
wget https://bitbucket.org/haru_iida/redmine_code_review/downloads/redmine_code_review-0.6.3.zip
unzip redmine_code_review-0.6.3.zip
sudo cp -r redmine_code_review /opt/redmine/apps/redmine/htdocs/plugins/

# redmine_scm	リポジトリの自動生成
wget http://projects.andriylesyuk.com/attachments/download/563/redmine_scm-0.5.0b.tar.bz2


tar -xjvf redmine_scm-0.5.0b.tar.bz2

sudo cp -r redmine_scm  /opt/redmine/apps/redmine/htdocs/plugins/
# パッチの登録
patchfile=`mktemp`

cat << EEOOFF | sudo tee /opt/redmine/apps/redmine/htdocs/config/scm.yml
production:
  deny_delete: true
  auto_create: true
  post_create: /opt/bin/post-create.sh
  svn:
    path: /opt/redmine/repos/svn
    svnadmin: /opt/redmine/subversion/bin/svnadmin
    url: svn
  git:
    path: /opt/redmine/repos/git
    git: /opt/redmine/git/bin/git
    options: --bare
    url: http://localhost/git
    update_server_info: true
    git_ext: true

development:
EEOOFF

# wiki latex
wget https://github.com/baracoder/wiki_latex/archive/master.zip
unzip master.zip
sudo mv wiki_latex-master /opt/redmine/apps/redmine/htdocs/plugins/wiki_latex
rm master.zip

sudo service bitnami-redmine start
sudo /opt/redmine/use_redmine
cd /opt/redmine/apps/redmine/htdocs
bin/rake redmine:plugins:migrate RAILS_ENV=production
sudo service bitnami-redmine restart
#########################################################################

sudo mkdir /opt/bin

cat << EEOOFF | sudo tee /opt/bin/post-create.sh
#!/bin/sh

SCM_REPO_PATH=\$1
SCM_TYPE=\$2
SCM_PROJECT=\$3

SCM_REPO_NAME=\$(basename \$SCM_REPO_PATH)
SCM_REPO_ROOT=\$(dirname \$SCM_REPO_PATH)

case "\$SCM_TYPE" in
    svn)
        svn mkdir file://\${SCM_REPO_PATH}/trunk file://\${SCM_REPO_PATH}/tags file://\${SCM_REPO_PATH}/branches -m 'Create trunk, tags, and branches.'
        cat > \${SCM_REPO_PATH}/hooks/pre-commit <<EOF
#!/usr/bin/python
"""
Subversion pre-commit hook which currently checks that the commit contains
a commit message to avoid commiting empty changesets which tortoisesvn seems
to have a habbit of committing.

Based on http://svn.collab.net/repos/svn/branches/1.2.x/contrib/hook-scripts/commit-block-joke.py and hooks/pre-commit.tmpl


Hacked together by Jacques Marneweck <jacques@php.net>

\\\$Id\\\$
"""

import sys, os, string

SVNLOOK='/opt/redmine/subversion/bin/svnlook'

def main(repos, txn):
     log_cmd = '%s log -t "%s" "%s"' % (SVNLOOK, txn, repos)
     log_msg = os.popen(log_cmd, 'r').readline().rstrip('\n')

     if len(log_msg) < 10:
         sys.stderr.write ("Please enter a commit message which details what has changed during this commit.\n")
         sys.exit(1)
     else:
         sys.exit(0)

     if __name__ == '__main__':
         if len(sys.argv) < 3:
             sys.stderr.write("Usage: %s REPOS TXN\n" % (sys.argv[0]))
     else:
         main(sys.argv[1], sys.argv[2])
EOF
        chmod +x \${SCM_REPO_PATH}/hooks/pre-commit
        ;;
    git)
        ;;
    mercurial)
        ;;
    bazaar)
        ;;
    github)
        ;;
    *)
        echo "SCM not supported: \$SCM_TYPE" >&2
        ;;
esac

exit 0
EEOOFF

sudo chmod +x /opt/bin/post-create.sh

####################################################################################
http://www.redmine.org/plugins/redmine_agile

wget http://redminecrm.com/license_manager/13082/redmine_agile-1_3_2-light.zip

unzip redmine_agile-1_3_2-light.zip

sudo cp -r redmine_agile /opt/redmine/apps/redmine/htdocs/plugins/

sudo /opt/redmine/use_redmine
cd /opt/redmine/apps/redmine/htdocs
bin/rake redmine:plugins:migrate RAILS_ENV=production
sudo service bitnami-redmine restart
####################################################################################
wget https://github.com/bdemirkir/sidebar_hide/archive/master.zip

unzip master.zip

sudo cp -r sidebar_hide-master  /opt/redmine/apps/redmine/htdocs/plugins/sidebar_hide

sudo /opt/redmine/use_redmine
cd /opt/redmine/apps/redmine/htdocs
bin/rake redmine:plugins:migrate RAILS_ENV=production
sudo service bitnami-redmine restart





トップ   差分 バックアップ リロード   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2016-09-14 (水) 15:37:32