Discover Centmin Mod today
Register Now

whmcs folder permission

Discussion in 'System Administration' started by amin, Oct 29, 2015.

  1. amin

    amin Member

    38
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    6:34 PM
    Katest
    Latest
    I installed WHMCS with centminmod and to make it secure tried to move 3 directories our of the public folder but faced folder permission problems.
    Now I moved them back but it is writeable by whmcs and also went to the public folder in shell and issued chown -R nginx:nginx , no success.
    Any idea?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    1:04 AM
    Nginx 1.13.x
    MariaDB 5.5
    error messages ?

    what's directory structure like for /home/nginx/domains/yourdomain.com/public ?

    Code:
    ls -Alh /home/nginx/domains/yourdomain.com/public
     
  3. amin

    amin Member

    38
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    6:34 PM
    Katest
    Latest
    Here it is:

    Code:
    total 812K
    -rw-r-----  1 nginx nginx 1.6K Oct 27 14:36 403.html
    -rw-r-----  1 nginx nginx 1.6K Oct 27 14:36 404.html
    -rw-r-----  1 nginx nginx 2.1K Oct 27 14:36 500.html
    -rw-r-----  1 nginx nginx 2.1K Oct 27 14:36 502.html
    -rw-r-----  1 nginx nginx 2.2K Oct 27 14:36 503.html
    -rw-r-----  1 nginx nginx 2.1K Oct 27 14:36 504.html
    -rw-r-----  1 nginx nginx 2.2K Oct 27 14:36 50x.html
    -rw-r-----  1 nginx nginx  17K Oct 27 15:24 affiliates.php
    -rw-r-----  1 nginx nginx 1.3K Oct 27 15:24 aff.php
    -rw-r-----  1 nginx nginx  13K Oct 27 15:24 announcements.php
    -rw-r-----  1 nginx nginx 7.2K Oct 27 15:24 announcementsrss.php
    drwxr-s---  6 nginx nginx 4.0K Oct 27 15:24 assets
    drwxr-s---  2 nginx nginx 4.0K Oct 27 15:25 attachments
    -rw-r-----  1 nginx nginx 6.5K Oct 27 15:24 banned.php
    -rw-r-----  1 nginx nginx  99K Oct 27 15:24 cart.php
    -rw-r-----  1 nginx nginx 137K Oct 27 15:24 clientarea.php
    -r--r-----  1 nginx nginx  480 Oct 28 16:33 configuration.php
    -rw-r-----  1 nginx nginx  20K Oct 27 15:24 configuressl.php
    -rw-r-----  1 nginx nginx 9.8K Oct 27 15:24 contact.php
    -rw-r-----  1 nginx nginx  18K Oct 27 15:24 creditcard.php
    drwxr-s---  2 nginx nginx 4.0K Oct 27 15:25 crons
    -rw-r-----  1 nginx nginx 1.5K Oct 27 15:24 dist.loghandler.php
    -rw-r-----  1 nginx nginx  22K Oct 27 15:24 dl.php
    -rw-r-----  1 nginx nginx  12K Oct 27 15:24 dologin.php
    -rw-r-----  1 nginx nginx  23K Oct 27 15:24 domainchecker.php
    drwxrwxrwx  2 nginx nginx 4.0K Oct 28 16:35 downloads
    -rw-r-----  1 nginx nginx  16K Oct 27 15:24 downloads.php
    drwxr-s---  2 nginx nginx 4.0K Oct 27 15:25 feeds
    -rw-r-----  1 nginx nginx  608 Oct 27 15:24 htaccess.txt
    drwxr-s---  5 nginx nginx 4.0K Oct 27 15:25 includes
    -rw-r-----  1 nginx nginx 1.4K Oct 27 14:36 index.html
    -rw-r-----  1 nginx nginx  13K Oct 27 15:24 index.php
    -rw-r-----  1 nginx nginx  15K Oct 27 15:24 init.php
    -rw-r-----  1 nginx nginx  29K Oct 27 15:24 knowledgebase.php
    drwxr-s---  2 nginx nginx 4.0K Oct 27 15:26 lang
    -rw-r-----  1 nginx nginx 5.0K Oct 27 15:24 link.php
    -rw-r-----  1 nginx nginx 6.0K Oct 27 15:24 login.php
    -rw-r-----  1 nginx nginx 6.2K Oct 27 15:24 logout.php
    -rw-r-----  1 nginx nginx 2.2K Oct 27 14:36 maintenance.html
    drwxr-s--- 12 nginx nginx 4.0K Oct 27 15:27 modules
    -rw-r-----  1 nginx nginx  11K Oct 27 15:24 networkissues.php
    -rw-r-----  1 nginx nginx 6.5K Oct 27 15:24 networkissuesrss.php
    drwxr-s---  2 nginx nginx 4.0K Oct 27 15:28 pipe
    -rw-r-----  1 nginx nginx 6.7K Oct 27 15:24 pwreset.php
    -rw-r-----  1 nginx nginx 9.7K Oct 27 15:24 register.php
    drwxr-s---  3 nginx nginx 4.0K Oct 27 15:28 resources
    -rw-r-----  1 nginx nginx 9.7K Oct 27 15:24 serverstatus.php
    drwxr-s---  2 nginx nginx 4.0K Oct 27 15:28 status
    -rw-r-----  1 nginx nginx  18K Oct 27 15:24 submitticket.php
    -rw-r-----  1 nginx nginx  14K Oct 27 15:33 supporttickets.php
    drwxr-s---  5 nginx nginx 4.0K Oct 27 15:28 templates
    drwxr-s---  2 nginx nginx 4.0K Oct 28 16:43 templates_c
    -rw-r-----  1 nginx nginx 7.1K Oct 27 15:33 unsubscribe.php
    -rw-r-----  1 nginx nginx  22K Oct 27 15:24 upgrade.php
    drwxr-s--- 18 nginx nginx 4.0K Oct 27 15:29 vendor
    -rw-r-----  1 nginx nginx 6.1K Oct 27 15:24 viewemail.php
    -rw-r-----  1 nginx nginx  11K Oct 27 15:33 viewinvoice.php
    -rw-r-----  1 nginx nginx  15K Oct 27 15:24 viewquote.php
    -rw-r-----  1 nginx nginx  24K Oct 27 15:24 viewticket.php
    drwxr-s---  3 nginx nginx 4.0K Oct 28 16:26 whmcsfiles
    -rw-r-----  1 nginx nginx 6.3K Oct 27 15:24 whois.php
    drwxr-s---  5 nginx nginx 4.0K Oct 27 15:24 yo
    
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    1:04 AM
    Nginx 1.13.x
    MariaDB 5.5
    Edited your post with CODE tags

    what specific error messages ?
     
  5. amin

    amin Member

    38
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    6:34 PM
    Katest
    Latest
    The downloads folder is not writable by WHMCS so you cannot upload files
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    1:04 AM
    Nginx 1.13.x
    MariaDB 5.5
  7. amin

    amin Member

    38
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    6:34 PM
    Katest
    Latest
    Did not find anything related to permissions.
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    1:04 AM
    Nginx 1.13.x
    MariaDB 5.5
  9. amin

    amin Member

    38
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    6:34 PM
    Katest
    Latest
    I commented out this line:
    fastcgi_param PHP_ADMIN_VALUE open_basedir=$document_root/:/usr/local/lib/php/:/tmp/;

    but the website did not load. So I replaced /usr/local/nginx/conf/php.conf to /usr/local/nginx/conf/php_disable_openbasedir.conf and I had thie error:
    nprestart
    nginx: [emerg] open() "/usr/local/nginx/conf/php_disable_openbasedir.conf" failed (2: No such file or directory) in /usr/local/nginx/conf/conf.d/xxxxxx.com.conf:53
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
    Gracefully shutting down php-fpm . done
    Starting php-fpm done
    You have new mail in /var/spool/mail/root
     
  10. RoldanLT

    RoldanLT Well-Known Member

    3,978
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    11:04 PM
    1.11
    10.2
    Issue nprestart, not just ngxrestart.
     
  11. amin

    amin Member

    38
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    6:34 PM
    Katest
    Latest
    Oops, I added the "#" after some spaces. It is loading now, but did not fix the permission issue. Also in the whmcs I can see this error:

    The following directories are owned by a different user from that which is executing WHMCS. This indicates a potentially insecure configuration:
    • /home/nginx/domains/xxx.com/downloads
    • /home/nginx/domains/xxx.com/attachments
     
    • Informative Informative x 1
  12. RoldanLT

    RoldanLT Well-Known Member

    3,978
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    11:04 PM
    1.11
    10.2
    chown -R nginx:nginx /home/nginx/domains/
     
    • Like Like x 1
  13. amin

    amin Member

    38
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    6:34 PM
    Katest
    Latest
    I moved the 3 folders into a new folder under public dir and its working just fine.
    Still no access to folders out of the "public" dir. This is really weird!

    Thank you
     
    • Like Like x 1
  14. RoldanLT

    RoldanLT Well-Known Member

    3,978
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    11:04 PM
    1.11
    10.2
    • Like Like x 1
  15. eva2000

    eva2000 Administrator Staff Member

    30,945
    6,914
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,411
    Local Time:
    1:04 AM
    Nginx 1.13.x
    MariaDB 5.5
    Glad you guys sorted it out :D