Access Matomo
- ブラウザを開き、以下の URL にアクセスしてください:
http://<SERVER-IP> - Matomo のWebセットアップウィザードに従ってインストールを完了してください。
主要なファイルとディレクトリ
- Web Root:
/var/www/matomo(owned bywww-data:www-data) - Apache Configuration:
/etc/apache2/sites-available/matomo.conf - Logs:
/var/log/apache2/matomo_error.log&/var/log/apache2/matomo_access.log - Database Credentials:
/root/.cloudzy-creds
Database Setup
セットアップ中に、生成されたファイル(/root/.cloudzy-creds):
- Database Server:
127.0.0.1 - Login:
matomo - パスワード:ランダム生成
- Database Name:
matomo
Apache Management
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. Install 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 setting under [General] のIPアドレスをドメイン名に変更します:
[General]
trusted_hosts[] = "yourdomain.com"
7. ブラウザを開いて、次のURLにアクセスしてください: https://yourdomain.com