Enable the following mode:
a2enmod userdir
Edit the following file replacing the public_html by Sites:
nano /etc/apache2/mods-enabled/userdir.conf
In the following file:
nano /etc/apache2/mods-available/php8.4.conf
Comment the section:
<IfModule mod_userdir.c><Directory /home/*/public_html>php_admin_flag engine Off</Directory></IfModule>
Then give the following permissions to the folders:
chmod 711 /home/user_namechmod 755 /home/user_name/Sites