0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Redmine4.2 初期設定

Last updated at Posted at 2021-04-07

前回の投稿でVirtualbox+Bitnami Redmine4.2を入れたのでその後の設定作業内容を忘れないように書いていきます。

sshの設定をする

まずはsshでつなげられないといけないので、sshdの設定をします。
公式ページに設定方法が書いてあるのでその通りやります。

viでは、PermitPassword。。のところを編集して、一時的にsshで入れるようにしておきます。

sudo rm -f /etc/ssh/sshd_not_to_be_run
sudo vi /etc/ssh/sshd_config
sudo systemctl enable ssh
sudo systemctl start ssh

Debianのアップデート

きっと新しいライブラリになっているだろう。。と思いつつ一応。

sudo apt-get update

うん、特にアップデート無し!

bitnami@debian:~$ sudo apt-get update
Hit:1 http://deb.debian.org/debian buster InRelease
Get:2 http://security.debian.org buster/updates InRelease [65.4 kB]
Get:3 http://security.debian.org buster/updates/main amd64 Packages [271 kB]
Get:4 http://security.debian.org buster/updates/main Translation-en [145 kB]
Fetched 482 kB in 7s (67.6 kB/s)
Reading package lists... Done

日本語ファイルを入れる

結構忘れがちなのですが、RedmineでPDFファイルを作るときに日本語ファイルを忘れることが多いです。

Redmine.JPのページに記載されているとおりに日本語ファイルを入れます。

今回はdebianなので以下のコマンドですね。

sudo apt-get install fonts-ipafont

インストールが終わると、以下のパスにフォントが設置されます。

bitnami@debian:~$ ls -l /usr/share/fonts/truetype/
total 0
lrwxrwxrwx 1 root root 43 Apr  7 04:29 fonts-japanese-gothic.ttf -> /etc/alternatives/fonts-japanese-gothic.ttf
lrwxrwxrwx 1 root root 43 Apr  7 04:29 fonts-japanese-mincho.ttf -> /etc/alternatives/fonts-japanese-mincho.ttf

このパスをconfig/configuration.yml に書いていきます。
パスはもとは何も書いてないので、後ろに追加します。
sed で置き換えると楽ちん

# cp -p /opt/bitnami/apps/redmine/htdocs/config/configuration.yml /opt/bitnami/apps/redmine/htdocs/config/configuration.yml.old
# sed -e 's/minimagick_font_path:/minimagick_font_path:\/usr\/share\/fonts\/truetype\/fonts-japanese-gothic.ttf/' /opt/bitnami/apps/redmine/htdocs/config/configuration.yml

ちなみに、サンプルに書いてあるExample for Japaneseはエラーになります。(RedhatとかAmazon Linux用かな)

bitnami@debian:/opt/bitnami/apps/redmine/htdocs/config$ ls -l  /usr/share/fonts/ipa-mincho/ipam.ttf
ls: cannot access '/usr/share/fonts/ipa-mincho/ipam.ttf': No such file or directory

bash設定

llって打ったらls -lを実行してほしいので、.bashrcなども設定しておきます。

インストール直後の状態は、~/.bash_aliasesがありません。

bitnami@debian:~$ ls -la
total 28
drwxr-xr-x 2 bitnami bitnami 4096 Apr  7 04:34 .
drwxr-xr-x 3 root    root    4096 Apr  1 09:14 ..
lrwxrwxrwx 1 root    root      17 Apr  1 09:12 apps -> /opt/bitnami/apps
-rw------- 1 bitnami bitnami    0 Apr  7 03:17 .bash_history
-rw-r--r-- 1 bitnami bitnami  220 May 25  2020 .bash_logout
-rw-r--r-- 1 bitnami bitnami 3981 Apr  1 09:13 .bashrc
-r-------- 1 bitnami bitnami  422 Apr  7 02:22 bitnami_credentials
lrwxrwxrwx 1 root    root      27 Apr  1 09:12 htdocs -> /opt/bitnami/apache2/htdocs
-rw-r--r-- 1 bitnami bitnami  807 May 25  2020 .profile
lrwxrwxrwx 1 root    root      12 Apr  1 09:12 stack -> /opt/bitnami
-rw------- 1 bitnami bitnami 3038 Apr  7 04:34 .viminfo

内容はお好みで。Qiita内だとこういう記事が上位っぽい。

なんかもっと書いてたような気がするけど、とりあえずこんな感じにしています。
※最後にCtrl+Cで抜ける

bitnami@debian:~$ cat > .bash_aliases
alias ls='ls --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='clear && ll'

# ドットの数で表現
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'

# 数字で表現
alias ..2='cd ../..'
alias ..3='cd ../../..'

# apt-get
alias ag='sudo apt-get'
alias agi='sudo apt-get install'
alias agr='sudo apt-get remove'
alias agu='sudo apt-get update'

# bundle系
alias b='bundle'
alias be='bundle exec'
alias bx='bundle exec'
alias bi='bundle install'
alias bo='bundle outdated'
alias bu='bundle update'
alias rc='bundle exec rails c'

# カレントディレクトリのパスをクリップボードにコピー(cpwd, copypathなど)
alias pwdc='pwd | tr -d "\n" | pbcopy'
export HT="/opt/bitnami/apps/redmine/htdocs"

alias ctl='sudo /opt/bitnami/ctlscript.sh'
alias cdh='cd ${HT}'

function unins() {
        echo "Uninstall Redmine Plugin : ${1}  OK?(y/N)"
        read ans

        if [ "${ans}" == "y" -o "${ans}" == "Y" ] ; then
                command bundle exec rake redmine:plugins:migrate NAME=${1} VERSION=0 RAILS_ENV=production
                rm -rf /opt/bitnami/apps/redmine/htdocs/plugins/${1}
        fi
}

タイムゾーン

そういえば設定してなかったのでJSTにします。

sudo ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

ダミーデータをつくる

いろいろテストするうえでダミーデータがあったほうがはかどるのでダミーデータを作ります。
Redmine/RedMicaの動作確認・デモ用にテスト用のデータ(チケット、Wiki、フォーラム、…)を投入する
を参考にさせていただきました。

export RAILS_ENV=production
bin/rails db:fixtures:load

バナーを消す

Bitnamiは標準でヘルプ用のバナーが出てくるのですが、運用中には邪魔になるので消しておきます。

sudo /opt/bitnami/bnhelper-tool

プラグインを入れる

あとはこの辺を入れていってみる。4.2で動くのかどうかわからないので、順番に検証していきます。

drwxr-xr-x  9 bitnami bitnami 4096 Aug 17  2020 redmine_checklists/
drwxr-xr-x 14 bitnami bitnami 4096 Oct 20 12:42 redmine_issue_templates/
drwxr-xr-x 11 bitnami bitnami 4096 Oct 20 12:13 redmine_knowledgebase/
drwxr-xr-x 10 bitnami bitnami 4096 Oct 20 12:21 redmine_messenger/
drwxr-xr-x  8 bitnami bitnami 4096 Jun 12  2020 redmine_pivot_table/
drwxr-xr-x  9 bitnami bitnami 4096 Jun 12  2020 redmine_theme_changer/
drwxr-xr-x  9 bitnami bitnami 4096 Jun 12  2020 redmine_work_time/
drwxr-xr-x  7 bitnami bitnami 4096 Jun 12  2020 sidebar_hide/
drwxr-xr-x 11 bitnami bitnami 4096 Jun 12  2020 view_customize/

work_timeはたしか何かせっていがひつようだったきがする

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?