Multiple instances of Apache

Lee Brotherston lee at
Thu Nov 11 22:45:20 GMT 2004

David Jenkins wrote:
> Within there, I would like all of apache, PHP5 and it's dependencies.

You can do that with ports.  The main problems you would encounter are:

- As you will have to set the dirs with environment variables, 
portupgrade would only upgrade one of the apaches automatically so you'd 
need to do one manually (I think anyway)

- The ports database will already see the first apache as being 
installed, so you'd have to force package register the second one.

> If that's not too good an idea - perhaps because I would need 2
> versions of many ports installed and using portupgrade would be
> slightly complicated, then perhaps I should just forget the ports tree
> and just
> ./configure --prefix=/jail --other-things=/usr/local
> etc ... from source?

If you set --prefix=/some/path then you will get the whole apache 
install (binaries, config, man pages and all) installed from that path 
down.  So ./configure'ing twice with two different paths would give you 
two apaches in different dirs.  Each would have their own apachectl 
which would make it easy to stop and start (I did this when running both 
apache1 and apache2 at one point).

If you wanted the single apache, two configs option.  It's just the 
standard install and copy the configuration to a second place.  Pitfalls 
with this would be:

- Needing to set a seperate location for things like pid files
- apachectl by default will only start one instance, you'd need to 
fiddle with that or start apache by calling httpd directly.

Anyway, I think I've waffled on for long enough there... so I'll shush :)



More information about the Ukfreebsd mailing list