The Tomcat source tarball (the ZIP file is fine, but we're on UNIX, so the tarball is more natural) A Java Development Kit, available from Java.net; Apache ant, available from the Apache ant downloads page Once you have all that, ant deploy. You may have to set your JAVAHOME environment variable and/or specify the full path to your ant binary. Pdf merger mac offers a quick and easy way for anyone to merge any number of pdf files into one simple to store and share document. Pdf merger mac is a mac os x application to merge pdf docs to a single pdf file, pdf merger mac is a free mac os x application that let you merge several pdf documents into one single pdf file / pdf merger mac also allows you to adjust the pdf sequence by the up. For more information concerning Tomcat Native, see the Tomcat Native site. Source (please choose the correct format for your platform) Native 1.2.24 Source Release tar.gz (e.g. Unix, Linux, Mac OS).
Running Tomcat on Mac OS X
For an updated guide for installing Tomcat 5/6 on Mac OS X 10.6 using MacPorts check http://serverfault.com/questions/183496/full-guide-for-installing-tomcat-on-os-x
[See below for later updates to this 2004 posting]
MacOS Sierra update made my Apache's localhost inaccessible. Well, only localhost/ is accessible. But sub-folders under localhost// are NOT.
These notes are the result of several weeks playing with different things and asking a LOT of questions on several mailing lists.
I hope these notes are of use to someone out there.
THE ENVIRONMENT
Java is installed by default on every MacOS X installation. MacOS X 10.2 (Jaguar) comes with Java 1.3; MacOS X 10.3 (Panther) comes with Java 1.4. MacOS X 10.4 (Tiger) comes with Java 1.4.2 installed, but Java 1.5 can be downloaded. MacOS X 10.5 (Leopard) comes with Java 1.5. MacOS X 10.5 (Snow Leopard) comes with Java 1.6. It is possible to run Java 1.4 on MacOS X Jaguar but it may interfere with operation of the standard environment.
JAVA_HOME is at /Library/Java/Home , but this is a link into a directory /System/Frameworks/JavaJVM.Framework/Versions which is used to switch between versions easily. There is a link Current and CurrentVersion which matches up the current Java environment with the appropriate version.
THE SITUATION
I wanted to learn about Java Servlet Pages (JSP) on my Macintosh (with MacOS X). I installed it the first time on a Windows XP Professional system, but my development machine is a Macintosh.
THE SOLUTION
Since I had already installed and played with a separate install of Tomcat (the version installed by Apple's XCode was out of date, as was the version I downloaded from another site), I was ready to give up!
In my case I wanted to get rid of all the other Tomcat installations and start from scratch.
Step 1: Download Tomcat
Download Jakarta Tomcat from the Tomcat home page, and get the binary version - I_downloaded jakarta-tomcat-5.0.27.tar.gz.
Extract the files (unless your browser automatically extracts them).
So you most likely will get an alert message that says: “macOS High Sierra Patcher.app can’t be opened because it is from an unidentified developer”.
![]()
Navigate (using the Finder) to Macintosh HD > Library.
If there is not already a folder in Macintosh HD > Library called Tomcat, then create one.
If there is already a Tomcat folder (presumably from an out-of-date installation), delete all the files already in that folder.
Step 2: Extract tomcat archive
Copy all the unstuffed files from the jakarta-tomcat-5.0.27.tar.gz download and put all the files into the Tomcat folder.
I just named it Tomcat as it saves some typing in the Terminal
So the directory structure becomes:
Macintosh HD > Library > Tomcat > <extracted files>
Step 3: Configure tomcat-users.xml
Open the
/Library/Tomcat/conf/tomcat-users.xml file with a plain text editor. The default Tomcat installation only has the basic roles and users set up.
What is configured as default is:
An example of what it should look like follows:
In this case a role, a user and password have been set up with the name tomcat. You can change this later.
Step 4: Start Tomcat
To start Tomcat, open a shell command prompt (using, for instance, the Terminal application).
Best utilities for mac sierra 2017. The path to Tomcat via the Finder is Macintosh HD > Library > Tomcat.
But to get to that directory using the Terminal, type in:
Do an
ls - you should see a file called startup.sh .
Any file in this directory ending in
.sh can be executed in the terminal by putting a period and a slash before the file name (eg: startup.sh ). The following example executes the tomcat startup script:
Terminal should display four lines looking something like this:
There are some notes and a couple of Preference Panes for automating the starting and stopping of Tomcat. After trying them all on five different computers - this is the simplest!
Step 5: Test installation Open a browser window, and enter http://127.0.0.1:8080 - the default Tomcat page should open.
If you click the Tomcat Administrator or Tomcat Manager links in the upper left hand of the default Tomcat page, you will be asked for a user name and password.
As mentioned above, use tomcat for the user name, and tomcat for the password.
By : Brynley Blake (31 August 2004)
![]()
With considerable help from Joachim, Tracy, Tom, Samuel and Jonel from the Apple Web and Java Developer mailing lists.
Updated for 2006
Basil Bourque says:
Today (2006-04-05) I disovered a somewhat different recipe to running Tomcat 5.5.16 on Mac OS X 10.4.6.
Also Updated in 2010
By Pid: I removed some of the original statements about setting JAVA_HOME as they did not match my experience of installing Tomcat on OS X. It's also certainly overkill to install an application just to be able to set an environment variable.
(1) Upgrade to Mac OS X 10.4.6
(2) Download apache-tomcat-5.5.16
(3) Fix the Unix file permissions
(4) Start Tomcat
(5) Test Tomcat
You are technically done at this point. But as a good pratice, I also did the following additional steps.
(6) Start the Firewall
(7) Enable Port-Forwarding
The Sharing SysPref will get cranky when you add an ipfw rule behind its back; it disables its user interface. To use the Sharing SysPref again you'll have to clear that rule, the one we added and numbered 100. To delete a rule, either read the ipfw man page, or use Simple Port Forwarder again. Quit the System Preferences program, and re-launch it to re-enable its Firewall panel.
(8) Test Tomcat
Notice that we left off the port number this time, so the web browser defaults to port 80. Or you can explicitly say port 80:http://127.0.0.1:80/
• Try another browser.
• Click the Reload button in the toolbar of the browser.
• Choose the Reload command, such as View > Reload Page in Safari.
(9) Walk the dog
As best as I can recall, that is all I had to do today. I hope I am not steering you wrong. I did assume at first that Java 5 would not be used be default, so I wasted time messing with the path ($PATH) and setting the environment variable JAVA_HOME. But I undid those, as they failed. I then tried the simple steps above, and it worked.
I hope to refresh my own web site with this info:http://www.BasilBourque.org/
Tip: You can drag and drop from the Finder to the Terminal, to avoid typing file and folder names.
--Basil Bourque
Updated for 2008
Michael Valentiner says:
Today (2008-02-03) I verified running Tomcat 6.0.14 on Mac OS X 10.5.1.
Like Basil, I did not need to set up JAVA_HOME and I did need to fix Unix file permissions.
Apache Tomcat For Mac Os Sierra 10 13
Unlike Basil, the System Preferences > Sharing > Firewall has moved to System Preferences > Security > Firewall. I was able to enable logging, but haven't figured out how to block UDP.
Updated for 2009
Chris Latko says:
To have Tomcat 6.0.x launch on boot on Mac OS X 10.5.x, you need to add a LaunchDaemon. Create a file called org.apache.tomcat.plist in /Library/LaunchDaemons/ with the following content:
Updated for 2009
Greg Woolsey says:
For Tomcat 5.5.x (and probably 6.0, as the scripts don't appear to have changed much) you need a slightly modified plist, that calls catalina.sh in a manner compatible with the requirements of launchd: http://developer.apple.com/MacOsX/launchd.html. Specifically, the script must be run with the 'run' parameter instead of 'start', as start backgrounds the Java process and exits the script. This causes launchd to think the service is done, and kills the java process as part of it's cleanup.
My plist assumes Tomcat is installed in /Library/Tomcat/tomcat-version, with a symbolic link called 'Home' pointing to the version to use.
Save this file as /Library/LaunchDaemons/org.apache.tomcat.plist:
If you have a web app that doesn't want to shut down nicely (my company's product is one), then to avoid the need to force quit Tomcat just to turn off your Mac, use a startup script instead of a daemon plist.
Add this line to /etc/hostconfig as root:
TOMCAT=YES
![]()
Then, as root, create /Library/StartupItems/Tomcat, writable only by the owner (root).
Inside this, create two files - Tomcat (script) and StartupParameters.plist. Again, make them writable only by root, and the script executable by everyone.
Contents of StartupParameters.plist:
Contents of the Tomcat script file:
Skip to end of metadataGo to start of metadata
Building Tomcat from source on MacOS can require some additional work, especially if you want to build all of the optional items such as
libtcnative .
Building Tomcat
Building Tomcat itself is fairly straightforward. Simply download the source distribution of Tomcat and follow the instructions in the BUILDING.txt file bundled with the distribution.
Briefly, you'll need:
Apache Tomcat For Mac Os Sierra Mac
Once you have all that,
ant deploy
You may have to set your
JAVA_HOME environment variable and/or specify the full path to your ant binary.
Building libtcnative
Building
libtcnative it fairly straightforward as well, but you will need a number of prerequisites that are not terribly obvious as to how to get them.
Download and unpack the libtcnative sources:
$ tar xzf tomcat-native-x.y.x.tar.gz $ cd tomcat-native-x.y.z/native
Using OpenSSL
If using OpenSSL:
$ ./configure --with-ssl=[path to OpenSSL] --with-apr=[path to APR] --with-java-home=[your java home]
For example:
$ ./configure --with-ssl=/usr/local/Cellar/[email protected]/1.1.1 --with-apr=/usr/local/Cellar/apr/1.6.5 --with-java-home=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
Without OpenSSL (LibreSSL)Tomcat For Mac Download
If not using OpenSSL:
./configure --with-ssl=yes --with-apr=[path to APR] --with-java-home=[your java home]
./configure --with-ssl=yes --with-apr=/usr/local/Cellar/apr/1.6.5 --with-java-home=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
In either case (OpenSSL or not), proceed with the build process:
make
Once this process has completed, your built libraries can be found in
.libs/ .
Download Apache Tomcat 8Installing libtcnative
While you can set
ld.library.path to include libraries from all over the place, I recommend that you copy everything into one place so you can easily find everything and it won't interfere with anything else on your system.
First, copy the
libtcnative binaries from where they were built:
Next, copy the APR libraries:
Finally, if you are using a custom OpenSSL build, copy those libraries as well:
Running Tomcat with libtcnative
Tomcat (really Java) needs to know where to find these native libraries. We do that by setting the
java.library.path environment variable for the JVM during startup. The easiest way to do this is by setting CATALINA_OPTS on startup. This can be done by adding this line to bin/setenv.sh :
export CATALINA_OPTS='-Djava.library.path=$CATALINA_HOME/bin'
Then you can startup Tomcat as usual, either:
Apache Tomcat For Mac Os Sierra Compatibility$ bin/startup.sh
or
$ bin/catalina.sh start
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |