Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2A363109AB for ; Fri, 8 Nov 2013 20:29:33 +0000 (UTC) Received: (qmail 7736 invoked by uid 500); 8 Nov 2013 20:29:29 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 7696 invoked by uid 500); 8 Nov 2013 20:29:29 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 7687 invoked by uid 99); 8 Nov 2013 20:29:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Nov 2013 20:29:29 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dmikusa@gopivotal.com designates 209.85.216.54 as permitted sender) Received: from [209.85.216.54] (HELO mail-qa0-f54.google.com) (209.85.216.54) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Nov 2013 20:29:22 +0000 Received: by mail-qa0-f54.google.com with SMTP id j7so2128311qaq.13 for ; Fri, 08 Nov 2013 12:29:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=6pzLAoevAvr+FABCvaQWMsJ6i3IQyGaqQdHlBeYMcbA=; b=fcv5yTiU/J7SRmoZTV4epvYm1O4i3xy6KhqxIdonvkiNW0IvWU+k1/k8Y/JSHWYNHe hAAvMi+uIQXrDvhSHx8P/PtLiRQYtlezvCabtYg28pgswuU7xfvNBAOHgXs6JhyzLTku sOtu8a2LiV7jcSskgMq15g9d9W0zaBatIMXXjnnW7ENODJJKZUlE6GZLDIEVNt1XvCYH 4MbEAzqwBs24pzCLZ9ek6uwGvfvYaFrYOn8O+Ku8PVM0SBgurstZuTPd9jlXj/FPsLZb oFhcHuLh53zaJLdOVaujkhZQGJ60/lHJ2K8hdQfVRcA9QVArU7DpXoNSm5x+MgD/zULe EavQ== X-Gm-Message-State: ALoCoQnsTiSyha3n0d9nGM6bcGT2FLogrcNjRBo+O1Mb6wNgZVO0XyuTSk1Odw+d1C9RoB4MbEYD X-Received: by 10.224.11.68 with SMTP id s4mr27365390qas.88.1383942541544; Fri, 08 Nov 2013 12:29:01 -0800 (PST) Received: from [192.168.0.6] (d118-75-246-224.col.wideopenwest.com. [75.118.224.246]) by mx.google.com with ESMTPSA id x10sm26041931qas.5.2013.11.08.12.29.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Nov 2013 12:29:01 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Host appBase From: Daniel Mikusa In-Reply-To: <0E912D55-1698-4D38-BC98-93FF1913D5F0@cyberlifelabs.com> Date: Fri, 8 Nov 2013 15:29:00 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <1A2678ED-BEA6-47F9-81A3-2EFD6DD938AC@gopivotal.com> References: <0E912D55-1698-4D38-BC98-93FF1913D5F0@cyberlifelabs.com> To: "Tomcat Users List" X-Mailer: Apple Mail (2.1510) X-Virus-Checked: Checked by ClamAV on apache.org On Nov 8, 2013, at 1:54 PM, Milo Hyson wrote: > The term that immediately comes to mind is YAGNI. How many of these = things have legitimate use-cases and how many are simply there because = it was thought somebody somewhere someday *might* want to adjust them? > /dev/null I disagree with this statement. The default settings in Tomcat are = convenient and provide a good general environment for deploying = applications, however it is always nice to be able to adjust and = customize things. With the exception of xmlBase, I've used all of the = settings below on multiple occasions and I'm glad they exist. >=20 > - Milo Hyson > Chief Scientist > CyberLife Labs, Inc. >=20 > On Nov 8, 2013, at 9:18 AM, Leo Donahue - OETX = wrote: >=20 >> Tomcat 7.0.47 >>=20 >> Reading over the security benchmark I posted a link to earlier, there = is one that suggests to separate out the web content directory from the = Tomcat system files. Reading the Tomcat docs for appBase, I see I can = set this value. >>=20 >> Reading further down in the Tomcat docs for Host, other questions = have spawned... and I blame it on being Friday. >>=20 >> 1. When/Why would I change the xmlBase directory location? =20 Can't say I've ever used this setting before. The default has always = worked nicely for me. It's here for flexibility though. For example if = you would like to locate your xml context files outside of CATALINA_BASE = or CATALINA_HOME. Perhaps on a different disk or partition. >> For the same reasons I would change the appBase directory? I see this used occasionally. Some users like to host their = applications in a dedicated folder like "/my-apps". Often on a = different disk or partition. >> 2. What is the benefit of un-packing WAR files? I'm not sure there's a concrete answer here. Generally I see people = unpack WAR files, but it's not a must. One nice thing about having the = WAR file exploded is that I can edit certain files without having to = redeploy my application. >> a. If you drop a WAR file into your webapps directory (appBase = I guess), and it unpacks, should you leave the WAR file there or remove = it? If Tomcat is running, you would leave it there unless you want to = undeploy the application. Then you would delete it. =20 If Tomcat is not running, you could delete the WAR file. If the = exploded WAR directory still exists you could start Tomcat back up and = run the application from it. Running from an exploded WAR directory has = some advantages like the WAR file doesn't need to be extracted on = startup and you can edit certain files without needing to redeploy. >> 3. WAR files located outside of the Host's appBase will not be = expanded... >> a. Why would I deploy WAR files outside of the Host's appBase? This is a preference / customizability thing. Some people prefer to = deploy their applications to a custom folder like "/my-apps", but = instead of pointing the entire appBase at this directory they'll use a = context file in the xmlBase to deploy an application that is outside of = the appBase. One reason that I've personally used this is when developing software. = I set the docBase in a context file to point to the directory that = contains the output from Maven. Paired with the "reloadable" setting, = this means that Tomcat will redeploy my application automatically when = trigger a Maven build. >> b. Where are those deployed? By specifying the docBase? Files outside of the app base can be anywhere. As you mentioned, you'd = just point to them with the docBase. >> 4. What is the difference exactly between appBase and docBase? The appBase (configured on the Host tag, defaults to "webapps") points = to a directory that can contain web applications to be deployed to = Tomcat. Any valid web app in that directory will get deployed. =20 The docBase (configured on the Context tag) points to a directory or WAR = file for one specific application. >> If the Context is specified in server.xml, I can have an appBase and = a docBase? I wouldn't suggest adding Context tags in server.xml. You can but it's = not flexible and you need to restart Tomcat to make changes. As far as = appBase and docBase, you can specify both although they are specified on = two different tags (Host vs Context). When you specify a Context tag in = server.xml, you need to specify a docBase. You would never specify a = docBase that points to an application residing under the appBase. That = would be bad. >> I know docBase has to be set outside of the Host's appBase, but why = would I have two locations for WAR files? Not sure I understand this question. Perhaps you have multiple = applications to deploy, some are located in the appBase and some are = not. Dan= --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org