参考
https://www.greptips.com/posts/1238/
https://qiita.com/You_name_is_YU/items/34a09ab130e89fbfc459
https://qiita.com/TaskeHAMANO/items/b01f2d8590c23d6b2bce
前提
- CentOS7にGitLabを立てる。
- Apache から nginxへリバースプロキシ
- Apache はSSL利用する
インストール
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash sudo EXTERNAL_URL="http://ホスト名[ポート][/サブディレクトリ]" yum install -y gitlab-ce
例
sudo EXTERNAL_URL="http://localhost:8888/gitlab" yum install -y gitlab-ce
ポートやサブディレクトリは必ず指定しなくても良いし、あとで変更することも出来る。
sudo EXTERNAL_URL="http://localhost" yum install -y gitlab-ce
とりあえず、これで進めてしまっても良い。
設定
ホスト名、ポート、サブディレクトリ
/etc/gitlab/gitlab.rb
external_url 'http://localhost:8021/gitlab'
を書き換える。
設定を反映させるには以下の手順が必要。
gitlab-ctl stop unicorn gitlab-ctl stop sidekiq gitlab.rbを書き換え gitlab-ctl reconfigure gitlab-ctl restart
apacheのリバースプロキシ設定とSSLの設定
vim /etc/httpd/conf.d/gitlab.conf
<Location /gitlab> ProxyRequests off ProxyPass http://127.0.0.1:8021/gitlab ProxyPassReverse http://127.0.0.1:8021/gitlab Header edit Location ^http:// https:// </Location> <Location /assets> ProxyRequests off ProxyPass http://127.0.0.1:8021/assets ProxyPassReverse http://127.0.0.1:8021/assets Header edit Location ^http:// https:// </Location>
GitLabのデータの場所は以下のパスにある
データの場所
/opt/gitlab /var/opt/gitlab
GitLab のログ
/var/log/gitlab
使い方
設定したURLを開く
rootのパスワード設定
パスワード設定の画面表示されるのでパスワードを設定。
root でログインできるようになる。
ユーザの新規を無効にする
個人で設置する場合、新規ユーザはroot権限で行えばいいので
サインイン画面のユーザ新規ボタンはいらない。
rootでログインし、管理者画面の settings -> Sign-up restrictions -> Sign-up enabled のチェックを外す。
gitlab-ctlコマンド
- gitlab-ctl reconfigure
- 設定を再読込
- gitlab-ctl stop
- 各サービス停止
- gitlab-ctl start
- 各サービス起動
- gitlab-ctl status
- 各サービスの状態表示
- gitlab-ctl tail
- ログ表示
[カテゴリ: OS > Linux]
[通知用URL]
Tweet
最終更新時間:2018年09月08日 15時04分31秒