HomeMac OS XHow to Install Apache Tomcat 9 on Mac OS X
Installing Tomcat 9 on Mac OS X El Capitan is actually quite easy.
The Mac OS X installation process is fairly painless and straight forward, but there are a few rough spots along the way. Follow these step by step instructions to get Tomcat up and running on your Mac OS X machine in no time.
Configure Environment Variables
Graphic: 1024 x 768 or higher resolution with 16.7 million colours; Download. Get the latest Apache OpenOffice release for your MacOS X. Please subscribe to the users mailing list. Send an empty email to [email protected] and just reply to the returned email. News and weblog. MacOS Update: While these instructions still work, there are new posts for recent versions of macOS, the latest being Install Apache, PHP, and MySQL on macOS Mojave. I have installed Apache, PHP, and MySQL on Mac OS X since Leopard. Each time doing so by hand. Each version of Mac OS X having some minor difference. Jul 16, 2017 Mac runs on base Unix foundation so mainly you could install almost all Linux/Unix software on Mac very easily. Mac OS X comes by default with Apache Web Server and PHP. In this tutorial we will go over steps on how to enable those on Mac. Let’s get started: Enable Apache Web Server Step-1. Open terminal App and run below command. Mac users will also benefit from this program since it is now available for Mac OS X via Apache OpenOffice.org Mac. Spreadsheet tools: Apache OpenOffice.org Mac has a spreadsheet tool that functions as if you are working on Microsoft Excel. With OpenOffice Calc, you can create folders and manage them. The Apache Subversion project does not officially endorse or maintain any binary packages of the Subversion software. However, volunteers have created binary packages for different distributions and platforms, and as a convenience, we maintain a list of links to them here. Mac OS X ¶ An old version of Subversion is shipped with MacOS X.
Prerequisite: Java
Download and install the latest Java 8u92 form this link.
The JDK installer package come in an dmg and installs easily on the Mac; and after opening the Terminal app again,
java -version
Now shows something like this:
java version '1.8.0_66'
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
Whatever you do, when opening Terminal and running java -version, you should see something like this, with a version of at least 1.7.x I.e. Tomcat 9.x requires Java 7 or later.
JAVA_HOME
is an important environment variable, not just for Tomcat, and it’s important to get it right.To set the JAVA_HOME variable, open a new Terminal window and use the following command to open the system profile for editing. (You can substitute your favorite text editor. We like Vim.):
vi ~/.profile
Once you’ve opened the profile, add the following lines to set the
JAVA_HOME
and CATALINA_HOME
variables:export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME=/Path/To/Tomcat/Home
Installing Tomcat
1. Download Tomcat from the official website (tomcat.apache.org), select Tar.gz format under the Core section
2. Extract the Tomcat to directory:
/Library
, in order to facilitate the use, rename the folder to 'Tomcat'
3. Open Terminal, modify folder permissions
sudo chmod 755 /Library/Tomcat/bin/*.sh
4. Press the Enter key, then you will be prompted for a password, enter the administrator password. Then continue with the following command to open the tomcat service
sudo sh startup.sh
5. Open the browser and enter
http://localhost:8080/
, press Enter.If you see the Apache Tomcat, this means Tomcat has successfully run
That is it! You should now be able to access Apache Tomcat’s welcome page on
http://localhost:8080
. If you wish to make stopping Tomcat 9, use this command:sudo sh /Library/Tomcat/bin/shutdown.sh
Quickly set up multiple web environments under the built-in Web Sharing feature of Mac OS X, or a standard MAMP Apache Install.
Apache Admin is NOT a swiss army knife, it's just a small utility that will::
- Map aliases to local directories
- Restart Apache
- Restart Apache
![Apache For Mac Os X Apache For Mac Os X](/uploads/1/3/4/3/134348515/911234869.jpg)
NOTE: Mavericks requires 'Unidentified Developer' apps downloaded from the internet to be verified by you. After downloading and unzipping, right-click on 'Apache Admin' app and choose 'open'. You'll only have to do this once.
Using Apache Admin
- Drag and drop a folder on your local machine into the 'Aliases' area of the app.
- Edit the 'Alias' field to your liking.
- Click the 'Save' button.
- Apache Admin will set up the alias and automatically restart Apache.
- Edit the 'Alias' field to your liking.
- Click the 'Save' button.
- Apache Admin will set up the alias and automatically restart Apache.
Once you've set up an alias, you can launch a browser window and type in the new address.
For example
http://localhost/bob
OR
http://localhost/whatever
OR
http://localhost/whatever
... you should see the contents of the folder that the alias was 'mapped to'.
Admin Password
Should be the adminitrator password for you Mac (the user who is allowed to do anything on the Mac).
Should be the adminitrator password for you Mac (the user who is allowed to do anything on the Mac).
Apache Path
Used to target where the main Apache 'program' lives on your system. If you have a unique Apache installation, or perhaps Apple decides to change things in the future, you can edit this path to target where Apache lives on your system. Don't change this unless you understand what you're doing.
Used to target where the main Apache 'program' lives on your system. If you have a unique Apache installation, or perhaps Apple decides to change things in the future, you can edit this path to target where Apache lives on your system. Don't change this unless you understand what you're doing.
Conf Path
D etermines where the alias configurations go. This is a special path on your system where Apache automatically picks up 'conf' files. Don't change this unless you understand what you're doing.
D etermines where the alias configurations go. This is a special path on your system where Apache automatically picks up 'conf' files. Don't change this unless you understand what you're doing.
About Aliases
On the Mac, the localhost 'domain' is set up to pull files from the following folder on your Mac's hard drive:
/Library/WebServer/Documents
In other words, when you enter the following address into a browser on your Mac:
http://localhost
... Apache will direct the requests to (or pull files from) the '/Library/Webserver/Documents' folder.
Developers need a way to run multiple sites locally -- using a unique folder and 'address' for each site.
Apache's VirtualHost allows us to manage domains, however, establishing a VirtualHost requires a fiddling around with the Mac's DNS and other scary stuff -- yikes!
Enter Aliases
An easier, and less intrusive way to 'point' or 'map' an address to a unique folder is to use an 'alias'.
Unlike a VirtualHost, an alias is just a single word that follows the 'localhost' address.
Example:
http://localhost/foo
In the example above 'foo' is the alias.
Apache can be configured to direct requests to this 'foo' address to a unique folder on your Mac hard drive.
Example:
http://localhost/foo
...can be mapped to:
/Volumes/MyOtherHD/mysite
...can be mapped to:
/Volumes/MyOtherHD/mysite
Now, when you enter 'http://localhost/foo', the browser will display the contents of '/Volumes/MyOtherHD/mysite'
What's going on under the hood?
I've been manually writing aliases for years, but every time I need to set up an alias, I have to dig around for the instructions, deal with shell commands, type out folder paths and so on. It's easy to do manually, but a pain in the arse.
Basically, Apache Admin maintains a simple 'conf' file that gets picked up as an 'Include' when Apache starts. Apache Admin writes alias' to this file, then restarts Apache.
Going a little deeper
In Mac OS X , Apache is configured (by default) to load any 'conf' files located in the following system folder:
/etc/apache2/other/*.conf
If you open Apache's main conf file (httpd.conf) you'll see the reference to the 'other' folder as an 'Include' toward the end of the file. (See the 'Not Working' section below for the gorey details.)
Apache Admin maintains a file named 'aliases.conf' in this 'other' folder:
/etc/apache2/other/aliases.conf
The contents of the 'aliases.conf' file will resemble:
Apache Openoffice For Mac Os X
...
usually near the end of the file
...
Alias /abc'/Users/bob/Documents/mysite1'
<Directory '/Users/bob/Documents/mysite1'>
Options All Multiviews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Alias /xyz'/Users/bob/Documents/mysite2'
<Directory '/Users/bob/Documents/mysite2'>
Options All Multiviews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
usually near the end of the file
...
Alias /abc'/Users/bob/Documents/mysite1'
<Directory '/Users/bob/Documents/mysite1'>
Options All Multiviews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Alias /xyz'/Users/bob/Documents/mysite2'
<Directory '/Users/bob/Documents/mysite2'>
Options All Multiviews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
You can review the file that Apache Admin creates by entering the following into Terminal
vi /etc/apache2/other/aliases.conf
So to recap: Apache Admin creates the aliases.conf file, then restarts Apache. That's really all that's going on.
Not Working?
There are 2 versions of Apache Admin, the only difference between version is the command to access the 'aliases.conf' file.
So if Apache Admin version 1.0 doesn't work, try using version 1.1.
Depending on how Apache is set up on your system, you may have to discover the path to the 'other' folder and/or the path to Apache. (And that's why those fields are available for you to edit!)
You can poke around the Apache conf file by launching Terminal and entering:
Mysql For Mac
vi /etc/apache2/httpd.conf
Scroll down and look for lines that begin with 'Include' or 'MACOSXSERVER'
<IfDefine !MACOSXSERVER>
Include /etc/apache2/other/*.conf
</IfDefine>
<IfDefine MACOSXSERVER>
<IfDefine WEBSERVICE_ON>
Include /etc/apache2/sites/*.conf
</IfDefine>
<IfDefine !WEBSERVICE_ON>
Include /etc/apache2/sites/virtual_host_global.conf
Include /etc/apache2/sites/*_.conf
Include /etc/apache2/sites/*__shadow.conf
</IfDefine>
</IfDefine>
Include /etc/apache2/other/*.conf
</IfDefine>
<IfDefine MACOSXSERVER>
<IfDefine WEBSERVICE_ON>
Include /etc/apache2/sites/*.conf
</IfDefine>
<IfDefine !WEBSERVICE_ON>
Include /etc/apache2/sites/virtual_host_global.conf
Include /etc/apache2/sites/*_.conf
Include /etc/apache2/sites/*__shadow.conf
</IfDefine>
</IfDefine>
In the example above, the NOT MACOSXSERVER means, well, my Mac isn't a 'server' it's just a personal computer, so Apache will load all of the 'conf' files located in the 'other' folder.