I activated the FTP server for the “default" vhost in the NS Gui and logged in successfully using a FTP client, in the /var/www/html folder as expected.
There is a problem however : the FTP user cannot create a folder. I guess that’s a permission problem, but is this expected ?
Wed Jun 5 09:41:18 2019 [pid 18645] [default] OK LOGIN: Client "xxx" │
Wed Jun 5 09:41:29 2019 [pid 18647] [default] FAIL MKDIR: Client "xxx", "/test" │
Yes. Permissions to parent directory are not changed for security reasons (and respect upstream defaults).
You should change the permissions manually or change the directory owner.
Txs @Giacomo. It looked a bit to obvious to be a bug
Any pointer to help me do that correctly ? I’m new to web hosting and I don’t want to do something stupid.
Maybe I should create a vhost (It works with vhosts) ? But how to make it handle the www.domain.tld and the domain.tld adresses ? Or forget about FTP ? Wordpress seems to depend on it (locally) to install modules.
I ended up by trial and error to set /var/www/html and all subfolders to 775 and changed the owner of all files and folders to root:ftp. Files rights are set to 644. Now it seems to be working as expected.
I’m really not sure of the security issues it could create. Could anybody advice me ?
WordPress takes care of downloading files and doesn’t need FTP from the system.
Also, if the html folder (or vhost folder) has ftp:apache as owner:group, you will be able to update extensions but not WordPress itself. User other doesn’t need any right at all.
chown apache:apache /var/www/html
cd /var/www/html
#### for vhosts:
#### cd /var/lib/nethserver/vhost/
find . -type f -exec chmod 2640 {} \;
find . -type d -exec chmod 2750 {} \;
chown -R apache:apache *
chown -R apache:apache .*
If WordPress complains about not finding wp-content, add these lines at the end of wp-config.php: