I'm running Ubuntu 18.10 over Windows 10 using Virtualbox 5.2.22
Let me explain what I'm trying to achieve. In Windows, I have two developing environments. I'm developing using a WAMP server. I use Dropbox to sync my two development environments. Here's how: I have a directory d:\Dropbox\_www
then I have both of my Apaches configured exactly the same way. In development, I use SQLite, so I have no problems with the database. I've been working this way over a year with no problems.
My only problem is that I use my home computer as one of the environments, and it has been filled up with games, other programs and such, so I thought it could be a good idea to replicate my environment over a clean VM using Linux.
I made d:\dropbox\_www
a shared folder, and it mounts on /media/sf__www
I have full access to it, I can use VS Code to edit files and such.
Now I configured the LAMP server, Apache 2, PHP and mySQL are working perfectly, I did a small page at /var/www/test
and everything is Okay
My problem is I can't configure Apache's virtual server to point to /media/sf__www
. This is what I did:
In /etc/hosts I added:
laravel.com.devel 127.0.0.1
I created a laravel.conf
in /etc/apache2/sites-available
with the following:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /media/sf__www/lara/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName laravel.com.devel
</VirtualHost>
In the apache2.conf
I have the following:
<Directory "/media/sf__www/lara/">
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Then I activated the site and restarted Apache:
sudo a2ensite laravel.conf
service apache2 reload
Now, when I go to the browser all I get is a 403:
Forbidden
You don't have permission to access / on this server.
Apache/2.4.34 (Ubuntu) Server at laravel.com.devel Port 80
Thinking that it might be related to permissions in the filesystem (I'm pretty novice in Ubuntu) I did a sudo chmod 777 lara -R
to change all the permissions in the directory, but still it gives me the 403.
So, any idea on how do I have to configure Apache in order to work with a directory outside /var/www/
?
EDIT:
Partial output from ll /media/sf__www/lara
is:
drwxrwx--- 1 root vboxsf 4096 oct 23 17:51 ./
drwxrwx--- 1 root vboxsf 4096 dic 8 09:58 ../
drwxrwx--- 1 root vboxsf 4096 oct 26 21:05 app/
-rwxrwx--- 1 root vboxsf 1686 oct 22 18:44 artisan*
drwxrwx--- 1 root vboxsf 0 oct 21 12:08 bootstrap/
-rwxrwx--- 1 root vboxsf 1477 oct 22 18:44 composer.json*
-rwxrwx--- 1 root vboxsf 144373 oct 22 18:48 composer.lock*
Looks like you can't chmod/chown this directory
EDIT: Output of groups
luisferfranco@luisfer-vb:/media/sf__www/lara$ groups
luisferfranco adm cdrom sudo dip plugdev lpadmin sambashare vboxsf
EDIT: Output of setfacl on the directory:
luisferfranco@luisfer-vb:/media/sf__www/lara$ sudo setfacl -d -R -m u:$USER:rwx,g:www-data:rwx,o:rx /media/sf__www/lara
[sudo] contraseña para luisferfranco:
setfacl: /media/sf__www/lara: La operación no está soportada
setfacl: /media/sf__www/lara/app: La operación no está soportada
setfacl: /media/sf__www/lara/app/Console: La operación no está soportada
setfacl: /media/sf__www/lara/app/Exceptions: La operación no está soportada
It says "operation not supported" for each file. I'm reading in other site, this might be related to the partitions
EDIT: [SOLVED]
I want to thank George Udosen (https://askubuntu.com/users/459561/george-udosen user:459561), he was in the chat for over an hour, helping me to solve this issue. He tried lots of different things until it worked. Basically what nailed the problem was adding one user to the vboxsf group as shown:
sudo adduser www-data vboxsf
Thank you very much, you took too much time from your Christmas Day to help a complete stranger, you're a great person.
ll /media/sf__www/lara/
??drwxrwx--- 1 root vboxsf 4096 oct 23 17:51 ./
drwxrwx--- 1 root vboxsf 4096 dic 8 09:58 ../
drwxrwx--- 1 root vboxsf 4096 oct 26 21:05 app/
-rwxrwx--- 1 root vboxsf 1686 oct 22 18:44 artisan*
drwxrwx--- 1 root vboxsf 0 oct 21 12:08 bootstrap/
Looks like you can't change ownership or permission flags on this directory, maybe because is mounted in /media/? I can write into it, tho.www-data
group on the directoryd:\dropbox\_www
??cat /etc/passwd | grep www-data
!