Install Bitbucket Server from an archive file

このページでは、アーカイブ ファイルから Bitbucket Server を手動でインストールする方法について説明します。ただし、インストールを素早く問題なく実行するために、Bitbucket Server インストーラーを使用することを強くおすすめします。

関連ページ

1. サポート対象プラットフォームを確認する

Bitbucket Server でのテストが実施済みの、推奨されるアプリケーション サーバー、データベース、オペレーティング システム、Web ブラウザ、および Java や Git のバージョンについては、「サポート対象プラットフォーム」のページを参照してください。

アトラシアンでは、x86 ハードウェアおよび x86 ハードウェアの 64 ビット拡張版で動作する Bitbucket Server のみを公式にサポートしています。

Cygwin Git はサポート対象外です。このプラットフォームでの内部テストは実行されておらず、Bitbucket Server の機能の多くの側面 (プル リクエストやフォークなど) に既知の問題があります。Windows で Bitbucket Server を実行する際には必ず msysGit を使用してください。

2. Java のバージョンを確認する

ターミナルまたはコマンド プロンプトで以下を実行します。

java -version

Java のバージョンは 1.8.x である必要があります。64 ビット版オペレーティング システムをお使いの場合は、64 ビット バージョンの Java が必要となります。

Linux でサポート対象バージョンが表示されない場合、Java を取得...

Java をインストール

Oracle の Web サイトから Java Server JRE をダウンロードしてインストールします。

Now try running 'java -version' again to check the installation. The version of Java should be  1.8.x.

システムが Java を検出できることを確認します。

ターミナルで、以下を実行します。

echo $JAVA_HOME

You should see a path like /usr/jdk/jdk1.8.0.

パスが表示されない場合は、JAVA_HOME を設定します。

次のいずれかの操作を行います。

  • If JAVA_HOME is not set, log in with 'root' level permissions and run:

    echo JAVA_HOME="path/to/JAVA_HOME" >> /etc/environment

    where  path/to/JAVA_HOME may be like: /usr/jdk/jdk1.8.0

  • If JAVA_HOME needs to be changed, open the  /etc/environment file in a text editor and modify the value for JAVA_HOME to:
    JAVA_HOME="path/to/JAVA_HOME"

    It should look like: /usr/jdk/jdk1.8.0

macOS でサポート対象バージョンが表示されない場合、Java を取得...

Java をインストール

Oracle の Web サイトから Java Server JRE をダウンロードしてインストールします。

Now try running 'java -version' again to check the installation. The version of Java should be 1.8.x .

システムが Java を検出できることを確認します。

ターミナルで、以下を実行します。

echo $JAVA_HOME
You should see a path like /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/.

パスが表示されない場合は、JAVA_HOME を設定します。

Open your ~/.profile file in a text editor and insert:

JAVA_HOME="path/to/JAVA_HOME"
export JAVA_HOME

where path/to/JAVA_HOME may be like: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/

Refresh your ~/.profile in the terminal and confirm that JAVA_HOME is set:

source ~/.profile
$JAVA_HOME/bin/java -version

Java バージョン 1.8.x が次のように表示されます。

java version "1.8.0_1"

Windows でサポート対象バージョンが表示されない場合、Java を取得...

Java をインストール

Oracle の Web サイトから Java Server JRE をダウンロードしてインストールします。

Now try running 'java -version' again to check the installation. The version of Java should be 1.8.x.

システムが Java を検出できることを確認します。

Bitbucket Server は JAVA_HOME 環境変数を使用して Java を見つけます。これを確認するには、コマンド プロンプトで以下を実行します。

echo %JAVA_HOME%

You should see a path to the root directory of the Java installation. When running Bitbucket Server on Windows, unlike Linux or Unix, JAVA_HOME paths with spaces are just fine.

パスが表示されない場合は、JAVA_HOME を設定します。

Windows 7 ...

ステージ 1. Java インストール ディレクトリを見つける

JRE のインストール パスがすでに分かっている場合、下記の手順 2へ進んでください。それ以外の場合、次の手順に従ってインストール パスを見つけてください:

  1. If you didn't change the installation path for the Java Runtime Environment during installation, it will be in a directory under C:\Program Files\Java. Using Explorer, open the directory C:\Program Files\Java.
  2. Inside that path will be one or more subdirectories such as C:\Program Files\Java\jre8

