This solution doesn't Allow from all
I just want to change my public directory www, and access it from my PC, and mobile connected by Wifi. I've Ubuntu 16.04.
So, first, I modified /etc/apache2/sites-enabled/000-default.conf
and I changed the line DocumentRoot /var/www/html
for my new public directory
DocumentRoot "/media/data/XAMPP/htdocs"
Then I modified /etc/apache2/apache2.conf, and I put the permissions for localhost, and my mobile, this time I used the IP address, I know it is not completely safe, but it's OK for my purposes.
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from localhost 10.42.0.11