Score:0

Granting permission to /var/www/html

in flag

I've installed WordPress but am struggling to correctly configure permission to the WordPress directory. When attempting to install plugins or update WordPress, I'm getting this message:

To perform the requested action, WordPress needs to access your web server.

This is the permission set (recursively) on the WordPress directory:

steve@binky:~ $ ls -al /var/www/html/
total 20
drwxrws--- 3 steve www-data 4096 Oct 30 12:13 .
drwxr-s--- 3 steve www-data 4096 Oct 26 23:55 ..
-rwxr-x--- 1 steve www-data  766 Oct 27 00:07 index.php
-rw-r--r-- 1 steve www-data   19 Oct 30 12:13 test.php
drwxr-s--- 5 steve www-data 4096 Oct 27 19:14 wordpress

This is the output from ps aux | grep www-data

steve@binky:~ $ ps aux | grep www-data
www-data   842  0.0  3.8 195832 36424 ?        S    11:59   0:03 /usr/sbin/apache2 -k start
www-data   843  0.0  3.7 195944 35508 ?        S    11:59   0:01 /usr/sbin/apache2 -k start
www-data   844  0.0  3.7 195956 35344 ?        S    11:59   0:02 /usr/sbin/apache2 -k start
www-data   845  0.0  3.9 195964 37556 ?        S    11:59   0:02 /usr/sbin/apache2 -k start
www-data   846  0.0  3.9 195948 37096 ?        S    11:59   0:02 /usr/sbin/apache2 -k start
www-data  1023  0.0  3.9 195844 37440 ?        S    12:03   0:04 /usr/sbin/apache2 -k start
www-data  1078  0.0  3.7 195944 35548 ?        S    12:07   0:02 /usr/sbin/apache2 -k start
steve     3329  0.0  0.0   7480   540 pts/0    S+   14:53   0:00 grep --color=auto www-data

If I make www-data the owner of /wordpress I can install updates, but then I lose the ability to access the WordPress directory with my FTP application. This prompted me to add my account to the www-data group:

steve@binky:~ $ grep 'www-data' /etc/group
www-data:x:33:steve

I assume I've missed some crucial step but can't figure it out for myself. Is anyone able to help please?

in flag
If you’re using VSFTP, [this is generally how I resolve the issue](https://stackoverflow.com/questions/67696484/setting-up-vsftpd-user-to-have-write-access-to-apache2s-html-directory/67697945#67697945).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.