ステージ 2. JAVA_HOME 変数を設定する

  1. [Start] に移動し、"sys env" を検索してから、[Edit the system environment variables] を選択します。
  2. [Environment Variables] をクリックした後、[System variables] の下で [New] をクリックします。
  3. variable name に「JAVA_HOME」と入力し、Variable value として、Java のインストール先の絶対パスを入力します。末尾にバックスラッシュを使用したり、値を引用符で囲んだりしないでください。

Now, in a new command prompt,  try running '%JAVA_HOME%\bin\java -version'. You should see the same version of Java as you saw in 2. above.

Windows Server 2003 R2 ...

ステージ 1. Java インストール ディレクトリを見つける

JRE のインストール パスがすでに分かっている場合、下記の手順 2へ進んでください。それ以外の場合、次の手順に従ってインストール パスを見つけてください:

  1. If you didn't change the installation path for the Java Runtime Environment during installation, it will be in a directory under C:\Program Files\Java. Using Explorer, open the directory C:\Program Files\Java.
  2. Inside that path will be one or more subdirectories such as C:\Program Files\Java\jre8

ステージ 2. JAVA_HOME 変数を設定する

JRE インストール パスを特定したあと:

  1. デスクトップの マイ コンピュータ アイコンを右クリックして プロパティ を選択します。
  2. 詳細設定 タブをクリックします。
  3. 環境変数 ボタンをクリックします。
  4. システム環境変数 領域で、新規 をクリックします。
  5. 変数名として「JAVA_HOME」と入力します。
  6. variable value に Java Development Kit (JDK) のインストール パスを入力します。末尾にバックスラッシュを使用したり、値を引用符で囲んだりしないでください。
    • If your Java installation directory has a space in its path name, you should use the shortened path name (e.g. C:\Progra~1\Java\jre7) in the environment variable instead.

      64 ビットシステムの Windows ユーザー向け注記

      Progra~1 = 'Program Files'
      Progra~2 = 'Program Files(x86)'

  7. OK をクリックします。
  8. 変更の適用 をクリックします。
  9. これらの変更を加える前に開いていたすべてのコマンド ウィンドウを閉じ、新しいコマンド ウィンドウを開きます。実行中のコマンド プロンプトから環境変数をリロードすることはできません。コマンド プロンプトを一旦閉じ、再度開いても、変更が反映されない場合は、Windows を再起動してください。

Now, in a new command prompt,  try running '%JAVA_HOME%\bin\java -version'. You should see the same version of Java as you saw in 2. above.

3. Git および Perl のバージョンを確認する

ターミナルまたはコマンド プロンプトで以下を実行します。

git --version
perl --version

Git のバージョンは 1.8.x 以降である必要があります。Perl のバージョンは 5.8.8 以降である必要があります。

Git および Perl のサポート対象バージョンが見つからない場合、それらをインストールまたはアップグレードする必要があります。「Git のインストールとアップグレード」を参照してください。

4. Bitbucket Server を取得する 

アトラシアンのダウンロード サイトから Bitbucket Server をダウンロードします。Bitbucket Server WAR ファイルをお探しですか?

ダウンロードしたファイルをインストール場所に展開します (パスにスペースは含まないこと)。 

The path to the extracted directory is referred to as the <Bitbucket Server installation directory> in these instructions.

Never unzip the Bitbucket Server archive file over the top of an existing Bitbucket Server installation –  each version of Bitbucket Server includes versioned jar files, such as  bitbucket-model-4.0.0.jar . If you copy these, you end up with multiple versions of Bitbucket Server's jar files in the classpath, which leads to runtime corruption.

Bitbucket Server の展開と Bitbucket Server の実行 (ステップ 6.) には同じユーザー アカウントを使用し、起動時に権限の問題が発生するのを回避します。本番環境インストールの場合、システムで Bitbucket Server を実行する新しい専用ユーザーを作成することをおすすめします。「Bitbucket Server を専用ユーザーで実行する」をご参照ください。

5. Bitbucket Server にデータの保存先を指定する

Bitbucket ホーム ディレクトリは、Bitbucket Server のデータが格納される場所です。

