Get the most out of your Centmin Mod LEMP stack
Become a Member

pure-ftpd login problem with .08 beta

Discussion in 'Beta release code' started by Cr0w, Mar 31, 2015.

  1. eva2000

    eva2000 Administrator Staff Member

    47,284
    10,693
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,617
    Local Time:
    7:48 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    I see what you mean by W3 Total Cache's self hosted CDN. Unfortunately using FTP via non TLS/SSL is not secure and isn't recommended so use at your own risk.


    As to error, you'd have to ask W3 Total Cache support too as I am not familiar with self hosted CDN feature they have. Could be related to FTP Path you set
     
  2. Cr0w

    Cr0w Member

    165
    9
    18
    Mar 17, 2015
    Iran
    Ratings:
    +13
    Local Time:
    1:18 PM
    1.9.x
    5.5
    i changed directory to /home/nginx/domains/mashtyha.com
    its works ,
    Test passed
     
  3. eva2000

    eva2000 Administrator Staff Member

    47,284
    10,693
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,617
    Local Time:
    7:48 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    but FTP path says
    doc root would be

    Code:
    /home/nginx/domains/mashtyha.com/public
     
  4. Cr0w

    Cr0w Member

    165
    9
    18
    Mar 17, 2015
    Iran
    Ratings:
    +13
    Local Time:
    1:18 PM
    1.9.x
    5.5
    its working but Uploading ftp files on /home/nginx/domains/mashtyha.com/
    i want to upload here /home/nginx/domains/mashtyha.com/public
     
  5. eva2000

    eva2000 Administrator Staff Member

    47,284
    10,693
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,617
    Local Time:
    7:48 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    as per post 43 that's why i said doc root is public ;)
     
  6. Cr0w

    Cr0w Member

    165
    9
    18
    Mar 17, 2015
    Iran
    Ratings:
    +13
    Local Time:
    1:18 PM
    1.9.x
    5.5
    when i set /home/nginx/domains/mashtyha.com/public
    i have problem
    but when i set /home/nginx/domains/mashtyha.com/ its working
     
  7. Cr0w

    Cr0w Member

    165
    9
    18
    Mar 17, 2015
    Iran
    Ratings:
    +13
    Local Time:
    1:18 PM
    1.9.x
    5.5
    Error: Unable to change directory to: /home/nginx/domains/mashtyha.com/public (ftp_chdir(): Can't change directory to /home/nginx/domains/mashtyha.com/public: No such file or directory).
     
  8. eva2000

    eva2000 Administrator Staff Member

    47,284
    10,693
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,617
    Local Time:
    7:48 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    what problem ? test not passed ?

    permissions output from these 2 commands
    Code:
    ls -lah /home/nginx/domains/
    ls -lah /home/nginx/domains/mashtyha.com/
     
  9. Cr0w

    Cr0w Member

    165
    9
    18
    Mar 17, 2015
    Iran
    Ratings:
    +13
    Local Time:
    1:18 PM
    1.9.x
    5.5
    drwxr-s--- 5 nginx nginx 4.0K Mar 31 17:54 .
    drwx--S--- 4 nginx nginx 4.0K Mar 30 21:38 ..
    drwxr-x--- 6 nginx nginx 4.0K Mar 30 19:56 demodomain.com
    drwxr-s--- 6 nginx nginx 4.0K Mar 31 17:54 img.mashtyha.com
    drwxr-s--- 6 nginx nginx 4.0K Mar 31 20:31 mashtyha.com

    ---------------------
    drwxr-s--- 6 nginx nginx 4.0K Mar 31 20:31 .
    drwxr-s--- 5 nginx nginx 4.0K Mar 31 17:54 ..
    drwxr-s--- 2 nginx nginx 4.0K Mar 30 21:07 backup
    drwxr-s--- 2 nginx nginx 4.0K Mar 30 21:07 log
    drwxr-s--- 2 nginx nginx 4.0K Mar 30 21:07 private
    drwxrwsr-x 5 nginx nginx 4.0K Mar 31 20:31 public

     
  10. eva2000

    eva2000 Administrator Staff Member

    47,284
    10,693
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,617
    Local Time:
    7:48 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    could be when you incorrectly created pure-ftpd virtual user you created 2 users locking one to /home/nginx/domains/mashtyha.com/public and one to /home/nginx/domains/mashtyha.com

    what does output of these 2 commands give

    Code:
    pure-pw list
    Code:
    pure-pw show yourusername
    you might need to delete and re-create that user
    Code:
    pure-pw userdel yourusername
    pure-pw mkdb
    service pure-ftpd restart
    Code:
    pure-pw useradd yourusername -u nginx -g nginx -d /home/nginx/domains/mashtyha.com
    pure-pw mkdb
    service pure-ftpd restart
    
     
  11. Cr0w

    Cr0w Member

    165
    9
    18
    Mar 17, 2015
    Iran
    Ratings:
    +13
    Local Time:
    1:18 PM
    1.9.x
    5.5
    Example ?
    i set
    Code:
    /home/nginx/domains/mashtyha.com/public
    then error

     
  12. eva2000

    eva2000 Administrator Staff Member

    47,284
    10,693
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,617
    Local Time:
    7:48 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    yeah unfortunately, seems right now W3 Total Cache self hosted CDN doesn't support pure-ftp virtual FTP user unfortunately. Only when I have some more free time will I be able to look into this.
     
  13. Cr0w

    Cr0w Member

    165
    9
    18
    Mar 17, 2015
    Iran
    Ratings:
    +13
    Local Time:
    1:18 PM
    1.9.x
    5.5
    Nah , i found the problem . i will give you information but first help me to set up an subdomain at main domain document root

    for example

    /home/nginx/domains/mashtyha.com/public/subdomain

    subdomain.mashtyha.com
     
  14. eva2000

    eva2000 Administrator Staff Member

    47,284
    10,693
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,617
    Local Time:
    7:48 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    can do that manually or easier way via centmin.sh menu option 2 to create a new account = subdomain.yourdomain.com and then in that /usr/local/nginx/conf/conf.d/subdomain.yourdomain.com.conf nginx vhost change root path from /home/nginx/domains/mashtyha.com/public to /home/nginx/domains/mashtyha.com/public/subdomainand restart nginx server

    manual way is to copy your /usr/local/nginx/conf/conf.d/yourdomain.com.conf to a new file at /usr/local/nginx/conf/conf.d/subdomain.yourdomain.com.conf and again change root path from /home/nginx/domains/mashtyha.com/public to /home/nginx/domains/mashtyha.com/public/subdomain and change server_name to subdomain.yourdomain.com and restart nginx server
     
  15. Cr0w

    Cr0w Member

    165
    9
    18
    Mar 17, 2015
    Iran
    Ratings:
    +13
    Local Time:
    1:18 PM
    1.9.x
    5.5
  16. eva2000

    eva2000 Administrator Staff Member

    47,284
    10,693
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,617
    Local Time:
    7:48 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    you got the screenshot for w3 total cache self hosted cdn settings ?

    i might have a work around to keep FTP over TLS/SSL enabled by editing W3 Total Cache code

    W3 Total Cache self hosted CDN doesn't support FTP over TLS mode due to line 69 of w3-total-cache/lib/W3/Cdn/Ftp.php and use of ftp_connect(). So you need to change ftp_connect() to ftp_ssl_connect() (PHP: ftp_ssl_connect - Manual at line 69

    see wp-w3-total-cache/Ftp.php at master · crowdfavorite-mirrors/wp-w3-total-cache · GitHub

    original W3 Total Cache line 69 of w3-total-cache/lib/W3/Cdn/Ftp.php
    Code:
    grep -Rn ftp_connect w3-total-cache/lib/W3/Cdn/Ftp.php
    69:        $this->_ftp = @ftp_connect($this->_config['host'], (int) $this->_config['port'], W3TC_CDN_FTP_CONNECT_TIMEOUT);
    
    change line 69 in w3-total-cache/lib/W3/Cdn/Ftp.php

    from

    Code:
    $this->_ftp = @ftp_connect($this->_config['host'], (int) $this->_config['port'], W3TC_CDN_FTP_CONNECT_TIMEOUT);
    
    to

    Code:
    $this->_ftp = @ftp_ssl_connect($this->_config['host'], (int) $this->_config['port'], W3TC_CDN_FTP_CONNECT_TIMEOUT);
    
     
  17. eva2000

    eva2000 Administrator Staff Member

    47,284
    10,693
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,617
    Local Time:
    7:48 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Ah i see what you mean, you set the following + using my ftp_ssl_connect workaround does work

    misunderstood, FTP hostname above is that of the cdn host you want to ftp into.

    ftp_over_tls_working_00.png
    and create subdomain with root of off public at root /home/nginx/domains/newdomain2.com/public/cdn

    subdomain Nginx vhost /usr/local/nginx/conf/conf.d/cdn.newdomain2.com.conf
    Code:
    server {
    server_name cdn.newdomain2.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
    # limit_conn limit_per_ip 16;
    # ssi on;
    
    access_log /home/nginx/domains/newdomain2.com/log/access.log combined buffer=32k;
    error_log /home/nginx/domains/newdomain2.com/log/error.log;
    
    root /home/nginx/domains/newdomain2.com/public/cdn;
    
    include /usr/local/nginx/conf/wpsupercache_newdomain2.com.conf;
    
    location / {
    # Enables directory listings when index file not found
    #autoindex on;
    
    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php;
    
    }
    
    include /usr/local/nginx/conf/wpsecure_newdomain2.com.conf;
    include /usr/local/nginx/conf/php.conf;
    include /usr/local/nginx/conf/staticfiles.conf;
    include /usr/local/nginx/conf/drop.conf;
    #include /usr/local/nginx/conf/errorpage.conf;
    }
    
     
    Last edited: Apr 1, 2015