I have apache2 setup and serving files successfully from locations such as:
/var/www/example.com
where ownership and permissions were set like this:
sudo chown -R $USER:$USER /var/www/example.com
sudo chmod -R 755 /var/www
resulting permissions look like:
drwxr-xr-x 6 tim tim 4096 Aug 23 23:22 example.com/
drwxr-xr-x 5 tim tim 4096 Aug 24 14:45 www/
and apache2.conf includes:
ServerName 127.0.0.1
and hosts includes
127.0.0.1 localhost
sudo service apache2 restart
a browser successfully loads:
localhost/example.com
the above is all good but...
I get 403s when I attempt to setup files to be served from an ntfs partition with:
sudo gedit /etc/fstab
/dev/sda3 /media/tim/Data ntfs-3g permissions,locale=en_GB.utf8 0 2
sudo umount /media/tim/Data
sudo mount -a
and use the same chown and chmod method above:
sudo chown -R $USER:$USER /media/tim/Data/www/example.com
sudo chmod -R 755 /media/tim/Data/www
with a symbolic link such as:
/var/www/ $ ln -s /media/tim/Data/www/example.com
The symbolic link works with these permissions:
lrwxrwxrwx 1 tim tim 36 Aug 24 14:45 example.com -> /media/tim/Data/www/example.com
and the permissions for the folders look like this:
drwxr-xr-x 1 tim tim 8192 Aug 24 15:16 /media/tim/Data/www/example.com
drwxr-xr-x 1 tim tim 0 Aug 23 23:24 /media/tim/Data/www/
i have also tried
setting up virtualhost successfully on the local ext4 file system, but again got 403s if the virtualhost pointed to /media/tim/Data/www/example.com
or the symbolic link /var/www/example.com
I've seen others apparently solve the issue with the fstab method, and as far as I can tell my permissions are also set correctly this way, but still fails.
Answers appreciated.