** Linux VMのインストールガイド**

Linux VMへの展開

このガイドは、Ubuntu 18.04 LTS / 20.04 LTS / 20.10にChatWootをインストールするのに役立ちます。実行するための展開スクリプトを準備しました。スクリプトを参照して、Unubuntu以外のシステムを使用している場合は、OSにそれに応じて変更を行います。 Ubuntu 18.04には、次のスクリプトを使用してください

    https://raw.githubusercontent.com/chatwoot/chatwoot/develop/deployment/setup_18.04.sh 

ubuntu 20.04またはubuntu 20.10の場合、次のスクリプトを使用します。

    https://raw.githubusercontent.com/chatwoot/chatwoot/develop/deployment/setup_20.04.sh

インストールする手順

setup.shファイルを作成し、上記のリンクからコンテンツをコピーするか、次のコマンドを使用します

     wget  -O setup.sh
    chmod 755 setup.sh
    ./setup.sh master 

スクリプトを実行すると、最初のChatWootセットアップが処理されます。 ChatWootのインストールは、http:// {your \ _ip \ _address}でアクセスできるようになりました。

nginxを構成し、暗号化しましょう

フロントエンドプロキシとして機能するようにnginxを構成します。

    cd /etc/nginx/sites-enabled
    nano yourdomain.com.conf  

Server \ _NameでYourDomain.comを置き換えた後、次のnginx構成を使用します。

    server {
      server_name ;
    
      # Point upstream to Chatwoot App Server
      set $upstream 127.0.0.1:3000;
    
      # Nginx strips out underscore in headers by default
      # Chatwoot relies on underscore in headers for API
      # Make sure that the config is turned on.
      underscores_in_headers on;
      location /.well-known {
        alias /var/www/ssl-proof/chatwoot/.well-known;
      }
    
      location / {
        proxy_pass_header Authorization;
        proxy_pass http://$upstream;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Ssl on; # Optional
    
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    
        proxy_http_version 1.1;
        proxy_set_header Connection “”;
        proxy_buffering off;
    
        client_max_body_size 0;
        proxy_read_timeout 36000s;
        proxy_redirect off;
      }
      listen 80;
    }  

次のコマンドを実行して、nginx構成を検証してリロードします。

     nginx -t
    systemctl reload nginx 

SSL証明書を暗号化して構成します。

     mkdir -p /var/www/ssl-proof/chatwoot/.well-known
    certbot --webroot -w /var/www/ssl-proof/chatwoot/ -d yourdomain.com -i nginx 

ChatWootのインストールには、https://yourdomain.comからアクセスできるようになりました。

必要な環境変数を構成します

ChatWootインストールを適切に機能させるには、FrontEnd \ _URL、Mailer、Cloud Storage Configなどの重要な環境変数の一部を構成する必要があります。完全なリストについては、環境変数を参照してください。 ChatWootとしてログインし、.envファイルを編集します。

    # Login as chatwoot user
    
    sudo -i -u chatwoot
    cd chatwoot
    nano .env  

必要な環境変数を更新し、ChatWootサーバーを再起動し、自己ホストのChatWootを使用して楽しんでください

     systemctl restart chatwoot.target
 日本