1

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?

Joshua Enfield
  • 3,454
  • 8
  • 42
  • 59

2 Answers2

2

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.

Karol J. Piczak
  • 2,358
  • 1
  • 20
  • 22
1

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.

BillThor
  • 27,737
  • 3
  • 37
  • 69