If you are upgrading Bitbucket Server, simply update the value of BITBUCKET_HOME in the <Bitbucket Server installation directory>/bin/set-bitbucket-home file so the new Bitbucket Server installation points to your existing Bitbucket Server home directory (if you use a BITBUCKET_HOME environment variable to specify the home directory location, no change is required).

Otherwise, for a new install, 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 (or set-bitbucket-home.bat) 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:

#
if ["x${BITBUCKET_HOME}" = "x"]; then
    export BITBUCKET_HOME="/home/username/bitbucket_home"
fi

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 may be overwritten, and lost, when Bitbucket Server gets upgraded. And by the way, you'll need separate Bitbucket Server home directories if you want to run multiple instances of Bitbucket Server.

Windows の場合の注意事項をクリックして確認...

Tell Bitbucket Server where you created it by setting a BITBUCKET_HOME environment variable, for Windows 7, as follows:

  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 ホーム ディレクトリを設定する際は、次の点を確認しておくことをおすすめします。

6. Move server.xml to your Bitbucket Server home shared directory

新規インストールの場合や、Stash 3.8 以降をすでに実行している場合は、次の手順にスキップできます。

If you are upgrading from Stash 3.7 or earlier and you made any changes to <Bitbucket Server installation directory>/conf/server.xml (for instance to secure your server with SSL):

  1. In the <BITBUCKET_HOME> directory, make a new directory called shared.
  2. Then, copy your modified server.xml file into <BITBUCKET_HOME>/shared/. Ensure the copied file is readable by the user account that runs Bitbucket Server.

7. (オプション) リモート Elasticsearch インスタンスのインストールと構成

Bitbucket Server 4.5+ にはバンドルされた Elasticsearch インスタンスが付属します。これは Bitbucket Server アプリケーションとは別のプロセスとして実行され、追加設定は不要です。 

バンドルされた Elasticsearch インスタンスを使用する予定がある場合、次のステップ「Bitbucket Server を開始する」に移動してください。 

However, you can also install Elasticsearch on a remote machine, which can provide some advantages allocating memory resources. Read the instructions for installing and configuring a remote Elasticsearch instance here: How to Install and configure a remote Elasticsearch instance.

Elasticsearch のポート

Bitbucket Server にバンドルされる Elasticsearch インスタンスでは、コード検索機能を提供するため、ポート 7992 および 7993 を使用する必要があります。これを変更することはできないため、これらのポートが利用可能であることを確認してください。


8. Bitbucket Server を開始する

There are a couple of ways in which you can start Bitbucket Server – see Start and stop Bitbucket.

リモート Elasticsearch インスタンスをセットアップした場合、バンドルされた Elasticsearch インスタンスの起動は不要な場合があります。

リモート Elasticsearch インスタンスで Bitbucket Server を起動する方法

When using a remote Elasticsearch instance, instead of the bundled Elasticsearch instance, start Bitbucket Server by running start-webapp.sh instead of start-bitbucket.sh. This starts Bitbucket Server alone without running the bundled Elasticsearch instance.

Bitbucket Server での設定を完了する

次に、ブラウザで http://localhost:7990/ に移動し、セットアップ ウィザードを実行します。セットアップ ウィザードで次の手順を行います。

9. メール サーバーをセットアップする

メール サーバーを設定して、ユーザーが自身のパスワードを生成するリンクを Bitbucket Server から受信できるようにします。「メール サーバーのセットアップ」を参照してください。

10. ユーザーとディレクトリを追加する

次に、Bitbucket Server でユーザーをセットアップし、既存のディレクトリについて Bitbucket Server に示します。詳細については、以下のページを参照してください。

本番環境用の追加手順

For production or enterprise environments we recommend that you configure the additional aspects described on Use Bitbucket in the enterprise. The aspects described there are not necessary when you are installing for evaluation purposes only.

Linux または Windows で Bitbucket Server をサービスとしてインストールしたい場合、次のいずれかを参照してください。

 

Bitbucket Server の停止

See Start and stop Bitbucket.

Bitbucket Server のアンインストール

To uninstall Bitbucket Server, stop Bitbucket Server as described above and then delete the <Bitbucket Server installation directory> and Set the home directory.

最終更新日: 2023 年 2 月 26 日

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

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