From owner-freebsd-questions@FreeBSD.ORG Sat Jul 16 15:29:15 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8BE7C16A41C for ; Sat, 16 Jul 2005 15:29:15 +0000 (GMT) (envelope-from ws@au.dyndns.ws) Received: from ash25e.internode.on.net (ash25e.internode.on.net [203.16.214.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0912B43D48 for ; Sat, 16 Jul 2005 15:29:14 +0000 (GMT) (envelope-from ws@au.dyndns.ws) Received: from lillith-iv.ovirt.dyndns.ws (ppp103-111.static.internode.on.net [150.101.103.111]) by ash25e.internode.on.net (8.12.9/8.12.6) with ESMTP id j6GFTAnx041684; Sun, 17 Jul 2005 00:59:13 +0930 (CST) (envelope-from ws@au.dyndns.ws) X-Envelope-From: ws@au.dyndns.ws X-Envelope-To: freebsd-questions@freebsd.org Received: from [192.168.1.193] ([192.168.1.193]) by lillith-iv.ovirt.dyndns.ws (8.13.3/8.13.3) with ESMTP id j6GFSoOY050818; Sun, 17 Jul 2005 00:58:51 +0930 (CST) (envelope-from ws@au.dyndns.ws) From: Wayne Sierke To: Ksenia Marasanova In-Reply-To: <130df193050715165114553342@mail.gmail.com> References: <130df193050715165114553342@mail.gmail.com> Content-Type: text/plain Date: Sun, 17 Jul 2005 00:58:50 +0930 Message-Id: <1121527730.85281.71.camel@au.dyndns.ws> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.51 on 192.168.1.142 X-Scanned-By: SpamAssassin 3.000004(2005-06-05) X-Scanned-By: F-Prot X-Scanned-By: ClamAV X-Spam-Score: -2.82 () ALL_TRUSTED Cc: freebsd-questions@freebsd.org Subject: Re: install Apache1 and Apache2 on the same server 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: Sat, 16 Jul 2005 15:29:15 -0000 On Sat, 2005-07-16 at 01:51 +0200, Ksenia Marasanova wrote: > Greetings, > > I have FreeBSD box that runs Apache1 from ports. Now I'd like to > install Apache2 from ports (and run it on different IP), without > overwriting httpd binary of Apache1. What would be the correct, > port-friendly :) way to do it? (I also use portupgrade, it would be > nice if portupgrade will still be able to upgrade both ports) > > Any tips or pointers to man pages are appreciated. > > Thanks! > I went through this recently, installing www/apache13-modssl on a box that already had www/apache21 installed. So rest assured it can be done (since I managed to do it, it can't be too hard!). Unfortunately I didn't take notes as I should have and despite making a mental note to avoid doing so I managed to blow away my modified files by cvsup-ing ports on that box. (Would appreciate tips on how to avoid/work around this?) Between the two ports the bulk of the files go to unique destinations, the exceptions include 1) the bin/sbin binaries, 2) the installed/default pages and 3) man pages and IIRC the port refused to install until the conflicts were resolved. The key to this is the line in the Makefile that adds "--with-layout=FreeBSD" to CONFIGURE_ARGS (you can extract and examine the file "config.layout" from the source tarball to see the resulting layout scheme). Unfortunately setting PREFIX isn't sufficient to resolve it and I ended up replacing the "--with-layout" line in the Makefile with an alternate layout spec, something like: --prefix=${PREFIX} \ --exec_prefix=${PREFIX}/apache \ --bindir=${PREFIX}/apache/bin \ --sbindir=${PREFIX}/apache/sbin \ --libexecdir=${PREFIX}/libexec/apache \ --mandir=${PREFIX}/apache/man \ --sysconfdir=${PREFIX}/etc/apache \ --datadir=${PREFIX}/apache/www \ --iconsdir=${PREFIX}/apache/www/icons \ --htdocsdir=${PREFIX}/apache/www/data \ --manualdir=${PREFIX}/share/doc/apache \ --cgidir=${PREFIX}/apache/www/cgi-bin \ --includedir=${PREFIX}/include/apache \ --localstatedir=/var \ --runtimedir=/var/run/apache \ --logfiledir=/var/log \ --proxycachedir=${PREFIX}/www/proxy Read the Apache docs and you'll see that you should also be able to create your own custom layout config either by modifying config.layout or just creating your own custom layout file, and changing the --with-layout line in the Makefile appropriately (this might be a candidate to have the FreeBSD Apache ports updated - to allow custom layouts to be specified). Note that when installing dependent ports you'll need to set APXS according to which apache install is relevant (e.g. in my case I need it to reference /usr/local/apache/bin/apxs when installing against 1.3.x, rather than the default 2.x /usr/local/sbin/apxs). I don't know how you'll go customising this for Apache2.x, however having done it for 1.3.x I can relate that I ran in to problems installing some subsequent dependent ports (some of the p5-* ports and the bricolage port). From what I can recall it was to do with failing to honour the APXS variable and some hard-wired assumptions about apache files being installed at a prefix of /usr/local. I think there were issue with port removal, too. In any case don't be surprised if you find yourself having to do further customisation when installing ports dependent on your customised apache. Finally, as you've noted, to be able to run both versions side-by-side you'll need to have your apaches configured appropriately, different IPs or ports, etc. I currently have them both running on the same IP address on different ports. Bricolage and Apaches are all doing fine. If anyone has any hints/references as to how best to manage these kinds of customisations to ports, it would be greatly appreciated. HTH, Wayne