Bitbucket Server のホーム ディレクトリ

Bitbucket ホーム ディレクトリは Bitbucket Server インストーラーによって自動的に作成されます – Bitbucket Server のインストールと使用開始については、「Bitbucket Server インストール ガイド」を参照してください。

このページの情報は、Bitbucket Server を手動でインストールまたはアップグレードする場合にのみ適用されます。

On this page:

Bitbucket ホーム ディレクトリとは

The Bitbucket home directory is where your Bitbucket Server data is stored. The home directory location is defined either by the BITBUCKET_HOME environment variable, or in the BITBUCKET_HOME line of:

  • Windows: <Bitbucket Server installation directory>\bin\set-bitbucket-home.bat
  • Linux and Mac: <Bitbucket Server installation directory>/bin/set-bitbucket-home.sh

(warning) Bitbucket Server 4.0 and later versions don't allow the Bitbucket Server home directory to be the same directory as, or a subdirectory of, the  <Bitbucket Server installation directory> . The Bitbucket home directory, as defined by the BITBUCKET_HOME variable, must be in a separate location – Bitbucket Server will fail on startup otherwise. And by the way, you'll need separate Bitbucket Server home directories if you want to run multiple instances of Bitbucket Server (when these are not nodes for a Bitbucket Data Center).

(warning) 可能であれば、Bitbucket ホーム ディレクトリには移動の必要がない場所を選択します。ホーム コンテンツの一部は場所に依存するため、ホーム ディレクトリを移動させると壊れてしまうことがあります。ホーム ディレクトリが移動されたことを検出すると Bitbucket Server はコンテンツを更新しようとしますが、問題を防ぐため、ホーム ディレクトリを同じ場所に置くことをおすすめします。

(warning) Where possible, do not configure Bitbucket Server instances to use a UNC path. This can cause issues forking and merging pull requests. Instead, map a network drive or use the mklink command to create a symbolic link to the networked location and update BITBUCKET_HOME  to reference the new drive letter/path.

Bitbucket ホーム ディレクトリの内容

Bitbucket ホーム ディレクトリには、次のディレクトリとファイルが含まれます。

パス説明
cachesキャッシュおよびインデックス ファイルを含みます。これらのファイルはアプリケーションの再起動の間に削除するのが安全ですが、Bitbucket Server の実行中は変更または削除しないでください。
shared/configアプリケーションの構成が含まれます。
shared/data外部データベースが設定されていない場合、Git リポジトリ、プロジェクト アバター、および埋め込みの HSQL データベースを含みます。
exportデータベース移行中に生成されたダンプ ファイルを含みます。
lib MySQL JDBC ドライバなどのサード パーティ製 jar が含まれます。
lib/nativeTomcat の APR ベースのネイティブ ライブラリなどのネイティブ ライブラリが含まれます。
logBitbucket Server のログ ファイルを含みます。
shared/pluginsBitbucket Server のプラグイン関連データ (外部からアップロードされたプラグインなど) を含みます。
tmpシステムによって作成された一時ファイルが含まれます。Bitbucket Server が実行中でない場合にコンテンツを安全に削除できます。
shared/bitbucket.propertiesデータベース接続プール サイズや使用する Git バイナリの場所など、Bitbucket Server の動作方法をさまざまな側面で構成できます。このファイルは、データベースの移行時に自動的に作成されます。手動で作成することもできます。詳細は、「Bitbucket Server の構成プロパティ」を参照してください。

Bitbucket ホーム ディレクトリの設定

Bitbucket ホーム ディレクトリは、Bitbucket Server インストーラーによって自動的に作成されます

Only when you are installing Bitbucket Server from an archive file will you need to set the value of  BITBUCKET_HOME yourself, as described in this section.

Linux または Mac で BITBUCKET_HOME を設定する場合はこちらをクリック...

