Access Matomo
- 打开浏览器,访问:
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. 打开浏览器,访问: https://yourdomain.com