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?
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:
sudo firewall-cmd --list-all
Ensure ports 21 (FTP), 20 (FTP data), and the PASV port range (if configured) are open. Example:
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:
getenforce
If it's enabled, try setting it to permissive mode temporarily:
sudo setenforce 0
Then, test the FTP connection again.
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.