How do I allow apache to use a directory in an NTFS partition?

I am running Linux (Lubutu 12.10) on an older machine with a 20 GB hard drive. I have a 1 TB external hard drive with an NTFS partition. This section has a www directory that contains my web content. It is automatically installed at startup as / media / t 515 / NTFS.

I would like to change the apache document directory from / var / www to / media / t515 / NTFS / www.

I need to save the partition as an NTFS partition because I use the same hard drive on another machine with WAMP.

I changed the default file in / etc / apache 2 / sites - available for the new location and restarted the server. When I tried to go to the local host, I got an error:

403 Forbidden You do not have permission to access this server.

Then I changed the automount settings in fstab, including the option "umask = 0000", and then in "umask = 2200", to no avail. I still get the same error message.

I can access the NTFS partition without problems from other applications and at login as any user. But Apache, it seems, cannot (or does not want) access the partition. How to grant apache permission to use a directory in an NTFS partition?

+3
source share
4 answers

After many many attempts, this is what I managed and nothing else: changing the configuration of Apache so that it uses www-data(Apache user) no more, but instead of my own user.

. Apache , , /etc/apache2/envvars ( ):

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data

www-data ( toto:)):

export APACHE_RUN_USER=toto
export APACHE_RUN_GROUP=toto
+5

RW. :

sudo mount -t ntfs -o rw,auto,user,fmask=0022,dmask=0000 /dev/whatever /mnt/whatever

NTFS fstab.

ntfs.

/etc/fstab

gksu gedit /etc/fstab

sudo -e /etc/fstab

UUID blkid

sudo blkid

ntfs

# change the "UUID" to your partition UUID
UUID=12102C02102CEB83 /media/windows ntfs-3g auto,users,permissions 0 0

( )

sudo mkdir/media/windows

mount/media/windows

, , , umount.

chown chmod ntfs.

: https://askubuntu.com/questions/11840/how-to-chmod-on-an-ntfs-or-fat32-partition

+4

, Apache, .

, , :

<Directory "/www/mywebdirectoryinapartitioneddisk">
    Require all granted
</Directory>

, . NTFS

http://www.tbogard.com/2014/09/12/making-apache-server-to-read-a-partitioned-disk-the-definitive-solution/

+1

:

1) Windows

2) Grant the appropriate NTFS permissions to this user

3) Check access (Windows only)

... THEN ...

4) Configure NTFS-mount on Linux to use the same Windows user and group (Linux user / group is not relevant here)

5) Configure Apache to use this Linux group (here you need a Linux user / group)

0
source

All Articles