403Webshell
Server IP : 104.129.129.72  /  Your IP : 216.73.216.229
Web Server : LiteSpeed
System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
User : answe8064 ( 1002)
PHP Version : 8.2.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/installer/apps/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/installer/apps/matomo-latest-offisrc
#!/bin/bash

if [ -f "include/startup.sh" ]; then
    . include/startup.sh
elif [ -f "../include/startup.sh" ]; then
    . ../include/startup.sh
fi

checkTagExist php.success
checkTagExist nginx.success
checkTagExist mysqld.success

appPath=/var/www/
rootDir=$(rootDir)

echo "Downloading Matomo" | log
curlDownload https://builds.matomo.org/matomo-latest.zip
waitOrStop 0 "File not downloaded from official source"

echo "Extracting Matomo" | log
installPackage unzip | log
mkdir -p $appPath
unzip matomo-latest.zip -d $appPath
waitOrStop 0 "Failed to extract"

echo "Setting permissions" | log
chown www-data:www-data /var/www/matomo/ -R

echo "Creating Matomo Database" | log
mysql --defaults-file=/root/.my.cnf -h localhost <<EOF
CREATE DATABASE matomo CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'matomouser'@'localhost' identified with mysql_native_password by '${ADMINPASSWORD}';
GRANT all privileges on matomo.* to matomouser@localhost;
FLUSH PRIVILEGES;
EOF

echo "Creating VirtualHost" | log
cp $rootDir/tweaks/extras/matomo/matomo.conf /etc/nginx/conf.d/
sed -i "s/ServerDomain/${CWM_DISPLAYED_ADDRESS}/g" /etc/nginx/conf.d/matomo.conf
sed -i '36d' /etc/php/7.4/fpm/pool.d/www.conf
sed -i '35 a listen = /run/php/php-fpm.sock' /etc/php/7.4/fpm/pool.d/www.conf
unlink /etc/nginx/sites-enabled/default
unlink /etc/nginx/sites-enabled/default-ssl
systemctl restart php7.4-fpm
waitOrStop 0 "Restart php7.4-fpm service failed"
systemctl restart nginx
waitOrStop 0 "Restart nginx service failed"

echo "Adding descriptions" | log
descriptionAppend "Database = matomo | DBUser = matomouser"
descriptionAppend "To finalize the installation visit the Web UI"
descriptionAppend "Matomo Admin Web UI: https://${CWM_DISPLAYED_ADDRESS}"
descriptionAppend " "

tagScript success

exit 0

Youez - 2016 - github.com/yon3zu
LinuXploit