<p>Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default Apache? I'd like to keep our development server running fully chrooted just like our Production server so that we make sure our code runs just fine chrooted.</p>

[{'answer_id': 24990, 'author': 'Henrik Gustafsson', 'author_id': 2010, 'author_profile': 'https://Stackoverflow.com/users/2010', 'pm_score': 1, 'selected': False, 'text': '<p>Having never used xinc myself, I can only hint as to how I usually get to chrooting apps.</p>\n\n<p>First step would be to gather information on everything the app needs to run; this I usually accomplish by running <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=systrace&amp;sektion=1" rel="nofollow noreferrer">systrace(1)</a> and <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ldd&amp;sektion=1" rel="nofollow noreferrer">ldd(1)</a> to find out what is needed to run the software.</p>\n\n<p>Go through the output of</p>\n\n<pre><code>systrace -A -d. &lt;app&gt;\nldd &lt;app&gt;\n</code></pre>\n\n<p>and make sure that everything the app touches and needs (quite a lot of apps touch stuff it doesn\'t actually need) is available in the chroot environment. You might need to tweak configs and environment variables a bit. Also, if there is an option to have the app log to syslog, I usually do that and create a syslog socket (see the -a option of <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=syslogd&amp;sektion=8" rel="nofollow noreferrer">syslogd(8)</a>) in order to decrease the places the app needs write access to.</p>\n\n<p>What I just described is a generic way to make just about any program run in a chroot environment (however, if you need to import half the userland and some suid commands, you might want to just not do chroot :). For apps running under Apache (I\'m sure you\'re aware that the OpenBSD <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=httpd&amp;sektion=8" rel="nofollow noreferrer">httpd(8)</a> is slightly different) you have the option (once the program has started; any dynamic libraries still needs to be present in the jail) of using apache to access the files, allowing  the use of <a href="http://httpd.apache.org/docs/1.3/configuring.html" rel="nofollow noreferrer">httpd.conf</a> to import resources in the chroot environment without actually copying them.</p>\n\n<p>Also useful (if slightly outdated) is <a href="http://www.phpbuilder.com/manual/en/install.unix.openbsd.php" rel="nofollow noreferrer">this</a> link, outlining some gotchas in chrooted PHP on OpenBSD.</p>\n'}, {'answer_id': 25111, 'author': 'dragonmantank', 'author_id': 204, 'author_profile': 'https://Stackoverflow.com/users/204', 'pm_score': 1, 'selected': False, 'text': "<blockquote>\n  <p>First step would be to gather information on everything the app needs to run; this I usually accomplish by running systrace(1) and ldd(1) to find out what is needed to run the software.</p>\n</blockquote>\n\n<p>I'll give this a try. The big issue I've found with xinc is that while it is a PHP application, it wants to know application installation paths (yet it still spreads stuff into other folders) and runs some PHP scripts in daemon mode (those scripts being the hardest to get running). So, for example, I told it to install to /var/www/xinc and then made a symlink of</p>\n\n<p>/var/www/var/www/xinc -> /var/www/xinc</p>\n\n<p>and it partially worked. I got the GUI to come up bit it refused to recognize any projects that I had set up. I think the biggest problem is that part of it is running a chroot and the other half is running outside. </p>\n\n<p>If all else fails I'm going to just have to build something as we program inside chrooted environments since our production is chrooted. We've run into issues where we code outside of a chroot and then have to back track to find what we need to make it work inside a chroot.</p>\n"}, {'answer_id': 36964, 'author': 'Till', 'author_id': 2859, 'author_profile': 'https://Stackoverflow.com/users/2859', 'pm_score': 2, 'selected': False, 'text': '<p>@dragonmantank</p>\n\n<p>In Xinc\'s case, I hope you used PEAR to install it.</p>\n\n<pre><code>pear list-files xinc/Xinc\n</code></pre>\n\n<p>This should do it, and show you where your Xinc install put its files. So even though Xinc is "just" one big PHP script, it\'s still spread out into rc scripts and all those other things which are necessary to make an application run. I\'m sure you don\'t need to add all paths listed there, but probably some in order to make it run.</p>\n\n<p>Aside from Xinc itself, I think it also needs phpUnit and a bunch of other PEAR libs to run, so what I\'d propose is this:</p>\n\n<pre><code>pear config-get php_dir\n</code></pre>\n\n<p>And then you need to add that path (like Henrik suggested) to the chroot environment.</p>\n'}, {'answer_id': 113793, 'author': 'dcousineau', 'author_id': 20265, 'author_profile': 'https://Stackoverflow.com/users/20265', 'pm_score': 3, 'selected': True, 'text': '<p>Have you posted the issue on the Xinc <a href="http://code.google.com/p/xinc/issues/list" rel="nofollow noreferrer">bug tracker</a>? Xinc itself should run fine as it runs both as a daemon and as a web app. As you alluded to, the issue may be that the daemon is not running in a chroot\'ed environment where as the web interface is, leading to either side not grabbing the files.</p>\n'}]
['https://Stackoverflow.com/questions/9455', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/204/']