Showing posts with label Tomcat. Show all posts
Showing posts with label Tomcat. Show all posts

Wednesday, September 7, 2016

How To Install Tomcat In OS X

Tomcat Installation

Download the latest binary distribution of tomcat, in my case apache-tomcat-8.0.37.tar.gz, from apache

Extract the file from the tar archive and move the tomcat folder to /opt:

cd Downloads/
tar -xvf apache-tomcat-8.0.36.tar.gz 
mv apache-tomcat-8.0.36 /opt

Set CATALINA_HOME and PATH Environment Variables

$ nano ~/.bash_profile
(~/.bash_profile)

# Set Catalina Home
export CATALINA_HOME=/opt/apache-tomcat-8.0.36
# Export Catalina/bin to path
export PATH=$PATH:$CATALINA_HOME/bin

Common Tomcat Commands

To start tomcat, open a shell Terminal window in any directory and issue the command:

$ startup.sh

Test Tomcat installation by pointing your browser to: http://localhost:8080

To stop tomcat, type on the shell:

$ shutdown.sh

To read the log file:

cd /opt/apache-tomcat-8.0.36/logs
tail -f catalina.out

Manager Web Application

The Manager App is an application that comes with Tomcat and allows you to start, stop, reload and undeploy web applications installed in Tomcat

To allow the access to the Manager App add a manager user to the tomcat users configuration file.

Edit the tomcat-users.xml file:

$ nano /opt/apache-tomcat-8.0.36/conf/tomcat-users.xml

add the following two lines:

<tomcat-users>
...
<role rolename="manager-gui"/>
<user username="manager" password="password" roles="manager-gui"/>
</tomcat-users>

Monday, August 15, 2016

How To Install Tomcat 8 in Ubuntu

Install Oracle's JDK

Install Java, see here

Set the JAVA_HOME, CATALINA_HOME and PATH environment variables

The JAVA_HOME variable is used by Java Servers such as Tomcat and JBoss.

The CATALINA_HOME variable is required by when running Tomcat from command line to locate the files stored in $CATALINA_HOME/conf and $CATALINA_HOME/logs directories.

To set user environment variables edit the ~/.profile:

max@ubuntu-host:~$ nano ~.profile

Append the following lines to the ~.profile file:

export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export CATALINA_HOME=/opt/apache-tomcat-8.0.38
export PATH=$PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin