How do you automatically start Apache, Bind, etc. in a jail?

Glen Barber glen.j.barber at
Thu Jul 22 22:39:33 UTC 2010

Hash: SHA1

On 7/22/10 6:20 PM, Ed Flecko wrote:
> Hi folks,
> I have Apache installed in a "qjail" named "webserver" (I.P. address
> using the "pkg_add -r apache22" command, but how do
> you get Apache (or Bind, etc.) to automatically start upon boot?
> I got the jail to start by adding qjail_enable="YES" to hosts'
> /etc/rc.conf and I also added apache22_enable="YES", but that doesn't
> seem to work.

You would need to add apache22_enable="YES" to the jail's rc.conf, not
the host's.

> Suggestions?
> Also, when I console into the jail, and issue an "apachectl start"
> command, I get the following error:
> httpd: apr_sockaddr_info_get() failed for webserver
> httpd: Could not reliably determine the server's fully qualified
> domain name, using for ServerName

Edit httpd.conf, adding a ServerName directive.  (An example exists in
the file, so you can model after that.)  If you don't have a FQDN, use
the jail's hostname, and add that hostname to the jail's /etc/hosts.

> I figured out if I add the IP address of the jail as well as
> "webserver" to the jails' hosts file, I can start Apache, but I still
> get this error:
> httpd: Could not reliably determine the server's fully qualified
> domain name, using for ServerName
> What am I doing wrong?
> Finally, rather than installing Apache using the typical "pkg_add -r
> apache22" command, is there a way to install Apache using the
> ./configure script? In MY case, I know the EXACT parameters I want to
> pass to the ./configure script (like enabling SSL, etc), but I don't
> know how to do this in a "jail".

You can build from source if you like, but ports are easier, IMHO.

Have a look here for more information on the ports tree:

>>From the jail console, I tried:
> cd /usr/ports/www/apache22
> ./configure --enable-ssl...etc., etc., etc.???

'make config' to show the configuration screen; 'make install' to
compile and install.

> but this doesn't work.
> Do I need to do the opposite, i.e., from the HOST console:
> ./configure --prefix=/PathToJail --enable-ssl...etc., etc., etc???

Nope; have a look at the link I pasted above.  I think you might like
the ports tree rather than compiling from source, since all of the "hard
work" has already been taken care of for you.


- -- 
Glen Barber
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla -


More information about the freebsd-questions mailing list