limit bandwidth and space usage of each Virtual Host?

Solution 1:

I have used mod_bandwidth to restrict bandwidth. It can be used per directory, per file, etc... so, you just have to configure it per VirtualHost.

For the Disk Space, just use the quota. Create a unix account per customer, and assign them the quota. That should be quite well documented in the web.

Solution 2:

Some quick Googling shows me that you could use a Squid proxy to set queues for data called 'data pools'. You can apparently also use IPROUTE2 and TC (can't post link, I'm not awesome enough)

From http://www.faqs.org/docs/Linux-HOWTO/Bandwidth-Limiting-HOWTO.html#AEN65

Apart from normal caching, Squid has a special feature called delay pools. Thanks to delay pools, it is possible to limit internet traffic in a reasonable way, depending on so-called 'magic words', existing in any given URL. For example, a magic word could be '.mp3', '.exe' or '.avi', etc. Any distinct part of a URL (such as .avi) can be defined as a magic word.

Also see an article on serverwatch.com titled Reining-in-Bandwidth-With-Squid-Proxying

Squid is probably the simplest way, and you can do a lot of other cool things with it, too.