You can track as many websites as you like that are hosted on the same server as Matomo (Piwik), or hosted on several external servers. Only the server that hosts Matomo needs to run PHP and MySQL.
- You have a website built in Java hosted on server1
- You have a website built in Python hosted on server2
- You can install Matomo on server3, and track visits from the two other websites
Note about https: Matomo automatically detect if the page being tracked is https (SSL) and would include the piwik.js in secure mode from your Matomo server.