From owner-freebsd-questions@FreeBSD.ORG Tue Sep 16 19:47:46 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C45BE106566B for ; Tue, 16 Sep 2008 19:47:46 +0000 (UTC) (envelope-from chris@smartt.com) Received: from barium.smartt.com (barium.smartt.com [69.67.187.30]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0FE8FC2C for ; Tue, 16 Sep 2008 19:47:46 +0000 (UTC) (envelope-from chris@smartt.com) Received: from [69.31.174.220] (unknown [69.31.174.220]) by barium.smartt.com (Postfix) with ESMTP id 08C5310E451; Tue, 16 Sep 2008 12:47:29 -0700 (PDT) Message-ID: <48D00D62.6030005@smartt.com> Date: Tue, 16 Sep 2008 12:47:46 -0700 From: Chris St Denis User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Matthew Seaman References: <48CFEC4B.1080009@optiksecurite.com> <48D003E9.8070801@infracaninophile.co.uk> In-Reply-To: <48D003E9.8070801@infracaninophile.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD , freebsd-questions@freebsd.org Subject: Re: Multiple installation of one ports X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2008 19:47:46 -0000 Matthew Seaman wrote: > FreeBSD wrote: >> Hi everyone, >> >> I've been asked by a customer to install Drupal on one server to >> manage a new site. No problem yet. But, he also asked if it would be >> possible to install it for other sites. >> >> I know that there is a warning if you want to install a port that is >> already installed, but is there a way to bypass this? I know I could >> install it from the tarball from the website, but I want to be able >> to use portupgrade and portaudit to deal with it. >> >> Any suggestions? > > This is an interesting problem. The FreeBSD ports system does not at > present allow multiple installations of the same port, even into > different ${PREFIX}es. This make sense for most of the software dealt > with by the ports system, but in the specific case of web based > applications having the same application installed into multiple > locations > in the same web tree is a perfectly reasonable thing to want to do. > > Here are some ideas as to ways you might consider for working round the > problem and still being able to use the ports system in the usual way. > None of these are tested by me in any way, and some of them may not > actually work. > > i) If you have spare IPs available, simply set up jails to run > second and subsequent instances of drupal and apache. This is > pretty much overkill but it's a tried and tested strategy and > should be reliable. > The downside is you need to install at least enough of a system in > each jail to support running apache, etc. plus you have to maintain > each of the different jail environments separately. > > ii) If you haven't any spare IPs, you can install multiple copies of > the same port on the same machine by changing *both* $PKG_DBDIR > and $PREFIX in the environment to distinct values for each copy. > Unfortunately changing $PREFIX doesn't give you complete freedom > to choose where a web app will be installed -- typically a web app > will be located at ${PREFIX}/www/app-name. However by judicious > use of the Alias directive in httpd.conf you can make all those > different directories appear in the same web tree. Like option > (i) you've still got multiple copies of ports to maintain, although > in this case, it's only the drupal port and anything that depends > on drupal that you need multiple copies of, rather than the entire > installation tree of ports. > > iii) A kind of wacky idea this, and it will only work for web apps whose > configuration files are contained within the web root. That's > true of most PHP based web apps -- other languages may differ. > Install the port once only, in the normal fashion. Then create > loopback mounts of the application directory multiple time, each to > a union fs (see mount_unionfs(8)) where you superpose a separate > layer to contain just the configuration files for that instance. > It's conceptually complicated, but all the work should be at the > setup stage and after that, there's only one instance of your web > app to keep properly maintained. > > iv) I've no idea if this is at all possible with Drupal, but really > the absolute easiest solution is to choose a CMS that lets you > manage several different web sites (virtual hosts, web trees, what > you will) within the same instance. > Cheers, > > Matthew > > What I do with webapps from ports is install them once, then copy them to each of the customers that wants them. It's not a perfect solution, but for a webapp what I care about for the ports is dependency tracking, and portaudit.