Download and extract the server installation file
Discover the various methods for extracting the server installation file.
If you're using a GUI, open a terminal window by choosing Launch > Applications
> Utilities > Terminal. If you saved this file to your desktop and
you're still the root user, run the command
ls -ltr to see if your Tomcat tar.gz file is
there. Then, move this file under the /opt directory (which is where most new
software is installed). To move the installation files, type:
mv *tar.gz /opt
Ls –ltr /opt to make sure it's there.
Permissions are the lifeblood of a UNIX system. Without the proper permissions,
you can't do anything; without restricting permissions to certain things, any
user can do anything. That is why you first must grant yourself higher-level
permissions on the installation file so that you (or another user) can properly
execute it. Next, use the
umask command, shown in
Listing 4, to make sure that you can write the files to all the
temp and installation directories appropriately when you extract the installation
Listing 4. Set the proper permissions and umask
cd /opt chmod +x *gz (same as chmod 775) umask 007 (makes any new files your user creates to be created with a 770 permission. Think chmod in reverse)
Most code packages come as a .tar file, with a .gz file to compact it even
gunzip command simply expands
the package from its first layer of compression:
Finally, you must "untar" (unpack) the code. Doing so extracts the code exactly as it was packed—directories and all. This is why it's important to untar the file under the directory path in which you need the code installed. In UNIX, the best place would be /opt.
tar -xvf *.tar
This command extracts your application files. Type
to view the extracted files. If for some reason your installation came with a
.bat or .exe file, you can remove those by typing:
rm *.exe rm *.bat
When the Tomcat directory established, you can move on to configuring, compiling, and starting the server.