Solved

How do I jail apache on Debian with multiple vhosts

Posted on 2015-01-06
9
329 Views
Last Modified: 2015-01-14
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
Comment
Question by:akorkishko
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 78

Expert Comment

by:arnold
ID: 40534900
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
 
LVL 62

Expert Comment

by:gheist
ID: 40536309
itk mpm allows that.
Why would you isolate sites that have plain static files?
0
 

Author Comment

by:akorkishko
ID: 40549538
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
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
LVL 62

Expert Comment

by:gheist
ID: 40549669
Apache never uses more than 20MB of RAM per process. What modules you have so it became a problem?
0
 

Author Comment

by:akorkishko
ID: 40549710
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
 
LVL 62

Expert Comment

by:gheist
ID: 40549764
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
 

Author Comment

by:akorkishko
ID: 40549770
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
 
LVL 62

Accepted Solution

by:
gheist earned 500 total points
ID: 40549792
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
 
LVL 62

Expert Comment

by:gheist
ID: 40549841
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question