Create your Bitbucket home directory (without spaces in the name), and then tell Bitbucket Server where you created it by editing the <Bitbucket Server installation directory>/bin/set-bitbucket-home.sh file – uncomment the BITBUCKET_HOME line and add the absolute path to your home directory. Here's an example of what that could look like when you're done:

Windows で BITBUCKET_HOME を設定する場合はここをクリック...

Create your  Bitbucket Server home directory, and then tell Bitbucket Server where you created it by setting a BITBUCKET_HOME environment variable, as follows.

Windows 7 の場合:

  1. [スタート] に移動し、「sys env」を検索してから、[システム環境変数の編集] を選択します。
  2. [環境変数] をクリックした後、[システム変数] の下で [新規] をクリックします。
  3. Enter "BITBUCKET_HOME" as the Variable name, and the absolute path to your Bitbucket home directory as the Variable value. Don't use a trailing backslash.

Windows で Bitbucket ホーム ディレクトリを設定する際は、次の点を確認しておくことをおすすめします。

  • You should not locate your Bitbucket home directory inside the  <Bitbucket Server installation directory> — they should be entirely separate locations. If you do put the home directory in the  <Bitbucket Server installation directory> it will be overwritten, and lost, when Bitbucket Server gets upgraded. And, by the way, you can't use the same Bitbucket home directory for multiple instances of Bitbucket Server.
  • Bitbucket ホーム ディレクトリへのパスの長さはできるだけ短くします。詳細は、「Bitbucket Server でプル リクエストのマージ diff を作成できない」を参照してください。
  • Bitbucket ホーム ディレクトリへのパスにスペースを使用することはできません。

 

Bitbucket ホーム ディレクトリの保護

The internal database files, the migration dump files and bitbucket.properties all contain information that may be considered secret (server settings, salted and hashed user passwords, database passwords, etc).

本番環境では、不正なアクセスからこのディレクトリを保護することを強くおすすめします。 

次の予防措置をおすすめします。

  • Bitbucket Server を実行しているマシンに、別の制限付きユーザー アカウント (root / adminisrator ユーザーではない) を割り当てる
    • ポート 80 で Bitbucket Server を実行したい場合、「Bitbucket Server と Apache HTTP Server を連携する」の説明に従い、別の http フロント エンドを使用します (ホーム ディレクトリのセキュリティが重要な場合は、root / administrator として実行しないでください)。
  • Bitbucket Server を実行するユーザーのみが Bitbucket ホーム ディレクトリにアクセスできること、および、オペレーティング システム上でファイル システム権限を適切に設定することでこのユーザーが読み取り、書き込みおよび実行権限を持っていることを確認する

リポジトリについて

As noted above, data contains the Git repositories being managed by Bitbucket Server, where "managed by Bitbucket Server" are the operative words. The repositories are for Bitbucket Server to interact with, and they are configured and managed accordingly. They are not a mechanism for configuring Bitbucket Server behavior. We strongly recommend that customers never modify them, nor interact with them directly. They are intentionally structured in a way which does not lend itself well to direct interaction.

Git リポジトリには、ディスクでのリポジトリの格納方法や動作方法に関する標準的な側面が存在します。ただし、それらの厳密な構成方法は、Bitbucket Server リリースの間で変更される場合があります。Bitbucket Server はお客様によって適用された予期せぬ構成変更を保持することは行いません。また、これらの変更により、実行中やアップグレード時に不具合が発生する可能性があります。Bitbucket Server の挙動に構成したいものがある場合、リポジトリを直接変更するのではなく、jira.atlassian.com に機能リクエストを作成してください。

リポジトリでは大文字と小文字が区別されます。Bitbucket ホーム ディレクトリを移動すると、起動時に Bitbucket Server がディスクのリポジトリを更新する間、システムが短時間ロックされます。更新が正常に適用されたと見なされた場合、システムはロックを解除して通常の使用を許可します。

可能であれば、Bitbucket Server ホームの場所には、後から変更する必要がない場所を使用してください。

最終更新日 2020 年 11 月 17 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.