4

After Installing my apache, i edited the /etc/apache2/apache2.conf file, and added in the bottom-line, the following code:

<VirtualHost *:80>
 DocumentRoot /media/username/DATA/docs/pathtowebsite/website
 ServerName localhost
</VirtualHost>

The DocumentRoot points to a external NTFS partition!

But after adding the lines, and restarting the apache2 service i get the following when ticking localhost in the Firefox adres-bar:

Error

Forbidden

You don't have permission to access / on this server.


Apache/2.4.6 (Ubuntu) Server at localhost Port 80

I tried fiddling with the fstab per this answer, but same error, after restart.

I then installed ntfs-config, checked the enable write support for internal device box, but same error after restart?

and ntfs-config, also edits the fstab file, so am not sure what to remove and what to keep?

#Entry for /dev/sda5 :
UUID=3490454b-b5b0-4296-ae98-51ab08eecabc   /   ext4    errors=remount-ro   0   1
#Entry for /dev/sda1 :
UUID=506C44946C44772E   /media/SYSTEM   ntfs-3g defaults,locale=nl_NL.UTF-8 0   0
#Entry for /dev/sda3 :
UUID=01CCC676F2E07A60   /media/blade/DATA   ntfs-3g defaults,nosuid,nodev,locale=nl_NL.UTF-8    0   0
#Entry for /dev/sda2 :
UUID=9A3E8BF63E8BC9A9   /media/sda2 ntfs-3g defaults,locale=nl_NL.UTF-8 0   0
/dev/sda6   none    swap    sw  0   0

#UUID=01CCC676F2E07A60  /mnt/DATA   ntfs-3g defaults,nosuid,nodev,locale=nl_NL.UTF-8    0   0
#UUID=01CCC676F2E07A60  /mnt/DATA   ntfs-3g auto,users,permissions  0   0

I gksu nautilus to my external ntfs partition and tried to edit the permisions from my website folder, but, the group keeps jumping back to root. Also doesn't work via command-line.

Question: How can i edit my permissions on a NTFS drive, so that the www-data user can read my index file?

Note: Running Ubuntu 13.10

blade19899
  • 26,704
  • Can you confirm if this is a simple permission issue by sudo su <whatever-account-your-apache-runs-as> (probably www-data) and then try to cd into /media/blade/DATA and see if you can open files. – Oli Oct 22 '13 at 11:10
  • @Oli, am currently at the office, but, when am home I'll give it a go. so, to be continued... – blade19899 Oct 22 '13 at 11:13
  • @Oli when i do sudo su www-data, i cant cd in to my external partition. I can cdto / but not /media/blade. when i cd in to my website folder, and then do sudo su www-data i can rm a test.html? soo this seems like a configuration issue? any idea where to conf this? – blade19899 Oct 22 '13 at 17:30
  • If you're using it mainly for just apache, just mount it with fuse as the apache-www user. I use nginx, so I'll be of little help on the details. – RobotHumans Feb 02 '14 at 18:44

1 Answers1

1

Since this is Ubuntu 13.10, Apache 2.4 is installed which means that this can be the problem - I had the same problem yesterday and changed the permissions of every directory up to DocumentRoot which did not help and then found the linked to post.

In the <directory> section (which you might have to add) just change Allow from all to Require all granted.

chesedo
  • 1,709
  • 14
  • 25
  • 1
    They already are at Require all granted. Am thinking that this is an ntfs issue. Any ideas? – blade19899 Oct 23 '13 at 19:24
  • 1
    I tried an experiment of mounting a ntfs with your parameters and www-data was also not able to cd to it. I then changed the mount point to /mnt/Data and was able to cd to it. After a bit more sniffing I came to the following conclusion, /media/username permission's for others is none, and by running sudo chmod o+rX /media/username to change it to Access enables www-data to cd to it - and possible the ability to access the data. – chesedo Oct 24 '13 at 05:59
  • 2
    sudo chmod o+rX /media/username did the trick for me – Junaid Qadir Shekhanzai Apr 04 '14 at 06:27