Wrong folder and files permission NGINX/ISPConfig

Discussion in 'Server Operation' started by danield, Feb 15, 2017.

  1. danield

    danield New Member

    Hi all!

    Having an issue here with a ISPConfig site (but is not related to ispconfig).
    We have installed Wordpress on the domain, and whenever we install a new plugin or update one (or even when updating Wordpress), wrong file permissions get set on the new files and directories.

    As a result, NGINX cant access the files and shows a 403 Forbidden (log file says "Open() - Permission denied).

    How can we set the correct permission for new files and folders?

    We are using Ubuntu 16.04 with NGINX and PHP7.0-FPM

    After running ...
    find gotmls/ -type d -exec chmod 0755 {} \;^
    find gotmls/ -type f -exec chmod 0644 {} \;^
    ... everything works fine.

    Have also attached a screenshot of the files and their permissions right after they got installed.

    Hope you can help :)
     

    Attached Files:

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The default permissions of your system look strange indeed, at least the group read permissions are missing. Most likely you changed the umask setting somewhere (either in nginx, if there is such a setting) or you changed a global umask variable.
     
  3. danield

    danield New Member

    Last edited: Feb 17, 2017
    till likes this.
  4. rublanc

    rublanc New Member

    Hi,
    I have installed ISPConfig 3, with Ubuntu 16.04. And I have a Wordpress installed already. I try to upload a picture but the following error appears:

    No se pudo crear el directorio wp-content/uploads/2017/05. Aseg├║rate de que el servidor tiene permisos de escritura para el directorio superior.
    (it is in spanish: there are no permissions in the previous dir)

    I have check some permissions and owners:
    root@rbg:/var/www/clients/client1/web1/web# ls -altr /var/www

    total 32

    drwxr-xr-x 2 root root 4096 May 16 17:35 html

    drwxr-xr-x 2 ispapps ispapps 4096 May 16 17:54 apps

    lrwxrwxrwx 1 root root 34 May 16 17:54 ispconfig -> /usr/local/ispconfig/interface/web

    drwxr-xr-x 14 root root 4096 May 17 00:00 ..

    drwxr-xr-x 3 root root 4096 May 17 10:18 clients

    lrwxrwxrwx 1 root root 30 May 17 10:18 rbgcoaching.es -> /var/www/clients/client1/web1/

    drwxr-xr-x 8 root root 4096 May 17 10:18 .

    drwxr-xr-x 2 root root 4096 May 23 06:50 webalizer

    drwxr-xr-x 5 root root 4096 May 23 10:01 php-fcgi-scripts

    drwxr-xr-x 3 root root 4096 May 23 10:05 conf

    And also:

    drwxr-xr-x 6 web1 client1 4096 May 23 08:42 wp-content

    drwxr-xr-x 2 web1 client1 4096 May 23 10:06 stats

    root@rbg:/var/www/clients/client1/web1/web#

    root@rbg:/var/www/clients/client1/web1/web/wp-content# ls -altr

    total 28

    -rw-r--r-- 1 web1 client1 28 May 22 20:37 index.php

    drwxr-xr-x 4 web1 client1 4096 May 22 20:37 languages

    drwxr-xr-x 3 web1 client1 4096 May 22 20:37 plugins

    drwx--x--x 7 web1 client1 4096 May 22 20:57 ..

    drwxr-xr-x 6 web1 client1 4096 May 23 08:42 .

    drwxr-xr-x 11 web1 client1 4096 May 23 08:45 themes

    drwxr-xr-x 2 web1 client1 4096 May 23 08:49 upgrade

    Please, can anyone help me with this problem??

    KR,

    Ruth
     
  5. rublanc

    rublanc New Member

    Hi Till, I have posted below. Can you help me with my error?? Thanks in advance.
    Ruth
     
  6. rublanc

    rublanc New Member

    Hi Till,
    I didn't change any permissions, neither umask. Do you need any additional information?? Thanks!!!
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you use apache or nginx? When using apache, ensure that the php mode is either php-fpm or php-fcgi and that the suexec checkbox in the website settings is enabled.
     
  8. rublanc

    rublanc New Member

    Hi till,

    I have apache installed. I have SuExec and Own error-documents enabled. If I choose php-fpm the website fails.
    Now I have another error... you can see if you access to: http://www.rbgcoaching.es/

    Thanks!!
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    The website loads fine, so I guess you solved it already.
     
  10. rublanc

    rublanc New Member

    Hi till,

    I changed many things I had done, after I deleted the cookes and choose php-fpm. And at this time everything worked!!!! Many thanks till. Without your help I couldn't solve the problem
     

Share This Page