How to setup Apache Tomcat on OS X?

4

1

I'm trying to setup Apache Tomcat 7 for some work. I need to get it done, but I think I've setup things incorrectly. What is the right way? I'm using NetBeans, and have set the install directory for the server in the Netbeans folder under Applications.

T145

Posted 2014-01-15T15:38:37.467

Reputation: 185

Answers

11

Try brew to install custom packages

brew install tomcat

then start it via:

/usr/local/opt/tomcat/bin/catalina start

If using with Netbeans/Eclipse IDEs, you've to set-up to point to CATALINA_HOME which is /usr/local/opt/tomcat/libexec.

jctim

Posted 2014-01-15T15:38:37.467

Reputation: 508

1Tried it /w v 6 line (brew install tomcat6), it installed to /usr/local/Cellar/tomcat6/6.0.43. Can be started synchronously /w [..]/bin/catalina.sh run, runs at port 8080, I suspect you just need to point netbeans at the appropriate directory. The server at http://localhost:8080 was pretty self-documenting. – Jacob Oscarson – 2015-01-12T13:36:58.730

The only reason I want to avoid installing Homebrew packages for tomcat is that I'm not sure if Netbeans will be able to detect the installed package. – T145 – 2014-01-17T14:53:40.590

3

I used the Bitnami installer available at https://bitnami.com/stack/tomcat/installer to do this. Let someone else worry about the details, I say.

Bitnami make good installers (and VMs) for a large range of this sort of stuff.

Tony Williams

Posted 2014-01-15T15:38:37.467

Reputation: 533

Looks awesome! I'll try it out! – T145 – 2014-01-17T14:47:01.527

2

Another option is to go with Pivotal tc Server Developer Edition, which is a free drop-in replacement for Apache Tomcat.

Installing it on OSX straightforward. First, open Terminal then install HomeBrew if you don't have it:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Next, run the following Homebrew command:

brew tap pivotal/tap && brew install tcserver

This will connect to the Pivotal HomeBrew repository, then download and install tc Server. From there you can follow the instructions in the Terminal.

Full disclosure: I work for Pivotal and am part of the tc Server product team, and one of our goals is to make it super easy to get started with tc Server on OSX. Any questions, you can reach me at @alsargent on Twitter.

Al Sargent

Posted 2014-01-15T15:38:37.467

Reputation: 21

Is it open-source on a VCS? I could probably contribute! – T145 – 2014-01-17T14:54:18.657

tc Server is closed source. But you're more than welcome to contribute to ASF Tomcat. – Al Sargent – 2014-01-18T01:56:46.667

1

Are you looking for something like MAMP (analogous to the LAMP stack)?

http://www.mamp.info/en/index.html

CHK

Posted 2014-01-15T15:38:37.467

Reputation: 507

No, but thanks for the input! It may prove useful to some other function in the future! – T145 – 2014-01-17T14:49:36.260