เข้าถึงมาโตโมะ
- เปิดเว็บเบราว์เซอร์ของคุณและไปที่:
http://<SERVER-IP> - ทำตามวิซาร์ดการตั้งค่าเว็บ Matomo เพื่อทำการติดตั้งให้เสร็จสมบูรณ์
ไฟล์และไดเรกทอรีที่สำคัญ
- รูทเว็บ:
/var/www/matomo(เป็นเจ้าของโดยwww-data:www-data) - การกำหนดค่าอาปาเช่:
/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:
systemctl status apache2
systemctl restart apache2
systemctl stop apache2
systemctl start apache2
เปิดใช้งาน SSL กับโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
2. แก้ไขการกำหนดค่า Apache และแทนที่ ServerName <IP> กับโดเมนของคุณ (ServerName <your-domain>):
vim /etc/apache2/sites-available/matomo.conf
3. ติดตั้ง Certbot:
apt install -y certbot python3-certbot-apache
4. รันคำสั่งต่อไปนี้เพื่อสร้างใบรับรอง Lets 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. เปิด browser และไปที่: https://yourdomain.com