{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Linuxサーバーの導入","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"linuxサーバーの導入","__idx":0},"children":["Linuxサーバーの導入"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["MoreLogin をヘッドレス Ubuntu サーバーにデプロイし、ローカル API 経由でブラウザ プロファイルを自動化します。デスクトップ環境は必要ありません。"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"達成できること","__idx":1},"children":["達成できること"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["このガイドを終えると、次のことができるようになります。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ubuntu 24.04 ヘッドレス サーバー上で実行中の MoreLogin インスタンス"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["外部マシンが CDP (Chrome DevTools プロトコル) 経由で接続できるように構成されたネットワーク転送"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ブラウザー プロファイルを作成、起動、制御、クリーンアップする、動作する Python 自動化スクリプト"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"アーキテクチャの概要","__idx":2},"children":["アーキテクチャの概要"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"┌──────────────────────────────────────────────────────────┐\n│                    Ubuntu 24.04 Server                   │\n│                                                          │\n│  ┌──────────────┐    ┌───────────────────────────────┐   │\n│  │   xvfb       │───▶│  MoreLogin AppImage           │   │\n│  │ (virtual     │    │  Local API :40000             │   │\n│  │  display)    │    │  CDP debug :<dynamic>         │   │\n│  │              │    │    (127.0.0.1, per profile)   │   │\n│  └──────────────┘    └───────────────────────────────┘   │\n│                              │                           │\n│                        socat forwarding                  │\n│                              │                           │\n│                     0.0.0.0:40001 → 127.0.0.1:40000      │\n│                     0.0.0.0:<N+1> → 127.0.0.1:<N>        │\n└──────────────────────────────────────────────────────────┘\n                               │\n                          External machine\n                     (Playwright / Puppeteer / Selenium)\n"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!NOTE]"," ","CDP デバッグ ポートは ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["動的"]}," です。各ブラウザ プロファイルは、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/env/start"]}," エンドポイントによって返される独自のポートを取得します。上の図では、プレースホルダーとして ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<N>"]}," を使用しています。"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"前提条件","__idx":3},"children":["前提条件"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"要件"},"children":["要件"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"詳細"},"children":["詳細"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["オペレーティング システム"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ubuntu 24.04 サーバー (x86_64)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["推奨スペック"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["8 vCPU、8 GB RAM (最大 5 つの同時プロファイルをサポート)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ネットワーク"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["アウトバウンドインターネットアクセス。受信ポート ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["40001"]}," と選択した転送 CDP ポートを開くか、代わりに SSH トンネルを使用します"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Python"]}," (オプション)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["サンプル スクリプトを実行するための Python 3.8 以降と ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pip"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ステップ-1--システムの依存関係をインストールする","__idx":4},"children":["ステップ 1 — システムの依存関係をインストールする"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["SSH 経由でサーバーに接続し、必要なパッケージをインストールします。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# FUSE support (required for AppImage)\nsudo apt install -y libfuse2t64\n\n# GTK / accessibility / display libraries\nsudo apt install -y libatk1.0-0 libatk-bridge2.0-0 libatspi2.0-0\nsudo apt install -y libcups2\nsudo apt install -y libgtk-3-0 libgdk-pixbuf2.0-0\nsudo apt install -y libgbm1 libxkbcommon0 libasound2t64\n\n# Virtual framebuffer (headless display)\nsudo apt install -y xvfb\n\n# TCP forwarder\nsudo apt install -y socat\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"フォントのインストール-オプション","__idx":5},"children":["フォントのインストール (オプション)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ブラウザ ページにテキストが表示されない場合、または文字が欠落している場合は、対応するフォント パッケージをインストールします。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# CJK (Chinese, Japanese, Korean)\nsudo apt install -y fonts-noto-cjk fonts-noto-cjk-extra\n\n# Arabic\nsudo apt install -y fonts-noto-color-emoji fonts-noto-extra\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["他の言語の場合は、対応する ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://fonts.google.com/noto"},"children":["Noto フォント ファミリー"]}," パッケージをインストールしてください。"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ステップ-2--morelogin-をダウンロードして起動する","__idx":6},"children":["ステップ 2 — MoreLogin をダウンロードして起動する"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"21-appimageをダウンロードする","__idx":7},"children":["2.1 AppImageをダウンロードする"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"wget https://get.morelogin.com/client/prod/linux/x64/2.54.0/MoreLogin_x86_64_2.54.0.AppImage\nchmod +x MoreLogin_x86_64_2.54.0.AppImage\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2.54.0"]}," を、MoreLogin アカウントまたは ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.morelogin.com/download/"},"children":["ダウンロード ページ"]}," から入手できる最新バージョンに置き換えます。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"22-バックグラウンドでさらにログインを開始する","__idx":8},"children":["2.2 バックグラウンドでさらにログインを開始する"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xvfb-run"]}," を使用して仮想ディスプレイを提供し、AppImage を実行します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"nohup xvfb-run -a ./MoreLogin_x86_64_2.54.0.AppImage --no-sandbox > morelogin.log 2>&1 &\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["正常に開始されたことを確認します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Check the process is running\nps aux | grep MoreLogin\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["プロセスが完全に初期化されるまでに 5 ～ 10 秒かかる場合があります。"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ステップ-3--api-経由で-morelogin-にログインする-必須","__idx":9},"children":["ステップ 3 — API 経由で MoreLogin にログインする (必須)"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!CAUTION]"," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["他のローカル API エンドポイントを呼び出す前にログインする必要があります。"]}," ヘッドレス サーバーには手動でログインするための GUI がないため、API 経由で認証する必要があります。この手順を行わないと、すべての API 呼び出しは次の値を返します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\"status\": \"error\", \"code\": 401, \"message\": \"ログインステータスの有効期限が切れています。再度ログインしてください\"}\n","lang":"json"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"31-api-認証情報を取得する","__idx":10},"children":["3.1 API 認証情報を取得する"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["MoreLogin デスクトップ クライアント (ログインしている任意のマシン上) を開き、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["設定 → API と MCP"]}," に移動します。 ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Open API"]}," セクションから ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["APP ID"]}," と ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Key"]}," をコピーします。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image.cfac9a4c31ae47e8434739e42cab4601ee08d737bba4fccba40f2f3bc78e9648.e4db3d38.png","alt":"MoreLogin API 設定 — オープン API セクションから APP ID と API キーをコピー"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"32curl経由でログインする","__idx":11},"children":["3.2curl経由でログインする"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["資格情報を使用してログイン エンドポイントを呼び出します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST http://127.0.0.1:40000/api/user/login \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"apiId\": \"YOUR_APP_ID\",\n    \"apiKey\": \"YOUR_API_KEY\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["成功した応答は次のようになります。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\"code\": 0, \"msg\": null, \"data\": true}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"33-ログインの確認","__idx":12},"children":["3.3 ログインの確認"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ブラウザー プロファイルを一覧表示して、API の準備ができていることを確認します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -s -X POST http://127.0.0.1:40000/api/env/page \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"pageNo\": 1, \"pageSize\": 1}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{\"code\":0, ...}"]}," 応答は、ログインしていて API の準備ができていることを意味します。"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["チェックポイント:"]}," MoreLogin サーバーは完全に動作しています。リモート アクセスの場合は ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-4--configure-network-forwarding-socat"},"children":["ステップ 4"]}," に進むか、同じサーバー上でスクリプトを実行する場合は直接 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-5--quick-automation-example"},"children":["ステップ 5"]}," に進みます。"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!NOTE]"," ","ログイン セッションは、MoreLogin プロセスが実行されている限り継続します。 AppImage を再起動する場合は、再度ログインする必要があります。"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ステップ-4--ネットワーク転送の構成-socat","__idx":13},"children":["ステップ 4 — ネットワーク転送の構成 (socat)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["デフォルトでは、ローカル API (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[":40000"]},") と CDP デバッグ ポートの両方が ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["127.0.0.1"]}," にバインドされます。外部マシン (開発用ラップトップなど) からアクセスする必要がある場合は、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["socat"]}," を使用してトラフィックを転送します。"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!WARNING]"," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["セキュリティ上のリスク - これらのポートを公共のインターネットに公開しないでください。"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ローカル API には、ほとんどのエンドポイントに対して ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["認証が組み込まれていません"]},"。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["CDP デバッグ ポートにより、ブラウザ インスタンスの ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["完全なリモート コントロール"]},"が許可されます (Cookie の読み取り、スクリプトの挿入、スクリーンショットのキャプチャ)。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["推奨事項:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["リモート アクセスには socat の代わりに ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SSH トンネル"]},"を使用します: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ssh -L 40000:127.0.0.1:40000 user@server"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["socat を使用する必要がある場合は、ファイアウォール ルールを使用してアクセスを ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["特定の IP のみ"]},"に制限してください"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["VPN"]}," またはクラウド プロバイダーのセキュリティ グループを使用して、受信トラフィックを制限します"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["IP 制限なしで、公開サーバー上でポート ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["40001"]}," / CDP ポートを ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0.0.0.0"]}," に決して開かないでください**"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"41-ローカル-api-ポートの転送","__idx":14},"children":["4.1 ローカル API ポートの転送"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"nohup socat TCP-LISTEN:40001,fork,reuseaddr,bind=0.0.0.0 TCP:127.0.0.1:40000 &\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["外部マシンは ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http://<server-ip>:40001"]}," で API にアクセスできるようになりました。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"42-フォワード-cdp-デバッグ-ポート","__idx":15},"children":["4.2 フォワード CDP デバッグ ポート"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["API 経由でブラウザ プロファイルを開始すると、応答には ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["動的"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debugPort"]}," (例: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["9222"]},") が含まれます。各プロファイルは異なるポートを受信する場合があります。外部自動化ツール (Playwright、Puppeteer、Selenium) が接続できるように、これを転送します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Example: if debugPort=9222, forward to external port 9223 (debugPort + 1)\n# Adjust both ports to match the actual debugPort returned by /api/env/start\nnohup socat TCP-LISTEN:9223,fork,reuseaddr,bind=0.0.0.0 TCP:127.0.0.1:9222 &\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!WARNING]"," ","複数のプロファイルを同時に実行する場合は、転送されたポートが他のプロファイルのデバッグ ポートと衝突しないようにしてください。たとえば、プロファイル A が ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debugPort=9222"]}," を取得し、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["9223"]}," に転送するが、プロファイル B が ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debugPort=9223"]}," を受信する場合、ポートの競合が発生します。より大きなオフセットまたは専用ポート範囲の使用を検討してください。"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!TIP]"," ","運用環境では、返された ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debugPort"]}," を使用して、各 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/env/start"]}," 呼び出しの後に socat 転送を ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["動的"]}," に作成します。動作する実装については、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#52-create--start--automate--cleanup"},"children":["Python の例"]}," を参照してください。"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["同じサーバー上"]},"で自動化スクリプトを実行している場合は、socat をスキップして ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["127.0.0.1"]}," に直接接続できます。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"43-ファイアウォールポートを開く","__idx":16},"children":["4.3 ファイアウォールポートを開く"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["socat を使用する場合は、アクセスを信頼できる IP のみに制限します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Allow only a specific IP (recommended)\nsudo ufw allow from <YOUR_IP> to any port 40001 proto tcp\nsudo ufw allow from <YOUR_IP> to any port 9223 proto tcp\n\n# Or allow from any IP (NOT recommended for production)\n# sudo ufw allow 40001/tcp\n# sudo ufw allow 9223/tcp\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"44-推奨-代わりに-ssh-トンネルを使用する","__idx":17},"children":["4.4 推奨: 代わりに SSH トンネルを使用する"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["最も安全なリモート アクセスを実現するには、SSH トンネルを使用します。ファイアウォールの変更や socat は必要ありません。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["CDP ポートは ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["動的"]}," (プロファイルの開始時に割り当てられる) であるため、ワークフローは次のようになります。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["最初に API ポートをトンネルします:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Run this on your local machine\nssh -L 40000:127.0.0.1:40000 user@<server-ip>\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["トンネル API (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http://127.0.0.1:40000/api/env/start"]},") 経由でプロファイルを開始"]},"し、返された ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debugPort"]}," を読み取ります。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["CDP ポートの 2 番目のトンネルを開きます:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# Replace <debugPort> with the actual port returned by the API\nssh -L <debugPort>:127.0.0.1:<debugPort> user@<server-ip>\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["サーバーがローカルにあるかのように、ローカルの Playwright / Puppeteer スクリプトから ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http://127.0.0.1:<debugPort>"]}," に ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["接続"]},"します。"]}]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!TIP]"," ","ポート範囲が事前にわかっている場合は、1 つのコマンドで両方のトンネルを組み合わせることができます。例:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"ssh -L 40000:127.0.0.1:40000 -L 9222:127.0.0.1:9222 -L 9223:127.0.0.1:9223 user@<サーバー IP>\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ただし、実際には、最初に API トンネルを開始し、次に必要に応じてプロファイルごとのトンネルを追加する方が簡単です。"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ステップ-5--簡単な自動化の例","__idx":18},"children":["ステップ 5 — 簡単な自動化の例"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下は、ブラウザー プロファイルのライフサイクル全体を示す最小限の Python の例です。同時実行性とエラー処理を備えた完全な本番環境対応スクリプトについては、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/MoreLoginBrowser/MoreLogin-API-Demos/blob/main/MoreLogin-Python/linux_server_test.py"},"children":["GitHub の完全な例"]}," を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"51-python-の依存関係のインストール","__idx":19},"children":["5.1 Python の依存関係のインストール"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"pip install requests playwright\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Playwright は、ここでは CDP クライアント (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["connect_over_cdp"]},") にのみ使用されます。 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["playwright install"]}," を実行する必要は",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ありません"]},"。MoreLogin は独自のブラウザを提供します。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"52-作成--開始--自動化--クリーンアップ","__idx":20},"children":["5.2 作成 → 開始 → 自動化 → クリーンアップ"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["この例では、スクリプトが MoreLogin と ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["同じサーバー"]},"上で実行されることを前提としています。リモート シナリオについては、コードの後のメモを参照してください。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import requests\nfrom playwright.sync_api import sync_playwright\n\n# ── Configuration ──────────────────────────────────────────\n# Local:  script runs on the SAME server as MoreLogin\n# Remote: script runs on a DIFFERENT machine — see notes below\nAPI_BASE  = \"http://127.0.0.1:40000\"\n\n\n# ① Create a browser profile\nresp = requests.post(f\"{API_BASE}/api/env/create/quick\", json={\n    \"browserTypeId\": 1,\n    \"operatorSystemId\": 1,\n    \"quantity\": 1\n})\nresp_data = resp.json()\nassert resp_data[\"code\"] == 0, f\"Create failed: {resp_data}\"\nenv_id = resp_data[\"data\"][\"envIds\"][0]\nprint(f\"✅ Created profile: {env_id}\")\n\n\n# ② Start the profile (headless)\nresp = requests.post(f\"{API_BASE}/api/env/start\", json={\n    \"envId\": env_id\n})\nresp_data = resp.json()\nassert resp_data[\"code\"] == 0, f\"Start failed: {resp_data}\"\ndebug_port = resp_data[\"data\"][\"debugPort\"]   # Dynamic — different for each profile\nprint(f\"✅ Started — debug port: {debug_port}\")\n\n\n# ③ Build the CDP URL\ncdp_url = f\"http://127.0.0.1:{debug_port}\"\n\n\n# ④ Connect via CDP and automate\nwith sync_playwright() as p:\n    browser = p.chromium.connect_over_cdp(cdp_url)\n    page = browser.contexts[0].pages[0]\n    page.goto(\"https://www.google.com\")\n    page.screenshot(path=f\"screenshot_{env_id}.png\")\n    print(f\"✅ Screenshot saved\")\n    # Use disconnect() — not close() — to detach without killing the browser.\n    # The profile will be stopped cleanly via the API in step ⑤.\n    browser.disconnect()\n\n\n# ⑤ Stop the profile\nrequests.post(f\"{API_BASE}/api/env/close\", json={\"envId\": env_id})\nprint(f\"✅ Profile stopped\")\n\n\n# ⑥ Delete the profile\nrequests.post(f\"{API_BASE}/api/env/remove\", json={\"envIds\": [env_id]})\nprint(f\"✅ Profile deleted\")\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!NOTE]"," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["リモート マシンから実行しますか?"]}," 2 つのアプローチ:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["オプション A — SSH トンネル (推奨):"]}," ","ローカル マシンからサーバーへの SSH トンネルを設定し (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#44-recommended-use-ssh-tunnel-instead"},"children":["§ 4.4"]}," を参照)、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_BASE = \"http://127.0.0.1:40000\""]}," と ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cdp_url = f\"http://127.0.0.1:{debug_port}\""]}," を維持します。SSH によりリモート ポートがローカルに見えるようになります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["オプション B — サーバー上の socat:"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["サーバー"]},"で、API ポートと各 CDP ポートの socat 転送を開始します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# これらをローカルマシンではなくサーバーで実行します\nsocat TCP-LISTEN:40001,fork,reuseaddr,bind=0.0.0.0 TCP:127.0.0.1:40000 &\nsocat TCP-LISTEN:$((debug_port+1)),fork,reuseaddr,bind=0.0.0.0 TCP:127.0.0.1:$debug_port &\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["次に、スクリプトで ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_BASE = \"http://<server-ip>:40001\""]}," と ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cdp_url = f\"http://<server-ip>:{debug_port + 1}\""]}," を設定します。"," ","⚠️ ファイアウォール ルールを使用してアクセスを制限します。",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#43-open-firewall-ports"},"children":["§ 4.3"]}," を参照してください。"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!IMPORTANT]"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["resp.json()[\"data\"][\"envIds\"]"]}," 構造は、現在の ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/env/create/quick"]}," 応答形式と一致します。異なる形式 (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data: [\"id1\", ...]"]}," など) が発生した場合は、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/api-reference/browser"},"children":["API リファレンス"]}," でお使いのバージョンを確認してください。応答形式はリリースによって異なる場合があります。"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"パフォーマンスベンチマーク","__idx":21},"children":["パフォーマンスベンチマーク"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["次の結果は、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/MoreLoginBrowser/MoreLogin-API-Demos/blob/main/MoreLogin-Python/linux_server_test.py"},"children":["フル ストレス テスト スクリプト"]}," を使用して Ubuntu 24.04 サーバー VM (8 vCPU、8 GB RAM) で得られたものです。"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"メトリック"},"children":["メトリック"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"値"},"children":["値"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["合計実行数"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["同時実行性"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["4（同時）"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["成功率"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100.0%"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["合計時間"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["604.06秒"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["タスクあたりの平均時間"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["6.04秒"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["スループット"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["0.17タスク/秒"]}]}]}]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["これらの数値はベースラインとして機能します。実際のパフォーマンスは、サーバーの仕様、ネットワークの状態、ページの複雑さによって異なります。"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"本番展開-systemd","__idx":22},"children":["本番展開 (systemd)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["運用サーバーの場合は、MoreLogin を ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["systemd サービス"]}," として実行して、ブート時の自動起動、クラッシュ時の再起動、および集中ログを取得します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"サービスファイルの作成","__idx":23},"children":["サービスファイルの作成"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo tee /etc/systemd/system/morelogin.service > /dev/null <<'EOF'\n[Unit]\nDescription=MoreLogin Browser (headless)\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nUser=root\nWorkingDirectory=/opt/morelogin\nExecStart=/usr/bin/xvfb-run -a /opt/morelogin/MoreLogin_x86_64_2.54.0.AppImage --no-sandbox\nRestart=on-failure\nRestartSec=10\nStandardOutput=journal\nStandardError=journal\n\n[Install]\nWantedBy=multi-user.target\nEOF\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["AppImage を配置した場所と一致するように ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WorkingDirectory"]}," パスと ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ExecStart"]}," パスを調整します。"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!TIP]"," ","運用環境では、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["root"]}," として実行する代わりに専用ユーザー (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["morelogin"]}," など) を作成し、それに応じてファイルの所有権と権限を調整することを検討してください。現在 AppImage に root 権限が必要な場合は、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["User=root"]}," をそのまま使用できますが、非 root アカウントでプロセスを分離することがベスト プラクティスです。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"有効にして開始","__idx":24},"children":["有効にして開始"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo systemctl daemon-reload\nsudo systemctl enable morelogin    # Auto-start on boot\nsudo systemctl start morelogin     # Start now\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"サービスを管理する","__idx":25},"children":["サービスを管理する"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo systemctl status morelogin    # Check status\nsudo journalctl -u morelogin -f    # Stream logs\nsudo systemctl restart morelogin   # Restart\nsudo systemctl stop morelogin      # Stop\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[!NOTE]"," ","再起動後、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#32-log-in-via-curl"},"children":["ログイン エンドポイント"]}," を再度呼び出す必要があります。API セッションはプロセスの再起動後に存続しません。自動リカバリの場合は、サービスの開始後にログイン エンドポイントを呼び出す ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ExecStartPost"]}," スクリプトまたはヘルスチェック cron ジョブを追加することを検討してください。"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"トラブルシューティング","__idx":26},"children":["トラブルシューティング"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"morelogin-の開始に失敗する","__idx":27},"children":["MoreLogin の開始に失敗する"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"AppImages require FUSE to run.\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["修正:"]}," FUSE サポートをインストールします:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo apt install -y libfuse2t64\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ブラウザページに空白のテキスト文字が欠けていることが表示される","__idx":28},"children":["ブラウザページに空白のテキスト/文字が欠けていることが表示される"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["修正:"]}," ターゲット言語のフォント パッケージをインストールします (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#install-fonts-optional"},"children":["ステップ 1 - フォントのインストール"]}," を参照)。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"外部マシンから-cdp-接続が拒否されました","__idx":29},"children":["外部マシンから CDP 接続が拒否されました"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["原因:"]}," CDP デバッグ ポートはデフォルトで ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["127.0.0.1"]}," にバインドされます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["修正:"]}," socat 転送を設定し (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-4--configure-network-forwarding-socat"},"children":["ステップ 4"]}," を参照)、ファイアウォール ルールで転送ポートが許可されていることを確認します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ローカル-api-への-curl-は接続が拒否されましたを返します","__idx":30},"children":["ローカル API への ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["curl"]}," は「接続が拒否されました」を返します"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["原因:"]}," MoreLogin の開始がまだ完了していないか、プロセスがクラッシュしました。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["修正:"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["起動後 5 ～ 10 秒待ちます"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["morelogin.log"]}," にエラーがないか確認してください"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["プロセスが実行されていることを確認します: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ps aux | grep MoreLogin"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"api-は-401ログインステータスの有効期限が切れましたを返します","__idx":31},"children":["API は 401「ログインステータスの有効期限が切れました」を返します"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\"status\": \"error\", \"code\": 401, \"message\": \"Your login status has expired, please log in again\"}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["原因:"]}," API 経由でログインしていないか、MoreLogin プロセスが再起動されました。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["修正:"]}," 他の API 呼び出しの前にログイン エンドポイントを呼び出します (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-3--log-in-to-morelogin-via-api-required"},"children":["ステップ 3"]}," を参照)。"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"次のステップ","__idx":32},"children":["次のステップ"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"目標"},"children":["目標"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"リンク"},"children":["リンク"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["フルブラウザ API リファレンス"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/api-reference/browser"},"children":["ブラウザ API"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["認証設定"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/api-reference/getting-started/authentication"},"children":["認証ガイド"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["劇作家 / Selenium / 人形遣いの例"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/api-reference/examples"},"children":["自動化の例"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["完全な Linux ストレス テスト スクリプト"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/MoreLoginBrowser/MoreLogin-API-Demos/blob/main/MoreLogin-Python/linux_server_test.py"},"children":["GitHub — linux_server_test.py"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["CLI クイック スタート"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/cli/quick-start"},"children":["CLI ガイド"]}]}]}]}]}]}]},"headings":[{"value":"Linuxサーバーの導入","id":"linuxサーバーの導入","depth":1},{"value":"達成できること","id":"達成できること","depth":2},{"value":"アーキテクチャの概要","id":"アーキテクチャの概要","depth":2},{"value":"前提条件","id":"前提条件","depth":2},{"value":"ステップ 1 — システムの依存関係をインストールする","id":"ステップ-1--システムの依存関係をインストールする","depth":2},{"value":"フォントのインストール (オプション)","id":"フォントのインストール-オプション","depth":3},{"value":"ステップ 2 — MoreLogin をダウンロードして起動する","id":"ステップ-2--morelogin-をダウンロードして起動する","depth":2},{"value":"2.1 AppImageをダウンロードする","id":"21-appimageをダウンロードする","depth":3},{"value":"2.2 バックグラウンドでさらにログインを開始する","id":"22-バックグラウンドでさらにログインを開始する","depth":3},{"value":"ステップ 3 — API 経由で MoreLogin にログインする (必須)","id":"ステップ-3--api-経由で-morelogin-にログインする-必須","depth":2},{"value":"3.1 API 認証情報を取得する","id":"31-api-認証情報を取得する","depth":3},{"value":"3.2curl経由でログインする","id":"32curl経由でログインする","depth":3},{"value":"3.3 ログインの確認","id":"33-ログインの確認","depth":3},{"value":"ステップ 4 — ネットワーク転送の構成 (socat)","id":"ステップ-4--ネットワーク転送の構成-socat","depth":2},{"value":"4.1 ローカル API ポートの転送","id":"41-ローカル-api-ポートの転送","depth":3},{"value":"4.2 フォワード CDP デバッグ ポート","id":"42-フォワード-cdp-デバッグ-ポート","depth":3},{"value":"4.3 ファイアウォールポートを開く","id":"43-ファイアウォールポートを開く","depth":3},{"value":"4.4 推奨: 代わりに SSH トンネルを使用する","id":"44-推奨-代わりに-ssh-トンネルを使用する","depth":3},{"value":"ステップ 5 — 簡単な自動化の例","id":"ステップ-5--簡単な自動化の例","depth":2},{"value":"5.1 Python の依存関係のインストール","id":"51-python-の依存関係のインストール","depth":3},{"value":"5.2 作成 → 開始 → 自動化 → クリーンアップ","id":"52-作成--開始--自動化--クリーンアップ","depth":3},{"value":"パフォーマンスベンチマーク","id":"パフォーマンスベンチマーク","depth":2},{"value":"本番展開 (systemd)","id":"本番展開-systemd","depth":2},{"value":"サービスファイルの作成","id":"サービスファイルの作成","depth":3},{"value":"有効にして開始","id":"有効にして開始","depth":3},{"value":"サービスを管理する","id":"サービスを管理する","depth":3},{"value":"トラブルシューティング","id":"トラブルシューティング","depth":2},{"value":"MoreLogin の開始に失敗する","id":"morelogin-の開始に失敗する","depth":3},{"value":"ブラウザページに空白のテキスト/文字が欠けていることが表示される","id":"ブラウザページに空白のテキスト文字が欠けていることが表示される","depth":3},{"value":"外部マシンから CDP 接続が拒否されました","id":"外部マシンから-cdp-接続が拒否されました","depth":3},{"value":"ローカル API への curl は「接続が拒否されました」を返します","id":"ローカル-api-への-curl-は接続が拒否されましたを返します","depth":3},{"value":"API は 401「ログインステータスの有効期限が切れました」を返します","id":"api-は-401ログインステータスの有効期限が切れましたを返します","depth":3},{"value":"次のステップ","id":"次のステップ","depth":2}],"frontmatter":{"seo":{"title":"Linuxサーバーの導入"}},"lastModified":"2026-06-10T11:47:34.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/linux-server/overview","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}