S
S
Sergey Semenko2015-03-07 12:09:26
Apache HTTP Server
Sergey Semenko, 2015-03-07 12:09:26

How to set permissions on a folder to be accessed from Apache?

Installed Apache2, everything is fine, but you need to change the /var/www shared folder to /mnt/sdcard0/htdocs
Edited the /etc/apache2/apache2.conf config: replaced /var/www with the desired folder, but, oddly enough, I get an error about folder permissions, how do I change them?
UPD#1
Tried like this but get error
$sudo chown -R www-data:www-data /mnt/sdcard0/htdocs
Error: chown: changing ownership of 'htdocs': Operation not permitted

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valery Ryaboshapko, 2015-03-08
@abler98

Judging by the error message, it was not possible to change the rights to the folder.
Considering that sdcard is indicated in the folder path, this is a memory card and it is formatted in FAT. FAT does not support access rights, so the OS considers (usually) that the card and all files on it belong to the superuser, the access rights are set to the mask 022 (755 for folders and 644 for files).
You either need to change the mount options for the memory card (it seems that this is indicated somewhere in fstab, I don’t remember anymore), or reformat the card to ext[234] or any other file system that your kernel supports and that supports file permissions.

V
Vyacheslav Barsukov, 2015-03-07
@slavabars

Look under whom the Apache works. And put it on.
In general, look at the rights to var/www and set the same

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question