[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 417
  • Last Modified:

How do I jail apache on Debian with multiple vhosts

I am setting up a server farm to run 70 vhost sites on a Debian distribution. I would like to jail apache instances and assign different vhosts to a specific apache pool which in turn is jailed to use specific amount of resources.

I would like to separate the 70 vhosts into 5 different apache pools. Each pool would be jailed. I do not want to run each vhost in its own jail however. Is it even possible and if so any hint on how to go about it?
0
akorkishko
Asked:
akorkishko
  • 5
  • 3
1 Solution
 
arnoldCommented:
i'm not really clear what you are looking for.

There are modules if you are looking to limit resources, bandwity amount of data transfer for some sites, etc.
0
 
gheistCommented:
itk mpm allows that.
Why would you isolate sites that have plain static files?
0
 
akorkishkoAuthor Commented:
I am trying to isolate each site resource wise. So if one site has a problem and has a memory leak, I didn't want other sites to be affected by it.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
gheistCommented:
Apache never uses more than 20MB of RAM per process. What modules you have so it became a problem?
0
 
akorkishkoAuthor Commented:
On the older server we were hosting around 40 websites via VirtualHost, once one of the sites "hangs" it spikes CPU to 100% and completely takes out the server, causing other sites to break as well. I think a solution we will go with is to run multiple apache start scripts and assign them to different conf files and listen on different ports. Then if one site fails, we will only bring down part of the websites and not the whole server.
0
 
gheistCommented:
Are you using PHP? I see no chance apache alone uses such lots of CPU.
Apache uses multiple processes, so there is no change of having multiple instances - one that dies as you say (There is nice vulnerability for that in old apaches) will kill the rest no matter pools or whatever.
0
 
akorkishkoAuthor Commented:
Sorry, yes PHP/mysql. We are doing a lot of joomla and wordpress, those were usually the source of the problem in the past
0
 
gheistCommented:
I already suspected.
I suggest you run mod_fcgi and php-cgi and enable PHP on sites where it is needed.
It will make pool of PHP processes per site and you easily see eaten up memory per site with PHP (and punish and advise guilty)
Ahh yes, that involves switching to worker MPM...  100 connections=12MB apache process + as many PHP backends as needed.
Study documentation carefully.
I can help with recipe if you get stuck somewhere.
0
 
gheistCommented:
A light site can run with 2 PHP backend processes this way, so the first heavy script does not kill "other users" of same site. I have god's forgotten sites that probably are visited now and then by bored search spiders, thay run with one php-cgi process just fine...
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now