# LinuxでKeeper SSOコネクトをサービスとして実行

サーバーを設定して動作可能になったら、SSOコネクトをサービスとして設定してください。この操作はご利用のOSによって異なります。

1. ウェブインターフェースで設定したためにアプリケーションがまだ動作中の場合は、コマンドラインで*CTRL-C*を入力して、実行中のインスタンスを停止します。
2. rootユーザーとして、以下の内容のシステム起動ファイル`/etc/systemd/system/ssoconnect.service`を作成します (/path/to/keeperを正確なパスに置き換え、<ユーザー名 (user) >をプロセスを実行するユーザー名に置き換えます)

```
[Unit]
Description=SSO Connect Java Daemon 

[Service]
WorkingDirectory=/path/to/keeper （すなわち、/home/keeperservice/sso_connect）
User=<ユーザー名（user）> （すなわち、root）
ExecStartPre=/bin/sleep 10 
ExecStart=/usr/bin/java -jar /path/to/keeper/SSOConnect.jar

[Install]
WantedBy=multi-user.target
```

ファイルの権限を変更します。

```
sudo chmod 644 /etc/systemd/system/ssoconnect.service
```

サービスの自動起動を有効にします。

```
sudo systemctl enable ssoconnect.service
```

systemctlを実行してサービスを開始します。

```
$ systemctl start ssoconnect
$ systemctl status ssoconnect
```

#### Linuxのトラブルシューティング

サービスに対する応答をテストしたり、Keeper SSOコネクトインスタンスの正常性を監視したりするには、「Ping URL」を照会してください。上記の例では以下のようにします。

```
http://127.0.0.1:9000/ping
```

ポートフォワードを使用してローカルインスタンスに接続したため、ここでは、ローカルホストにpingしていることにご注意ください。 外部 (外部ユーザー) からサービスの実行を確認するには、公開ポートをご使用ください。

```
$ curl "https://<公開IPアドレスまたはDNS名（public_ip_or_dns）>:<ポート番号（port）>/ping"
```

リクエスト/レスポンスの例:

```
curl "https://sso.acme-demo.com:8443/ping"
​
{"configuration":"Running","sync_revision":41838,"sync":"Thu Nov 21 07:36:51 UTC 2019","version":"o14.1.2.4","sso":"Running","status":"Ready"}
```

デフォルトで`/path/to/keeper/logs/ssoconnect.log`にあるログファイルを確認できます。ログは、インストールディレクトリにある標準の`log4j2.xml`ファイルを使用して記録されます。`log4j2.xml`ファイルを変更して、ログファイルをどこでも好きな場所に配置できます。

```
$ tail -f /path/to/keeper/logs/ssoconnect.log
```

次のセクションでは、主要なベンダーごとのIDプロバイダの設定手順について説明します。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeper.io/sso-connect-on-prem/jp/installation-and-setup/installation-linux/running-keeper-sso-connect-as-a-service-on-linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
