Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Running a linux server. We want to give many users access to test/play around with php and apache and do things with it. I want to know what the best method would be to:

  1. Prevent users making infinite loops that can crash the server due to ram/cpu usage

  2. Prevent access to subdirectories from php

  3. Same effect with apache

The issue is that I am looking for a plugin (or anything) to do this on a user level rather than a process level (I've seen a bunch of php.ini/.htaccess solutions but they seem to focus on processes rather than uses (like the php's max_execution_time).

Anyone know of any addong/plugins/or other ways to detect and limit the potential for damage done by users on a linux server?

share|improve this question

migrated from Aug 11 '11 at 16:43

This question came from our site for professional and enthusiast programmers.

You will probably get better responses on serverfault, I'm voting to move this over there. – manyxcxi Aug 11 '11 at 16:39
Thanks just found out about that site. About to x-post there. – NoviceCoding Aug 11 '11 at 16:41
@NoviceCoding Don't cross post! I'll migrate this for you – Tim Post Aug 11 '11 at 16:43
Cool thank you! – NoviceCoding Aug 11 '11 at 16:45

The best way to do this is to run absolutely everything that the user can control as the user, then put strict limits on what the user can do. This means you run all code with suexec or suPHP, and use ulimits to keep the number of open files, subprocesses, memory used, and so on to a reasonable level. Add proper permissions management to keep prying eyes out of places they shouldn't be, disk quotas for avoiding disk full problems, a good monitoring setup to detect when things are going bad so you can investigate, and a strong ToS that allows you to happy-slap anyone who does something malicious, and you'll have a reasonably straightforward time of it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.