Matomo にアクセス
- ブラウザを開き、以下の URL にアクセスしてください:
http://<SERVER-IP> - Matomo のWebセットアップウィザードに従ってインストールを完了してください。
主要なファイルとディレクトリ
- Webルート
/var/www/matomo(所有者:www-data:www-data) - Apache設定:
/etc/apache2/sites-available/matomo.conf - ログ:
/var/log/apache2/matomo_error.log&/var/log/apache2/matomo_access.log - データベース認証情報:
/root/.cloudzy-creds
データベースセットアップ
セットアップ中に、生成されたファイル(/root/.cloudzy-creds):
- データベースサーバー
127.0.0.1 - ログイン:
matomo - パスワード:ランダム生成
- データベース名:
matomo
Apache管理
systemd コマンドで Apache サービスを管理します:
systemctl status apache2
systemctl restart apache2
systemctl stop apache2
systemctl start apache2
ドメインを使った SSL の有効化
1. ドメインをサーバーのIPアドレスに向けてください。
2. Apache の設定を編集して置き換える ServerName <IP> ドメイン(ServerName <your-domain>):
vim /etc/apache2/sites-available/matomo.conf
3. Certbotをインストールします:
apt install -y certbot python3-certbot-apache
4. 次のコマンドを実行して、有効な Let's Encrypt 証明書を生成します:
certbot --apache --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. Apache を再起動して変更を反映する:
systemctl restart apache2
6. Matomo の設定ファイル(/var/www/matomo/config/config.ini.php) を編集し、 trusted_hosts 設定下 [General] のIPアドレスをドメイン名に変更します:
[General]
trusted_hosts[] = "yourdomain.com"
7. ブラウザを開いて、次のURLにアクセスしてください: https://yourdomain.com