Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I am looking at setting up a shell script in order to properly document and automate the process I am using to setup a few servers we have. In order to test the shell script through its different stages I was thinking a CHROOT would be ideal, since I can wipe out the "virtual root" and create it on the fly. I have never used CHROOT before, however.

I was just curious what are the exact steps I would need to follow to implement this process of creating a chroot (with the basic core functions that would be needed to install apache/php/etc.)? and then destroying it?

share|improve this question
up vote 2 down vote accepted

The biggest problem is building a working environment under your chroot (all the dependencies and stuff).

I think searching online for Linux jail creation should help you get on track.

Tools like Jail Chroot Project or Jailkit should facilitate this process.

share|improve this answer

You may find a virtual server is better. You can checkpoint the state, then restore it at the end of your test. This environment would probably be a better proxy for a real server. KVM is easy to setup and build with.

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.