Broken FTP subfolder permissions

Discussion in 'General' started by PetrCZE, Jul 28, 2020.

  1. PetrCZE

    PetrCZE New Member

    Hello,
    if i want punt some files with ftp to /web everything is ok, but when I want put some files into for example /web/wp-content/plugins... FTP gives me error "permissions denied" until I change permissions by SSH, changing permissions by FTP doesnt work.

    Can I automatize this process? What should I do?

    Thanks
     
  2. nhybgtvfr

    nhybgtvfr Active Member

    what user/group owners did it have, and what folder permissions did it have before you changed anything.
    what user/group owners and file permissions does a file you upload to /web without having to change any settings have?
    how did you install wordpress?
    easiest way is to ssh to the server as root then:
    Code:
    cd  /var/www/domain.tld/web
    wget http://wordpress.org/latest.tar.gz
    tar -xf latest.tar.gz
    chown -R <webid>:<groupid> wordpress
    cd wordpress
    mv wp-config-sample.php wp-config.php
    mv * ../.
    cd ..
    rmdir wordpress
    
    then edit wp-config.php with the correct database details. (should create and add unique wordpress salts to the file as well, but i notice even most web designers don't bother doing this. lazy buggers... )
    the last 3 lines of code is assuming you want wordpress directly in the root of the web folder.
     
    Last edited: Jul 29, 2020
  3. PetrCZE

    PetrCZE New Member

    I am giving FTP to my client and he installs it... Its hard to change permissions to every web with ssh.
     
  4. Jesse Norell

    Jesse Norell Well-Known Member

    What PHP mode are you using? Don't use mod_php, most probably php-fpm, and ensure suexec is enabled for the site, then fix ownership/permissions (eg. as root) and see if they stay fixed.
     
  5. PetrCZE

    PetrCZE New Member

    I am using Fast-CGI, so you recommend me to use php-fm?
     
  6. Jesse Norell

    Jesse Norell Well-Known Member

    I would, as it should perform better, but that's not your problem. Check the suexec setting.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Probably suexec checkbox is not enabled as @Jesse Norell suggested already, if suexec is not enabled, then PHP runs as wrong user which will give you such permission errors. Take care to always enable suexec and use php mode php-fpm or php fastcgi mode.
     

Share This Page