I'm on MacOS host, running a Multipass instance which I'm using as a LAMP server.
Multipass maps ~/Home directory to the MacOS user directory and inside that directory I wanna have the public_html directory so I can develop from MacOS and the changes can be reflected in the Ubuntu LAMP.
Well, I've successfully enabled UserDir by running sudo a2enmod userdir
, commenting out:
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
php_admin_flag engine Off
</Directory>
</IfModule>
from /etc/apatche2/mods-enabled/php8.1.conf
and replacing:
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
with
export APACHE_RUN_USER=ubuntu
export APACHE_RUN_GROUP=ubuntu
in /etc/apache2/envvars
With all of this, I now have a ~/public_html
in which I can put html and php files and it works fine but if I edit /etc/apache2/mods-enabled/userdir.conf
from /home/*/public_html
to /home/*/Home/public_html
it doesn't work! I'm getting the 403.
The permissions for the public_html and a file inside is as follows:
ubuntu@primary:~$ ls -la ~/Home/public_html/
total 12
drwxr-xr-x 1 ubuntu ubuntu 96 Jan 16 18:19 .
drwxr-xr-x 1 ubuntu ubuntu 1792 Jan 16 17:52 ..
-rwxr-xr-x 1 ubuntu ubuntu 17 Jan 16 18:19 test.php
What am I doing wrong? What's the way to achieve the desired result which I explained in the beginning?