1

I am building a SaaS which allows customers there own space. They get a subdomain but they can also add their own custom domain by setting their CNAME to my server. The subdomains and custom domains are not parked, they just point to my server and then my app checks the URL and displays the correct content.

In this circumstance, how would I monitor bandwidth for each subdomain and domain?

I'm using PHP if that makes any difference.

nhiik
  • 11
  • 1
  • I've tried looking at bandwidth logs but they are no good, they only show stats for parked domains, they don't show stats for domains being CNAME'd to my server. The only the thing I can think of is registering every website hit and estimating how much bandwidth was used based on number of hits * avg page size. Regarding what web server.. I'm new to server stuff. I have WHM and cPanel, if that helps? – nhiik Apr 28 '16 at 11:59
  • The mention of WHM and/or cPanel generally leads to poor acceptance 'round these parts, but I'll disregard that for the moment. It should be possible to log the URL, Host and bytes sent/received for every request. You'd then just need to parse those logs and aggregate based on whatever fields you want to track. Being on cPanel/WHM might make this harder though. – GregL Apr 28 '16 at 12:47
  • I know, I'm a developer but only just beginning with server administration so cpanel is all I know right now, but happy to learn, thats why I'm here. Ok can you point me in the direction of a way to do this with or without cpanel? The server I will be using is using CentOS – nhiik Apr 29 '16 at 03:33

0 Answers0