How to build and install Apache from source inside ezjail?

Chris Kelley mail at
Fri Apr 18 04:22:23 UTC 2014


On Apr 17, 2014, at 8:15 PM, edflecko . <edflecko at> wrote:

> configure, build and install it from
> source; not from a port.
I understand you’re trying to install from source; installing a port *is* installing from source, just that the leg-work of finding dependencies and fixing build errors is done for you.

> 1.) What the best way to install Apache from source within a jail created
> with ezjail and
Direct answer: by using the ports tree from your jail console.

As Tyler mentioned:
>> ezjail-admin install -P
to install ports tree into jail, then ezjail-admin console <yourjail> will get you a shell in the jail where you can proceed to download and compile within the jail via cd /usr/ports/www/apache<version> && make install clean

Alternatively, you can (usually, depending on configure) install the “raw", non port source to the jail from the host system by running something like ./configure --prefix=/path/to/jail/usr/local, however this may not work as expected if install creates users/does other stuff on the host rather than within the jail.

> 2.) In what directory should it be installed within the jail so it's
> secured by the jail?
Anywhere inside the jail filesystem, again probably /path/to/your/jail/usr/local

If you really want the latest version, an unstable/nightly build, or something else not available from the ports tree, then download the source from the vendor, put it in /usr/ports/distfiles (or in the case of ezjail, wherever it stores distfiles which I believe by default is /var/ports/distfiles in the jail filesystem), and hack together a Makefile that will recognize the version/location/etc of the distfile you downloaded so you can take the hard work of installing it properly and not reinvent the wheel.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4203 bytes
Desc: not available
URL: <>

More information about the freebsd-questions mailing list