Author Topic: CWP Server FTP Connection Error  (Read 233 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
CWP Server FTP Connection Error
« on: August 16, 2024, 01:58:20 PM »
Hello,

I have a problem with my CWP7 server. I have been having problems accessing the system via ftp for almost a year. I use the auto-publish feature in my project that I am developing with Phpstorm. Thanks to this feature, the file is uploaded to the server as soon as I save it. The system is fine so far, but for some reason that I cannot understand what is happening on the server, neither the test connection works in the host definitions in Phpstorm nor can I upload the file when I save the file. I checked everything in the firewall settings, but the problem could not be solved. Whenever I log in to the CWP management page, all tests are successful and all files are sent. If anyone has an idea or knows a solution, can they share it?

Offline
*
Re: CWP Server FTP Connection Error
« Reply #1 on: March 03, 2025, 08:17:33 AM »
You mentioned that you’ve checked the firewall, but FTP can still face issues if certain ports aren't open or if IP filtering is blocking connections.

To check firewall settings:
Check firewall rules on the CWP server, particularly if you're using firewalld or iptables. Run:
Code: [Select]
sudo firewall-cmd --list-allEnsure ports 21 (FTP), 20 (FTP data), and the PASV port range (if configured) are open. Example:
Code: [Select]
sudo firewall-cmd --zone=public --add-port=21/tcp --permanent
sudo firewall-cmd --zone=public --add-port=20/tcp --permanent
sudo firewall-cmd --zone=public --add-port=1024-65535/tcp --permanent  # PASV port range
sudo firewall-cmd --reload
SELinux settings: Sometimes, SELinux can block FTP access even if firewall settings are correct. Try checking the SELinux status:
Code: [Select]
getenforceIf it's enabled, try setting it to permissive mode temporarily:
Code: [Select]
sudo setenforce 0Then, test the FTP connection again.

Offline
***
Re: CWP Server FTP Connection Error
« Reply #2 on: March 03, 2025, 08:50:47 AM »
Don't open all ports above 1024 for FTP. Just open the ports used by the FTP daemon:

1. Open the file:
/etc/pure-ftpd/pure-ftpd.conf
2. Find:
'PassivePortRange'
3. Open the ports specified in "PassivePortRange".

CWP uses CSF to manage firewall rules. If you modify the firewall rules manually they can be reset someday. So I recommend you to manage the firewall rules using CSF. The main config file of CWP is:
/etc/csf/csf.conf
Check and update the values of TCP_IN,TCP_OUT,UDP_IN,UDP_OUT to open/close ports.

Actually you need to specify the port range in TCP_IN,TCP_OUT and then restart CSF.