LoginSignup
0
0

More than 3 years have passed since last update.

Ubuntu 18.04にKallitheaを構築する

Last updated at Posted at 2020-09-22

概要

KallitheaはGit と Mercurial に対応したオープンソース(GPLv3)のリポジトリホスティングソフトウェアです.
今回はそのKallitheaをubuntu上に構築していきます.

Kallitheaとは

環境

Software Version
ESXi 6.7
Ubuntu 18.04

パッケージのアップデート

sudo apt update

インストール

1. パッケージのインストール

sudo apt install build-essential git libffi-dev python3-dev npm mercurial python3-pip

2. ディレクトリを作成

  • 今回は/opt配下に構築していきます
# kallitheaとリポジトリ配置用のディレクトリ(repos)を作成
sudo mkdir -p /opt/kallithea/repos
# 書き込み可能なパーミッションに変更
sudo chmod -R 777 /opt/kallithea

3. kallitheaのインストール

# kallitheaディレクトリに移動
cd /opt/kallithea
# kallitheaをインストール
pip3 install kallithea

初期セットアップ

1. Kallithea構成ファイルの作成

# kallitheaディレクトリに移動
cd /opt/kallithea
# 構成ファイルの作成
kallithea-cli config-create my.ini

2. Kallitheaで使用するDBの作成

kallithea-cli db-create -c my.ini

#下記が聞かれる
Are you sure to destroy old database ? [y/n]y
Enter a valid absolute path to store repositories. All repositories in that path will be added automatically: /opt/kallithea/repos
Specify admin username:<管理者アカウントのユーザ名>
Specify admin password (min 6 chars):<パスワード>
Confirm password:<再度パスワード>
Specify admin email:<メールアドレス>

3. フロントエンドファイルの作成

kallithea-cli front-end-build

Kallitheaの実行

# 起動
gearbox serve -c my.ini

# デーモン化
gearbox serve -c my.ini --daemon
  • http://localhost:5000 でアクセスできる

  • Port及びIPを変更したい場合はmy.iniの[server:main]セクションで変更する.

[server:main]
host = 127.0.0.1
port = 5000

サブディレクトリで運用する

  • Apacheでの設定例です.

1. Apacheの仮想ホストファイルの設定

  • 仮想ホストファイルに下記を追記
<Location /kallithea >
  ProxyPass http://127.0.0.1:5000/kallithea
  ProxyPassReverse http://127.0.0.1:5000/kallithea
  SetEnvIf X-Url-Scheme https HTTPS=1
</Location>

2. my.iniファイルに設定を追記

  • my.iniファイルの[app:main]セクションに下記を追記
[app:main]
use = egg:kallithea

# 下記を追記
filter-with = proxy-prefix
  • 最終行に下記を追記
[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /kallithea
  • http://<サーバアドレス>/kallitheaでアクセスできるようになる

参考

Kallitheaのインストール手順

Kallithea Installation on Unix/Linux

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