# Running Apache/Mysql inside chroot??

## TheLexx

Subject: running Apache/Mysql inside chroot?? 

I am experimenting around with Apache server.  I plan on getting a Linnode server in the future, but until then I have a separate HD partition on one of my computers. The server partition does not have X Windows on it. With the shorter dependency tree (no X), it seems It should be easier/faster to update packages. In the current configuration, I can either boot into the server partition or just chroot the partition.

I am now wondering if I can chroot a shell window and simply start Apache and Mysql without having to reboot the computer. I suppose I could setup a virtual machine, but I thought it might be easier to use chroot. I understand that services generally use tcp/ip to connect and both the chroot-ed and non-chroot-ed services will use the same IP.  I will have to inform the chroot-ed shell not to start services that are all ready running.

Am I crazy, because it would be simpler to run a virtual machine. Or, are the just a few simple changes I can do to make chroot work?

----------

## eccerr0r

If it's protection you seek, chroot is not much security.  VM is one way to solve it.

As a quick check, yes you can run it in a chroot like that.  However the init system on that chroot will get confused as things may already running on your machine.

----------

## TheLexx

 *eccerr0r wrote:*   

> If it's protection you seek, chroot is not much security.  VM is one way to solve it.

 

No not really. I am not looking for security on the machine that I am testing out the machine that I am using to test out Apache on. This computer is not constantly connected to the Net. When I run I setup Linode (a virtual private server) I will update Gentoo regularly.  What I am looking for is a local simulation of a remote server to act as a testbed.

I seem to have cut-out the part of my message before I posted where I talked about attempting to run openrc inside a chroot. I suppose my question should be, "What is the best way to start Mysql and Apache without using a init system?".

So for the closeted approximation of running on Linode, I can boot into the server partition and startup using openrc. But If I want to do a quick test I can simply chroot into server partition.

----------

