I am running an Apache 2 web-server with MySQL and PHPMyAdmin but the 21, 22, and 80 ports act up all the time. The 21 and 22 ports stop working at about the same time but the port 80 works for a lot longer until it needs to be rebooted. But once on a blue moon, all of the ports will work for at least 1 hour until the 21 and 22 ports stop working. Oh and it is also connected to the internet via USB WiFi dongle. If you need anymore information I will be available.
Edits: I am running Raspbian Jessie Lite. I am using PuTTY and WinSCP to connect. I do not have an Ethernet cable to connect to the internet. My router is not port forwarded to 21 or 22.
I noticed a pattern in the errors. At first it tries to search for the Pi and fails. Next, it finds the Pi and gets refused. Lastly, it isn't refused and it starts working. It is not always like this but most of the time it is. It can stop working for days then suddenly work.
/var/log/syslog
show anything at the times FTP (21) and SSH (22) stop working? Do you have a keyboard and monitor that you can use to see what the system is doing when the problem happens?