The point is that while phones are able to do what you suggest, they're not fit for purpose. A phone shouldn't be used as a long-term server because it turns into a fire hazard as the battery degrades. And you can't just remove the battery because most phones won't even power on without a battery (even when plugged in).
At that point, you're better off going with some N100 mini-PC or such. But that's not a phone.