How get tomcat6 configured?

Murray Eisenberg murrayeisenberg at gmail.com
Mon Mar 4 20:31:42 PST 2013


I tried your solution with the correct path (which was my error in posting the query). . .

  sudo CATALINA_BASE=$CATALINA_BASE /opt/local/share/java/tomcat6/bin/conf_setup.sh

and now that script seems to run.

[But I don't understand why that form is required: My understanding is that with Mountain Lion, if not before, one sets up system-wide environment variables by creating file /etc/launchd.conf and putting setenv commands there. In the case at hand:

  setenv CATALINA_BASE  /opt/local/share/java/tomcat6

But that doesn't seem to be picked up.]

Next issue, I now ran:  

  sudo CATALINA_BASE=$CATALINA_BASE /opt/local/share/java/tomcat6/bin/startup.sh

And got a bunch of error messages in the output:

conf_setup.sh: file conf/catalina.policy is missing, but no corresponding conf/catalina.policy.sample file was found to repair it!
conf_setup.sh: file conf/catalina.properties is missing, but no corresponding conf/catalina.properties.sample file was found to repair it!
conf_setup.sh: file conf/server.xml is missing, but no corresponding conf/server.xml.sample file was found to repair it!
conf_setup.sh: file conf/tomcat-users.xml is missing, but no corresponding conf/tomcat-users.xml.sample file was found to repair it!
conf_setup.sh: file conf/web.xml is missing, but no corresponding conf/web.xml.sample file was found to repair it!
conf_setup.sh: file conf/setenv.local is missing, but no corresponding conf/setenv.local.sample file was found to repair it!
Using CATALINA_BASE:   /opt/local/share/java/tomcat6/webapps
Using CATALINA_HOME:   /opt/local/share/java/tomcat6
Using CATALINA_TMPDIR: /opt/local/share/java/tomcat6/webapps/temp
Using JRE_HOME:        /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
Using CLASSPATH:       /opt/local/share/java/tomcat6/bin/bootstrap.jar

Evidently, startup.sh calls conf_setup.sh.

But there _are_ already files:

    /opt/local/share/java/tomcat6/conf/catalina.policy
    /opt/local/share/java/tomcat6/conf/server.xml       (and corresponding sample file)
    /opt/local/share/java/tomcat6/conf/web.xml          (and corresponding sample file)
    /opt/local/share/java/tomcat6/conf/tomcat-users.xml (and corresponding sample file)
     /opt/local/share/java/tomcat6/conf/setenv.local    (and corresponding sample file)

Note, though, that the output from startup.sh says:

  Using CATALINA_BASE:   /opt/local/share/java/tomcat6/webapps

Which is _not_ what it was set to be in the commands invoking startup.sh or conf_setup.sh directly.

What's going on here? I'm now completely mystified!

 
On Mar 4, 2013, at 9:14 PM, Lawrence Velázquez <larryv at macports.org> wrote:

> On Mar 4, 2013, at 5:58 PM, Murray Eisenberg <murrayeisenberg at gmail.com> wrote:
> 
>> In my ~/.profile, I've set:
>> 
>> export JAVA_HOME=$(/usr/libexec/java_home)
>> export CATALINA_BASE=/opt/local/share/java/tomcat6
>> 
>> And re-loaded the profile into Terminal with: source ~/.profile
>> 
>> But wen I run 
>> 
>> sudo /opt/local/share/tomcat6/bin/conf_setup.sh
>> 
>> I get message:  CATALINA_BASE must be set in my environment
>> 
>> How do I fix that?
> 
> By default, sudo executes commands with a minimal environment, so CATALINA_BASE won't be passed along. The easiest thing to try is explicitly specifying the variable in the sudo invocation.
> 
>    sudo CATALINA_BASE=$CATALINA_BASE /opt/local/share/tomcat6/bin/conf_setup.sh
> 
> vq

---
Murray Eisenberg                     murrayeisenberg at gmail.com
80 Fearing Street                      phone 413 549-1020 (H)
Amherst, MA 01002-1912







More information about the macports-users mailing list