Matomo 접근
- 웹 브라우저를 열고 아래 주소로 이동하세요:
http://<SERVER-IP> - Matomo 웹 설정 마법사를 따라 설치를 완료하세요.
주요 파일 및 디렉터리
- 웹 루트:
/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. 브라우저를 열고 다음 주소로 접속하세요: https://yourdomain.com