added second wordpress site to ISPConfig but i have trouble with permissions

Discussion in 'General' started by hknerdr, Jan 4, 2025 at 12:57 AM.

  1. hknerdr

    hknerdr New Member

    Hello again,
    I added one more site to the panel but when i connect with SFTP it doesn't allow me to edit, delete or change anything, it says permission denied.
    - I created a new SFTP/SSH user
    - I can't change its base dir from /var/www/clients/client0/web3 to /var/www/clients/client0/web4 it says "The directory has to be inside the web root."
    - I migrated the site from cpanel. Wordpress can't write its folders and files. What should be permissions?

    Thank you
     
  2. Bookworm

    Bookworm Member

    SFTP/FTP/SSH users aren't created on a per-client basis. They're created on a per-site basis.

    /var/www/clients/client0 is the client.

    /var/www/clients/client0/web4 is the site. This is the 'web root'

    So, you'll need a separate FTP/SSH user for each site, just like you'd need a separate database for each site. The reasoning is very simple. Even a 'client' with four web sites might have four different web designer/developers, or at least people that upload stuff - and he doesn't want them to have access to any of the other three.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Create a new FTP/SSH user for the new site. Each site has its own user like @Bookworm mentioned.

    Most likely you did not upload the site with the FTP or SSH user that was created for this site, which causes all files to be owned by the wrong user. To fix that, you must change all files in the web folder of that website to the webID and clientID user of that site.

    Besides that, take care that you have chosen PHP mode PHP-FPM and that the suexec checkbox in the website is enabled (if its an Apache server).
     
    hknerdr likes this.
  4. hknerdr

    hknerdr New Member

    Thanks for the replies.
    I have 2 sites and 1 client. I created FTP, STFP, database etc. for each of them.

    I think as you said, i migrated from cpanel and used the user for the other domain to upload the backup. I changed the users from SSH by chmod etc. to web4. First domain is web3 and the second domain is web4. It doesn't work.

    Also on ISPconfig i can't change the basedir of the FTP or SFTP. It stays web3 when i try to change it to web4 i get this error:

    [​IMG]

    I connect to SFTP with the user i created for the site. But i can't change permissions or upload anything to the web4/web
    By the way, I am using nginx.
     
    Last edited: Jan 4, 2025 at 9:35 AM
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You could post the common issues -report: https://forum.howtoforge.com/threads/please-read-before-posting.58408/
    What are owners, group owners and permissions of the files in the websites? For example, show result of commands
    Code:
    ls -lh  /var/www/clients/client0/web3/
    ls -lh  /var/www/clients/client0/web3/web
    
    ls -lh  /var/www/clients/client0/web4/
    ls -lh  /var/www/clients/client0/web4/web
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You must change the user and group af all files in the web folder of a site to the websites user and group if you uploaded them as root user. If you used a ssh user of the site, no change is needed as everything is correct by default. For web3, the user is web3, for web 4, the user is web4. Do not change web3 to web4 and vice versa. This must fail and makes no sense anyway.

    ISPConfig indeed spotted your mistake in setting a wrong basedir and prevented that. Again read post #3. You must create a separate SSH user for each website. The basedir has never to be changed, it is always correct. What you attempted is accessing the wrong site by changing the basedir.

    To sum this up:

    Do not change the base dir; it is correct already for the site you created the user for. Also, do not change the document root of a site; it is already correct for the website by default. Just create websites and for each website, create a ssh user to access that site. Do not change any docroots or basedirs, there is no need to do that for WordPress.

    Here are step-by-step instructions on how to create a website:

    https://www.howtoforge.com/ispconfig-website/

    The website in that tutorial is 100% compliant with WordPress. So follow it and do not do any extra settings.
     
    Last edited: Jan 4, 2025 at 10:30 AM
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Of course, it does; when you create a user for web3, then this user is for web3 and not web4. If you want to have a user for web4, then select web4 in the website domain field when you create a new user. And as I mentioned, never try to set a website to a different user, this can't work.
     
  8. hknerdr

    hknerdr New Member

    found the problem. I am so sorry, while i was creating a new user, i didn't change the site dropdown. I will try again.
     
    till likes this.

Share This Page