The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ftpserver has failed but it works

Discussion in 'General Discussion' started by vexx, May 1, 2012.

  1. vexx

    vexx Registered

    Joined:
    May 1, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Ok so I changed the default port of my pure-ftp server from 21 to xx. Edited both /etc/pureftpd.conf and /etc/chkserv.d/ftpd with that port. Trying to log onto the FTP with that port, works perfectly, for any account I register from WHM. However, I keep getting emails on my admin email that the ftpserver failed. I tried to restart the FTP server from WHM and I keep getting the same error:

    I don't understand why is this happening since the FTP server actually works. What have I done wrong?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Chkservd is not designed to consider a non-standard port when monitoring the FTP service. You would need to disable monitoring for FTP to keep it from restarting at every service check. Feel free to open a feature request that would allow Chkservd to monitor FTP on alternate ports:

    Submit A Feature Request

    Thank you.
     
  3. sardelich

    sardelich Well-Known Member

    Joined:
    Apr 28, 2010
    Messages:
    72
    Likes Received:
    1
    Trophy Points:
    8
    so other than disabling service check there is no way to change port and have it monitored?
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    It is possible to have it monitored. It isn't possible to have the default ftpd process monitored on the new port, but you can make it into ftpdnew and have that monitored. The reason you cannot do this is that anytime you restart chkservd, it will overwrite port changes you make to /etc/chkserv.d/ftpd file.

    Now first, before we get into that, please note that you cannot revise /etc/pure-ftpd.conf file directly. Anytime you make changes in WHM > FTP Server Configuration area, it'll wipe the changes you made. You'd need to instead add the following line to /var/cpanel/conf/pureftpd/main file:

    Code:
    Bind: 0.0.0.0,Port#
    Replace Port# with the port you've used such as 41. This is how we determine what you'll be placing into the pure-ftpd.conf file. The 0.0.0.0 represents all IPs.

    After that, try resaving WHM > FTP Server Configuration area to see that it sticks. If it does, then next follow these steps to monitor ftpdnew rather than ftpd (and you can uncheck ftpd at that point for monitoring):

    Code:
    cd /etc/chkserv.d/
    cp ftpd ftpdnew
    In ftpdnew file, replace the first ftpd with ftpdnew and replace port 21 with the new port number. Replace %service_auth_user% and %service_auth_pass% with a cPanel user and password, since the typical service password authentication checks in /var/cpanel/serviceauth won't work any longer. It would look something like the following:

    Code:
    service[ftpdnew]=41,QUIT,220,/usr/local/cpanel/scripts/restartsrv_ftpserver,proftpd||pure-ftpd&&pure-authd,root|nobody,220|USER username|3|PASS password|2|QUIT
    Where 41 is the new example port, username is the cPanel username, and password is the cPanel password. Create a dummy test FTP account if needed for this username and password combination.

    Next, edit /etc/chkserv.d/chkservd.conf file to add ftpdnew:1 to it (to indicate it should be monitored).

    Finally, create a file at /var/run/chkservd/ called ftpdnew:

    Code:
    echo "+" > /var/run/chkservd/ftpdnew
    After that, go to WHM > Service Manager and uncheck ftpd and ensure ftpdnew is checked for enabled and monitor.

    This does work for me. It might be a lot of steps, but you'd still at least have some form of monitoring happening.

    Thanks!
     
Loading...

Share This Page