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
>
set-bitbucket-home.bat\bin\
- Linux and Mac:
<Bitbucket Server installation directory
>/bin/set-bitbucket-home.sh
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
. The Bitbucket home directory, as defined by the <Bitbucket Server installation directory>
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).
可能であれば、Bitbucket ホーム ディレクトリには移動の必要がない場所を選択します。ホーム コンテンツの一部は場所に依存するため、ホーム ディレクトリを移動させると壊れてしまうことがあります。ホーム ディレクトリが移動されたことを検出すると Bitbucket Server はコンテンツを更新しようとしますが、問題を防ぐため、ホーム ディレクトリを同じ場所に置くことをおすすめします。
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/native | Tomcat の APR ベースのネイティブ ライブラリなどのネイティブ ライブラリが含まれます。 |
log | Bitbucket Server のログ ファイルを含みます。 |
shared/plugins | Bitbucket 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.
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 ホームの場所には、後から変更する必要がない場所を使用してください。