Skip to content

Sådan installeres Matomo Web Analytics på Ubuntu 22.04

Cloud Infrastructure Expert
Sådan installeres Matomo Web Analytics på Ubuntu 22.04

 

 

I denne vejledning vil vi gennemgå, hvordan du kan installere Matomo, en open-source webanalyseplatform, på en Ubuntu 22.04-server. Denne installation kan være særligt nyttig for brugere af en VPS-server.

Forudsætninger

  • Ubuntu 22.04 installeret på din server.
  • Root-adgang eller sudo-rettigheder.
  • En aktiv internetforbindelse.
  • Apache, MySQL og PHP installeret.

Trin 1: Opdater systemet

Først skal du opdatere dit system for at sikre, at alle pakker er opdaterede:

sudo apt update && sudo apt upgrade -y

Trin 2: Installer nødvendige afhængigheder

Installer de nødvendige PHP-pakker og udvidelser:

sudo apt install apache2 mysql-server php php-mysql libapache2-mod-php php-xml php-mbstring php-json php-curl php-zip -y

Trin 3: Download Matomo

Klon Matomo-repositoriet fra den officielle hjemmeside:

wget https://builds.matomo.org/matomo-latest.zip

Trin 4: Udpak Matomo

Udpak den downloadede zip-fil:

unzip matomo-latest.zip -d /var/www/html/

Trin 5: Indstil tilladelser

Sørg for, at Apache har de rette tilladelser til Matomo-mappen:

sudo chown -R www-data:www-data /var/www/html/matomo
sudo chmod -R 755 /var/www/html/matomo

Trin 6: Opret database til Matomo

Log ind på MySQL og opret en database til Matomo:

sudo mysql -u root -p
CREATE DATABASE matomo;
CREATE USER 'matomo_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON matomo.* TO 'matomo_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Trin 7: Konfigurer Apache til Matomo

Opret en ny Apache-konfigurationsfil for Matomo:

sudo nano /etc/apache2/sites-available/matomo.conf

Tilføj følgende indhold til konfigurationsfilen:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/matomo
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        <Directory /var/www/html/matomo>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
</VirtualHost>

Trin 8: Aktivér konfigurationen og genstart Apache

Aktiver den nye konfiguration og genstart Apache:

sudo a2ensite matomo.conf
sudo systemctl restart apache2

Trin 9: Fuldfør installationen via webgrænsefladen

Naviger til følgende URL i din webbrowser for at fuldføre installationen:

http://your-server-ip/matomo

Afslutning

Dine Matomo-webanalyseværktøjer er nu installeret og klar til brug. Denne løsning kan være særligt nyttig for dem, der ønsker at overvåge deres webtrafik effektivt fra en VPS-server.

Windows VPS Deutschland

Windows VPS España

Windows VPS Nederland

Windows VPS Italia

Windows VPS Portugal

VPS Windows Italia

Windows VPS

Windows VPS

Windows VPS Sverige

Windows VPS Norge

Windows VPS

Windows VPS Türkiye

Windows RDS (Remote Desktop Services)

Windows VPS

Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.